Title: Debug This
Author: Razvan Aldea
Published: <strong>27 december 2012</strong>
Last modified: 4 juni 2025

---

Sök tillägg

![](https://ps.w.org/debug-this/assets/banner-772x250.png?rev=3230726)

![](https://ps.w.org/debug-this/assets/icon-256x256.png?rev=3230726)

# Debug This

 Av [Razvan Aldea](https://profiles.wordpress.org/raldea89/)

[Ladda ner](https://downloads.wordpress.org/plugin/debug-this.0.6.7.zip)

 * [Detaljer](https://sv.wordpress.org/plugins/debug-this/#description)
 * [Recensioner](https://sv.wordpress.org/plugins/debug-this/#reviews)
 *  [Installation](https://sv.wordpress.org/plugins/debug-this/#installation)
 * [Utveckling](https://sv.wordpress.org/plugins/debug-this/#developers)

 [Support](https://wordpress.org/support/plugin/debug-this/)

## Beskrivning

For admins, developers, and support staff, **Debug This** provides a ton of information
about your WordPress installation, all from the front-end admin bar.

 * _The current WP\_Query object_
 * Blog info and options
 * ”Bädda in”-leverantörer
 * Files in rendered HTML (CSS, images, JavaScript)
 * Filter och åtgärder
 * Bildstorlekar
 * Globals and constants
 * Menyer
 * Statistik för objekt-cache
 * Tillägg, MU-tillägg och dropins
 * Omskrivningsregler
 * Queries
 * PHP- och serverinformation
 * Inläggsbilagor
 * Inläggstyper
 * Scripts and styles enqueued
 * Kortkoder
 * Sidopaneler och widgetar
 * Taxonomier och termer
 * Teman
 * Användare
 * WP cron schedules and jobs
 * WP debug log

**Debug This** helps you save time and effort when trying to figure out what’s going
on. Instead of hardcoding debug snippets or writing complex unit
 tests for small
functionality, you can simply bring to the surface what you need right from the 
admin bar.

For example, when viewing a single post, you can see:

 * a list of post attachments,
 * which menus and sidebars are being displayed,
 * the post type, post fields, and meta data,
 * the current query variables and query string,
 * the rewrite rules applied,
 * the author,
 * the terms,
 * and much more.

### Utöka

#### Debug This Functions

New debug modes can be created easily:

    ```
    add_debug_extension(
        $mode,
        $menu_label,
        $description,
        $callback,
        $group = 'General'
    );
    ```

**Exempel**

    ```
    add_debug_extension(
        'actions',
        __('Actions', 'debug-this'),
        __('$wp_actions contains all active registered actions', 'debug-this'),
        'foo_callback',
        'Filters And Actions'
    );
    function foo_callback($buffer, $template){
        global $wp_actions;
        $debug = print_r($wp_actions, true);
        return $debug;
    }
    ```

You can add links to the header of a debug mode page. Place this code within your
debug callback function.

    ```
    add_debug_header_link('http://urltolink', 'Link Label');
    ```

Extensions can be removed as well using `remove_debug_extension($mode);`

**No PRE Tags**

If you don’t want your debug output to be enclosed in PRE tags, simply set the following
in your extension:

    ```
    Debug_This::$no_pre = true;
    ```

**Saved Queries and Execution Time**

Retrieve saved queries and execution time by using the following static properties:

 * `Debug_This::$execution_time`
 * `Debug_This::$queries` – SAVEQUERIES must defined as true

**URL Helpers**

 * `Debug_This::get_current_debug_url()` – current URL with the debug query
 * `Debug_This::get_escape_url()` – used for the debug escape link that links to
   original page URL

#### WP-åtgärder

 * `debug_this` – receives the $mode arg – outputs the debug code sent from the 
   extension modes. The default action is set to priority 5. This allows you to 
   prepend or append any output without conflict using less or greater priorities.

#### WP-filter

There are a few filters you can use to customize Debug This to your needs:

 * `debug_this_template` – receives $template arg – Use your own template
 * `debug_this_default_mode` – receives $mode arg – Alters the mode for the parent
   DT admin bar button link.
 * `debug_this_output` – receives $output, $mode args – Filter debug content before
   it’s rendered

#### JavaScript

To access the built-in Debug This JS functionality, enqueue your custom script with
the dependency set to `debug-this`. Your script will inherit a jQuery dependency.

**Object: debugThis**

 * `debugThis.mode` – nuvarande läge
 * `debugThis.defaultMode`
 * `debugThis.template` – current included template
 * `debugThis.queryVar` – the defined query string variable

**Funktioner:**

 * `isDebug()`
 * `getDebugMode()` – uses `isDebug()`

**Händelser:**

A jQuery `debug-this` event is fired from the footer. You can hook into this event
with the following;

    ```
    jQuery(document).bind('debug-this', function(event, debugThis){
        console.log(debugThis);
    });
    ```

#### Helper Functions

There are three included functions to help you work with files.

 * `debug_this_get_file_ownership($file)` – returns `array('name' => $name, 'group'
   => $group)`
 * `debug_this_get_file_perms($file)` – returns string – Example: 0775
 * `debug_this_convert_perms_to_rwx($perms)` – returns string – converts permission
   number to RWX format – Example: 0755 folder becomes drwxr-xr-x

## Skärmdumpar

 * [[
 * The current query, for example.
 * [[
 * Enhanced display when a Kint debugger plugin is installed (see Description).

## Installation

 1. Upload to your plugins folder, usually `wp-content/plugins/`
 2. Activate the plugin on the plugin screen.
 3. Navigate to the front-end of your website and hover over the ’Debug This’ menu 
    item in the admin bar.

## Vanliga frågor

### Hur använder jag Debug This?

 1. Kontrollera att adminmenyn är aktiverad i din användarprofil.
 2. Visit any page/post/archive on your website and you will see a Debug This menu 
    item on the admin bar.

### Vilken PHP-version är detta kompatibelt med?

We’ve tested on PHP >= 5.2.17

### Kan jag begära nya felsökningslägen?

Certainly! In order to keep the plugin lightweight and performant, requests that
are too localized for the greater good may be refused. If that happens, I will gladly
help you build your own debug mode.

### Kan jag ändra tillägget eller bygga mina egna felsökningslägen?

Yes! Visit the [Extend section](https://wordpress.org/plugins/debug-this/other_notes/)
to find out how you can thoroughly extend Debug This for your own needs.

## Recensioner

![](https://secure.gravatar.com/avatar/d39de316c4c19c9853b7d14a894fb2145236e2438362e2252b148ecf4690f045?
s=60&d=retro&r=g)

### 󠀁[Great plugin](https://wordpress.org/support/topic/great-plugin-30648/)󠁿

 [huntermaster](https://profiles.wordpress.org/huntermaster/) 23 april 2021 1 svar

Very nice, even the phpinfo() colors are displayed correctly.

![](https://secure.gravatar.com/avatar/9a67d815d751ab662aa64282b517a77a59502cfdcaba00fedd46774407294f7e?
s=60&d=retro&r=g)

### 󠀁[Very useful](https://wordpress.org/support/topic/very-useful-2634/)󠁿

 [milenfrom](https://profiles.wordpress.org/milenfrom/) 22 mars 2021 1 svar

Thank you for your great work!

![](https://secure.gravatar.com/avatar/3a0b04e1d6444a6521c68660afbd5aa73e32ee8ede3f2372cde31a1e9474d947?
s=60&d=retro&r=g)

### 󠀁[Awesome and all in one.](https://wordpress.org/support/topic/awesome-and-all-in-one/)󠁿

 [Dash](https://profiles.wordpress.org/dashdesai/) 7 september 2018

Great plugin to truly get under the WordPress hood. Thanks.

![](https://secure.gravatar.com/avatar/ed30d73c31d93f800c6d18c93ace5917e2e498e3247f0b662e38e5a24f447332?
s=60&d=retro&r=g)

### 󠀁[Great work!](https://wordpress.org/support/topic/great-work-247/)󠁿

 [xmarijam](https://profiles.wordpress.org/xmarijam/) 13 oktober 2016

Thanks

![](https://secure.gravatar.com/avatar/283de647f35fb63b00e199571d1ca045fb3401b8983d9cd85755f54b3a87bac4?
s=60&d=retro&r=g)

### 󠀁[Not For Prime Time, because of one reason…](https://wordpress.org/support/topic/not-for-prime-time-because-of-one-reason/)󠁿

 [evanevans333](https://profiles.wordpress.org/evanevans333/) 3 september 2016 4
svar

Our website is an active community website, and we can’t expose the Admin Bar on
the front end, even for a few minutes. In order for this plugin to function, the
Admin Bar must be enabled on the front end, for at least the Administrator level
user. The only way we could do this, is by disabling the Hide Admin Bar plugin, 
and installing another plugin which hides the Admin Bar to everyone except for Administrator
user. We don’t have the luxury of exposing our site for any amount of time, and 
we’re not going to spend the time cloning our site to a test sandbox and removing
and re-adding some Admin Bar plugin that will work … JUST so we can use this DEBUG
THIS plugin. I hope everyone understands. The plugin is probably great. But it’s
fundamentally unusable on a seriously deployed website.

![](https://secure.gravatar.com/avatar/5913940f1e3e507f9b9a0a3018efe43c2fa9316706dabd8fa9df9f953d2d8669?
s=60&d=retro&r=g)

### 󠀁[perefct](https://wordpress.org/support/topic/perefct-1/)󠁿

 [lottasund](https://profiles.wordpress.org/lottasund/) 3 september 2016 1 svar

I had a rewrite rule and it was driving me insane! It took me 1 min to work it out
with this plugin. Thanks a lot.

 [ Läs alla 17 betyg ](https://wordpress.org/support/plugin/debug-this/reviews/)

## Bidragsgivare och utvecklare

”Debug This” är programvara med öppen källkod. Följande personer har bidragit till
detta tillägg.

Bidragande personer

 *   [ Razvan Aldea ](https://profiles.wordpress.org/raldea89/)

”Debug This” har översatts till 1 språk. Tack till [översättarna](https://translate.wordpress.org/projects/wp-plugins/debug-this/contributors)
för deras bidrag.

[Översätt ”Debug This” till ditt språk.](https://translate.wordpress.org/projects/wp-plugins/debug-this)

### Intresserad av programutveckling?

[Läs programkoden](https://plugins.trac.wordpress.org/browser/debug-this/), kika
på [SVN-filförvaret](https://plugins.svn.wordpress.org/debug-this/) eller prenumerera
på [utvecklarloggen](https://plugins.trac.wordpress.org/log/debug-this/) via [RSS](https://plugins.trac.wordpress.org/log/debug-this/?limit=100&mode=stop_on_copy&format=rss).

## Ändringslogg

#### 0.6.7 – 28.01.2024

 * Update: Tested up to WP 6.7

#### 0.6.6 – 18.03.2025

 * Fix: Fixed URL query vars

#### 0.6.5 – 28.01.2024

 * Update: Tested up to WP 6.7

#### 0.6.4 – 07.01.2022

 * Display bug fix
 * Added: Sanitization and escapes

#### 0.6.3 – October 10, 2019

 * Uppdateringar för översättningsfilen

#### 0.6.2 – September 12, 2019

 * Stöd för språkfiler

#### 0.6.1 – June 19, 2018

 * Fix bug with anonymous functions in Filters report.

#### 0.6 – May 22, 2018

 * Fix bug with static methods in Filters report.

#### 0.5.2 – November 17, 2017

 * Improve error handling.

#### 0.5.1 – December 27, 2016

 * Prevent conflict with Kint Debugger when Debug Bar is active.

#### 0.5 – December 15, 2016

 * Update for WordPress 4.4+
 * Add error handling.
 * Add mode for unserialized options.
 * Add mode for active plugins.
 * Add `<pre>` tags conditionally (not every mode).
 * Compatible with Kint wrapper plugins.
 * Compatible with custom error logs.
 * Remove Bootstrap stylesheet.
 * Update POT file.

#### 0.4 – August 29, 2015

 * Fix display of global array variables.
 * Fix display of current template.
 * Fix use of a deprecated function.

#### 0.3.2 – April 17, 2015

 * Improve SAVEQUERIES check.

#### 0.3.1 – March 17, 2015

 * Fix non-static method call. Thanks [Daniele ”Mte90” Scasciafratte](https://wordpress.org/support/profile/mte90).
 * Fix output for TwentyFifteen theme.
 * Replace close button ”X” with Dashicon.

#### 0.3

 * Added advanced remote fetch for buffer
 * Added real saved queries and execution time from original URL – can now be accessed
   as static properties $queries and $execution_time
 * Added `get_current_debug_url()` method – exposes current URL with debug query
 * Added post-meta debug mode. Created new menu section for queried object
 * Updated bloginfo mode to true bloginfo values
 * Updated wp-debug mode with better logic
 * Added functionality for adding header links to the debug mode screen via `add_debug_header_link(
   $url, $label, $classes = '')`
 * Added reset debug log functionality with debug header link for wp-debug mode

#### 0.2.2

 * Added backwards compatibility to 3.3.
 * Added support for no pretty permalinks.

#### 0.2.1

 * Critical fix for PHP <= 5.2 Removed anonymous functions.
 * Fixed undefined $debug notices for all versions.

#### 0.02

 * Added new debug modes: Apache modules, PHP loaded extensions, file permissions,
   php.ini, $_SERVER, and execution time.
 * Added three functions for getting file ownership and permissions
    - `debug_this_get_file_ownership($file)`
    - `debug_this_get_file_perms($file)`
    - `debug_this_convert_perms_to_rwx($perms)`

#### 0.01

 * Debug This Creation

## Meta

 *  Version **0.6.7**
 *  Senast uppdaterat **10 månader sedan**
 *  Aktiva installationer **2 000+**
 *  WordPress-version ** 5.2 eller senare **
 *  Testat upp till **6.8.5**
 *  PHP-version ** 5.6 eller senare **
 *  Språk
 * [English (US)](https://wordpress.org/plugins/debug-this/) och [Swedish](https://sv.wordpress.org/plugins/debug-this/).
 *  [Översätt till ditt språk](https://translate.wordpress.org/projects/wp-plugins/debug-this)
 * Etiketter
 * [debug](https://sv.wordpress.org/plugins/tags/debug/)[debugger](https://sv.wordpress.org/plugins/tags/debugger/)
   [developer](https://sv.wordpress.org/plugins/tags/developer/)[hooks](https://sv.wordpress.org/plugins/tags/hooks/)
   [query](https://sv.wordpress.org/plugins/tags/query/)
 *  [Avancerad vy](https://sv.wordpress.org/plugins/debug-this/advanced/)

## Betyg

 4.8 av 5 stjärnor.

 *  [  16 5-stjärniga recensioner     ](https://wordpress.org/support/plugin/debug-this/reviews/?filter=5)
 *  [  0 4-stjärniga recensioner     ](https://wordpress.org/support/plugin/debug-this/reviews/?filter=4)
 *  [  0 3-stjärniga recensioner     ](https://wordpress.org/support/plugin/debug-this/reviews/?filter=3)
 *  [  0 2-stjärniga recensioner     ](https://wordpress.org/support/plugin/debug-this/reviews/?filter=2)
 *  [  1 1-stjärnig recension     ](https://wordpress.org/support/plugin/debug-this/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/debug-this/reviews/#new-post)

[Se alla recensioner](https://wordpress.org/support/plugin/debug-this/reviews/)

## Bidragande personer

 *   [ Razvan Aldea ](https://profiles.wordpress.org/raldea89/)

## Support

Har du något att säga? Behöver du hjälp?

 [Visa supportforum](https://wordpress.org/support/plugin/debug-this/)