Query Monitor

Wordpress Plugin
Download latest - 3.10.1

Developers

johnbillion

Download Stats

Today 1,302
Yesterday 1,574
Last Week 7,914
All Time 761,096
Banner 772x250

Query Monitor is the developer tools panel for WordPress. It enables debugging of database queries, PHP errors, hooks and actions, block editor blocks, enqueued scripts and stylesheets, HTTP API calls, and more.

It includes some advanced features such as debugging of Ajax calls, REST API calls, and user capability checks. It includes the ability to narrow down much of its output by plugin or theme, allowing you to quickly determine poorly performing plugins, themes, or functions.

Query Monitor focuses heavily on presenting its information in a useful manner, for example by showing aggregate database queries grouped by the plugins, themes, or functions that are responsible for them. It adds an admin toolbar menu showing an overview of the current page, with complete debugging information shown in panels once you select a menu item.

For complete information, please see the Query Monitor website.

Here's an overview of what's shown for each page load:

  • Database queries, including notifications for slow, duplicate, or erroneous queries. Allows filtering by query type (SELECT, UPDATE, DELETE, etc), responsible component (plugin, theme, WordPress core), and calling function, and provides separate aggregate views for each.
  • The template filename, the complete template hierarchy, and names of all template parts that were loaded or not loaded.
  • PHP errors presented nicely along with their responsible component and call stack, and a visible warning in the admin toolbar.
  • Blocks and associated properties in post content when using WordPress 5.0+ or the Gutenberg plugin.
  • Matched rewrite rules, associated query strings, and query vars.
  • Enqueued scripts and stylesheets, along with their dependencies, dependents, and alerts for broken dependencies.
  • Language settings and loaded translation files (MO files) for each text domain.
  • HTTP API requests, with response code, responsible component, and time taken, with alerts for failed or erroneous requests.
  • User capability checks, along with the result and any parameters passed to the capability check.
  • Environment information, including detailed information about PHP, the database, WordPress, and the web server.
  • The values of all WordPress conditional functions such as is_single(), is_home(), etc.
  • Transients that were updated.

In addition:

  • Whenever a redirect occurs, Query Monitor adds an HTTP header containing the call stack, so you can use your favourite HTTP inspector or browser developer tools to trace what triggered the redirect.
  • The response from any jQuery-initiated Ajax request on the page will contain various debugging information in its headers. PHP errors also get output to the browser's developer console.
  • The response from an authenticated WordPress REST API request will contain various debugging information in its headers, as long as the authenticated user has permission to view Query Monitor's output.

By default, Query Monitor's output is only shown to Administrators on single-site installations, and Super Admins on Multisite installations.

In addition to this, you can set an authentication cookie which allows you to view Query Monitor output when you're not logged in (or if you're logged in as a non-Administrator). See the Settings panel for details.

Other Plugins

I maintain several other plugins for developers. Check them out:

  • User Switching provides instant switching between user accounts in WordPress.
  • WP Crontrol lets you view and control what's happening in the WP-Cron system

Privacy Statement

Query Monitor is private by default and always will be. It does not persistently store any of the data that it collects. It does not send data to any third party, nor does it include any third party resources.

Query Monitor's full privacy statement can be found here.


Releases (78 )

Version Release Date Change Log
3.10.1 2022-09-09
3.10.0 2022-09-08
3.9.0 2022-04-15
3.8.2 2022-01-07
3.8.1 2022-01-02
3.8.0 2021-12-27
3.7.1 2021-05-13
3.7.0 2021-05-13
3.6.8 2021-05-09
3.6.7 2021-01-20
3.6.6 2021-01-13
3.6.5 2020-11-13
3.6.4 2020-08-20
3.6.3 2020-08-20
3.6.2 2020-08-20
3.6.1 2020-07-25
3.6.0 2020-05-08
3.5.2 2020-04-20
3.5.1 2019-12-02
3.5.0 2019-11-28
3.4.0 2019-10-08
3.3.7 2019-07-12
3.3.6 2019-05-20
3.3.5 2019-05-13
3.3.4 2019-03-23
3.3.3 2019-03-17
3.3.2 2019-03-03
3.3.1 2019-02-16
3.3.0 2019-02-14
3.2.2 2018-12-17
3.2.1 2018-12-09
3.2.0 2018-12-09
3.1.1 2018-09-18
3.1.0 2018-07-17
3.0.1 2018-05-22
3.0.0 2018-04-12
2.17.0 2017-11-09
2.16.2 2017-11-03
2.16.1 2017-11-01
2.15.0 2017-09-29
2.14.0 2017-09-08
2.13.4 2017-03-12
2.13.3 2017-02-21
2.13.2 2016-12-06
2.13.1 2016-09-09
2.13.0 2016-09-08
2.12.0 2016-08-03
2.11.4 2016-07-13
2.11.3 2016-07-13
2.11.2 2016-07-13
2.11.1 2016-06-12
  • Fix Undefined index: cache_misses.
  • Don't load QM during cron requests because we've no persistent storage yet and no means of outputting data that's collected.
  • Tweak some colours to bring them inline with the WordPress admin area colours.
  • Better handling for HTTP requests which don't include the ssl argument for any reason.
2.11.0 2016-05-28
  • Template parts used in the current request are now listed along with the template file.
  • Fix the REST API output for embedded requests and internal API calls.
  • Enable QM's output to appear in customiser preview responses.
  • Add support for the AMP plugin by Automattic, which short-circuits template output.
  • Highlight the fact when an HTTP request has disabled certificate verification.
  • Take into account custom content directory locations that are outside of ABSPATH when removing leading paths from file names.
  • Even more fallback support for when jQuery is broken or isn't available.
  • Introduce a collector for the object cache. Only outputs an overview at the moment.
  • Better formatting in the Duplicate Queries panel.
  • Introduce a fallback method of detecting errors in queries when QM_DB is not in use.
  • Improve the initial state of QM's output when the admin toolbar is not in use.
2.10.0 2016-03-27
  • Add a new panel which lists duplicated database queries.
  • Add support for displaying QM's output when viewing an embed.
  • Differentiate regular plugins from mu-plugins when displaying components.
  • Ensure early errors are always reported regardless of system level error reporting.
  • Ensure that script and style dependency highlighting is restricted to the scripts and styles tables, respectively.
  • Rearrange the Environment section output a little.
  • Various minor tweaks.
2.9.1 2016-03-14
  • Query callers and query components can now be clicked to filter the main query list by that caller or component.
  • Add support for pausing Jetpack's Infinite Scroll module when viewing QM output in the footer.
  • Add support for WordPress.com VIP Go shared plugins as an explicit component.
  • Send nocache headers when QM is active.
  • Various minor tweaks.
2.9.0 2016-02-26
  • Introduce a new panel which displays all matching rewrite rules for the current request.
  • Remove the deprecated is_comments_popup() from the list of conditionals.
  • Improve the display of scripts and styles which are blocked by Airplane Mode (0.1.4 and later).
  • Gracefully handle enqueued assets which are deregistered late without being unenqueued.
  • Add a filter to hide the extended query information prompt.
  • Various minor bugfixes and code quality tweaks.
2.8.1 2015-11-22
  • Correctly detect the file name and line number responsible for loading translation files in plugins which use load_textdomain().
  • Correct the visibility of the before_output() method in the REST dispatcher.
  • Load the languages collector early so it catches plugins which load their translation files when they initialise.
  • Remove an erroneous double quote.
  • Remove connection as param in mysqli_get_client_version().
  • Various CSS fixes.
2.8.0 2015-10-19
  • A new Languages component for debugging languages and text domains. Thanks, @MPolleke!
  • REST API debugging in the form of HTTP headers when performing an authenticated REST API request. Shows PHP errors when relevant, along with an overview of memory usage, processing time, database query number, and database query time.
  • Various visual improvements, including displaying the relevant file name below stack trace functions, and a more visible stack trace expansion toggle.
  • Add is_embed(), is_comment_feed(), and is_user_admin() to the list of conditional functions.
  • Add HHVM, SAPI, and MySQL client info to the Environment component.
  • QM is now not loaded at all on the CLI.
  • Avoid an issue with the CloudFlare Flexible SSL plugin.
  • Improve the output of Multisite's $current_blog and $current_site in the Request component.
  • Fully handle Windows paths when detecting a file component.
  • Don't display the symlink warning when using a secondary instance of WPDB.
  • Whole bunch of internal structure refactoring, escaping, and other misc tweaks.
2.7.4 2015-08-08
  • An unknown component now gets marked as such, not as Core.
  • Support for invokable objects in action and filter callbacks.
  • Fix fatal error when activating Debug Bar plugin after Query Monitor has already been activated.
  • Implement escaping inside QM_Output_Html::format_url() which can deal with unsafe output. Thanks to Stephen Harris for the responsible disclosure.
2.7.3 2015-04-15
  • Improvements to the shutdown handler for PHP errors, so it handles syntax and compilation errors too.
2.7.2 2015-04-08
  • Implement a shutdown handler for PHP errors to avoid fatals being unintentionally hidden when display_errors is on.
  • Don't attempt to do anything with scripts and styles if a corresponding header action hasn't fired.
  • Don't sort the enqueued scripts and styles, so they're output in the order in which they're enqueued.
  • For the time being, let's not load QM when using the CLI because we've no persistent storage and no means of outputting collected data on the CLI.
  • Call static methods using their class name, not a variable. Fixes compatibility with PHP 5.2.
2.7.1 2015-03-14
  • Display a warning (rather than triggering a fatal error) for scripts and style dependencies which have gone missing during the duration of the page load.
  • Tweak some more Debug Bar add-on styles.
  • Ensure erroneous non-SELECT queries are also highlighted in red.
  • Further tweaks to QM's output if JavaScript isn't available for any reason.
  • Add PHP4-style constructors to the Debug Bar classes to avoid fatals with Debug Bar add-ons which are explicitly using them.
  • In the event that QM's JavaScript doesn't get enqueued, force the QM output to display so users can at least debug the issue.
  • Remove the abstract output() methods from abstract classes which implement QM_Output to avoid PHP bug #43200.
  • Fixing a notice in the admin component when get_current_screen() isn't an object.
2.7.0 2015-03-09
  • Detect broken dependencies for scripts and styles.
  • Calculate and output the dependents of scripts and styles.
  • Add transparent support for Debug Bar add-on panels.
  • Add support for WordPress.com VIP plugins in the component detection.
  • Sortable and filterable columns for HTTP requests.
  • Display a warning when something's hooked onto the all action.
  • Clearer output for the template file and component names when a child theme is in use.
  • Move the current blog information to the Request component. Display current site information if we're running a multi-network.
  • Allow default error handlers, such as error logging, to continue to function as expected.
  • Don't skip outputting the calling function name in the database error list.
  • New namespaced filter names for a bunch of filterable things.
  • Add a qm/process filter to allow users to disable QM's processing and output.
  • Display the value of WP_HTTP_BLOCK_EXTERNAL and WP_ACCESSIBLE_HOSTS in the HTTP component.
  • New storage and registration mechanisms for collectors, dispatchers, and output handlers.
  • CSS tweaks to better match wp-admin styles.
2.6.10 2015-02-15
  • Fix some PHP 5.2 compatibility issues introduced in 2.6.9; More tweaks to the CSS so QM avoids being covered up by the admin menu.

=

2.6.9 2015-01-24
  • New Scripts & Styles component; Support the new admin menu behaviour in WP 4.1; Fix the positioning of output when using the Twenty Fifteen theme.

=

2.6.8 2014-12-17
  • Misc minor bugfixes. Nothing to get excited about.

=

2.6.7 2014-05-03
  • Various tweaks under the hood. No shiny new features just yet.

=

2.6.6 2014-02-27
  • More robust support for alternative database drivers (including mysqli in core)
  • Avoid warnings and notices when a custom database class is in place and it's not saving queries (ie. HyperDB)
  • Better handling when certain functions (such as memory_get_peak_usage()) are disabled
2.6.5 2014-02-17
  • Avoid the "Class 'QM_Backtrace' not found" error
  • Correct the layout of the Slow Queries and Query Errors panels
  • Move back-compat CSS into its own file
  • Huge simplification of code in db.php by using parent::query()
  • Misc visual tweaks
2.6.4 2014-02-03
  • Introduce sortable columns for database query times and numbers
  • Display the queried object in the Request panel
  • Fix the admin menu behaviour when viewing QM output
  • Fixes for output buffering and AJAX requests
  • Several bits of code cleanup
2.6.3 2014-01-19
  • Clickable stack traces and file names if you've configured Xdebug's file_link_format setting
  • Show the number of times each PHP error has been triggered
  • Visual bugfixes when using Firefox
  • Fix a bug which was preventing AJAX debugging from being output
  • Fix a fatal error when using PHP 5.2 on Windows
  • Display HTTP proxy information when appropriate
  • Introduce the QM_DISABLE constant for unconditionally disabling Query Monitor
  • Always return true from our PHP error handler to suppress unwanted PHP error output (eg. from Xdebug)
  • Internals: Much more robust logic and even more separation of data collection and output
  • Internals: Many performance improvements
2.6.2 2013-12-12
  • Fix two fundamental stability and compatibility issues (great news)
  • Various visual tweaks
  • Handle some uncommon use cases of the HTTP API
2.6.1 2013-12-08
  • Remove a file that was accidentally committed to the wordpress.org repo
2.6 2013-12-08
  • Toggleable stack traces for queries
  • Show deprecated errors in the PHP Errors panel
  • Replace the Query Vars panel with a Request panel with more information
  • Display a warning when db.php isn't in place
  • Fix some PHP 5.2 compatibility
  • Considerable restructuring of the underlying code to increase abstraction
2.5.6 2013-12-03
  • Fix the "Invalid header" issue. Woo!
2.5.5 2013-12-02
  • Better layout for the Hooks panel
  • Fix some AJAX issues
  • Fix some output buffer compatibility issues which were causing fatal errors
2.5.4 2013-11-22
  • Avoid a fatal error when strict errors are triggered at compile time
  • Avoid a warning when PDO or Mysqli is in use
  • Updated CSS for WordPress 3.8. Retains support for default 3.7 and MP6 on 3.7
  • Tweak PHP error_reporting in the Environment component
2.5.3 2013-11-20
  • Show an inline error when a hook has an invalid action
  • Show a warning in the admin toolbar when HTTP requests fail
  • Fix the time shown when filtering queries
  • Fix empty stack traces (regression at some point)
2.5.2 2013-11-19
  • Prevent uncaught exceptions with static method actions
  • Misc formatting tweaks