Query Monitor

Description

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, user capability checks, and full support for block themes and full site editing. 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.

Pour des informations complètes, veuillez consulter le site Web de Query Monitor.

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

  • Requêtes de base de données, y compris les notifications pour les requêtes lentes, en double ou erronées. Permet le filtrage par type de requête (SELECT, UPDATE, DELETE, etc), par composant responsable (plugin, thème, noyau WordPress), et par fonction appelante, et fournit des vues agrégées séparées pour chacun.
  • The template filename, the complete template hierarchy, and names of all template parts that were loaded or not loaded (for block themes and classic themes).
  • PHP errors presented nicely along with their responsible component and call stack, and a visible warning in the admin toolbar.
  • Usage of « Doing it Wrong » or « Deprecated » functionality in the code on your site.
  • Blocks and associated properties within post content and within full site editing (FSE).
  • Correspondance entre les règles de réécriture, les chaînes de requête associées et les variables de requête.
  • Les scripts et feuilles de style en attente, ainsi que leurs dépendances, les dépendances et les alertes pour les dépendances brisées.
  • Language settings and loaded translation files (MO files and JSON files) for each text domain.
  • API HTTP demandes, avec code de réponse, composant responsable et temps pris, avec des alertes pour échec ou erreur demandes.
  • ilisateur des contrôles de capacité, ainsi que le résultat et tout autre paramètres passé au contrôle de capacité.
  • Environment information, including detailed information about PHP, the database, WordPress, and the web server.
  • Les valeurs de toutes les fonctions conditionnelles de WordPress telles que is_single(), is_home(), etc.
  • Transitions qui ont été mises à jour.
  • Usage of switch_to_blog() and restore_current_blog() on Multisite installations.

De plus :

  • 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.
  • La réponse de toute requête Ajax initiée par jQuery- sur la page contiendra diverses informations de débogage dans ses en-têtes. Les erreurs PHP sont également affichées dans la console de développement du navigateur.
  • The response from an authenticated WordPress REST API request will contain an overview of performance information and PHP errors in its headers, as long as the authenticated user has permission to view Query Monitor’s output. An an enveloped REST API request will include even more debugging information in the qm property of the response.

Par défaut, la sortie de Query Monitor n’est affichée qu’aux administrateurs et administratrices sur les installations à site unique, et aux super admins sur les installations multisites.

En plus de cela, vous pouvez définir un cookie d’authentification qui vous permet de voir la sortie de Query Monitor lorsque vous hors connexion (ou si vous êtes connecté en tant que non-administrateur). Voir le panneau des réglages pour plus de détails.

Autre Plugins

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

  • Utilisateur Commutation fournit une commutation instantanée entre utilisateur comptes en WordPress.
  • WP Crontrol vous permet vue et contrôler ce qui se passe dans le système WP-Cron

Déclaration de confidentialité

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.

La déclaration de confidentialité complète de Query Monitor se trouve ici.

Accessibility Statement

Query Monitor aims to be fully accessible to all of its users. It implements best practices for web accessibility, outputs semantic and structured markup, uses the accessibility APIs provided by WordPress and web browsers where appropriate, and is fully accessible via keyboard.

That said, Query Monitor does not conform to the Web Content Accessibility Guidelines (WCAG) 2.0 at level AA like WordPress itself does. The main issue is that the user interface uses small font sizes to maintain a high information density for sighted users. Users with poor vision or poor motor skills may struggle to view or interact with some areas of Query Monitor because of this. This is something which I’m acutely aware of and which I work to gradually improve, but the underlying issue of small font sizes remains.

If you’ve experienced or identified another accessibility issue in Query Monitor, please open a thread in the Query Monitor plugin support forum and I’ll try my best to address it swiftly.

Captures d’écran

  • Admin Toolbar Menu
  • Base de données agrégée Des requêtes par composant
  • Contrôles de capacité
  • Requêtes de base de données
  • rochets et actions
  • Nécessite HTTP
  • Aggregate Requêtes de base de données by Calling Function

FAQ

Does this plugin work with PHP 8?

Yes, it’s actively tested and working up to PHP 8.2.

Who can access Query Monitor’s output?

Par défaut, la sortie de Query Monitor n’est affichée qu’aux administrateurs et administratrices sur les installations à site unique, et aux super admins sur les installations multisites.

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 when you’re logged in as a user who cannot usually see Query Monitor’s output. See the Settings panel for details.

Est-ce que Query Monitor lui-même a un impact sur le temps de génération des pages ou sur l’utilisation de la mémoire ?

Réponse courte : oui, mais uniquement un peu.

Long answer: Query Monitor has a small impact on page generation time because it hooks into WordPress in the same way that other plugins do. The impact is low; typically between 10ms and 100ms depending on the complexity of your site.

Query Monitor’s memory usage typically accounts for around 10% of the total memory used to generate the page.

Can I prevent Query Monitor from collecting data during long-running requests?

Yes, if anything calls do_action( 'qm/cease' ) then Query Monitor will cease operating for the remainder of the page generation. It detaches itself from further data collection, discards any data it’s collected so far, and skips the output of its information.

This is useful for long-running operations that perform a very high number of database queries, consume a lot of memory, or otherwise are of no concern to Query Monitor, for example:

  • Backing up or restoring your site
  • Exportation une grande quantité de données
  • Running security scans

Y a-t-il des modules pour Query Monitor ?

Une liste de modules pour Query Monitor peut être trouvée ici.

In addition, Query Monitor transparently supports add-ons for the Debug Bar plugin. If you have any Debug Bar add-ons installed, deactivate Debug Bar and the add-ons will show up in Query Monitor’s menu.

Où puis-je suggérer une nouvelle fonctionnalité ou signaler un bogue ?

Please use the issue tracker on Query Monitor’s GitHub repo as it’s easier to keep track of issues there, rather than on the wordpress.org support forums.

Is Query Monitor available on Altis?

ui le Altis Développeur Outils sont construits au-dessus de Requête Moniteur.

Is Query Monitor available on WordPress VIP?

Yes, but a user needs to be granted the view_query_monitor capability to see Query Monitor even if they’re an administrator. See the WordPress VIP documentation for more details.

I’m using multiple instances of `wpdb`. How do I get my additional instances to show up in Query Monitor?

This feature was removed in version 3.12 as it was rarely used and considerably increased the maintenance burden of Query Monitor itself. Feel free to continue using version 3.11 if you need to make use of this feature.

Can I click on stack traces to open the file in my editor?

Yes. You can enable this on the Settings panel.

Acceptez-vous des dons ?

I am accepting sponsorships via the GitHub Sponsors program. If you work at an agency that develops with WordPress, ask your company to provide sponsorship in order to invest in its supply chain. The tools that I maintain probably save your company time and money, and GitHub sponsorship can now be done at the organisation level.

In addition, if you like the plugin then I’d love for you to leave a review. Tell all your friends about it too!

Avis

3 septembre 2023
Thank you for this ingenious plugin. It has already saved me hours of work debugging. It is also extremely helpful when optimising your own plugins. I have never had any problems with Query Monitor. I can only recommend it to every developer to use it as well.
4 juillet 2023
Tenia un problema de carga en el wordpress y consegui sacar el error en menos de 5 minutos
1 juillet 2023 1 réponse
...it would be nice to have an option to deactivate the plugin on mobile devices. I noticed that it slows down the loading and time to be able to interact with the pages significantly. Sure, sometimes it would be useful to have it on mobile as well, and that could be added as an option.Otherwise it's a great, no the best plugin for that use case 😀👍
Lire les 426 avis

Contributeurs/contributrices & développeurs/développeuses

« Query Monitor » est un logiciel libre. Les personnes suivantes ont contribué à cette extension.

Contributeurs

“Query Monitor” a été traduit dans 21 locales. Remerciez l’équipe de traduction pour ses contributions.

Traduisez « Query Monitor » dans votre langue.

Le développement vous intéresse ?

Parcourir le code, consulter le SVN dépôt, ou s’inscrire au journal de développement par RSS.

Journal

3.13.1

  • Avoid a fatal error if a deprecated warning is triggered early on during the bootstrap process
  • Avoid a PHP warning that can be triggered during certain HTTP API requests when Curl is not in use
  • Don’t load QM during the plugin update process

3.13.0

  • Adds a dedicated panel for « Doing it Wrong » and deprecated functionality usage
  • Allows data in the HTTP API requests panel to be filtered by host name
  • Adds a « Type » column wherever a list of hooks can show both actions and filters
  • Improves various aspects of the « Editor » setting
  • Increases the minimum supported version of PHP to 7.4
  • Many thanks to @crstauf for the majority of the new features in this release

3.12.3

  • Improves theme template part data collection when the Gutenberg plugin is in use with a block theme
  • Skips attempting to resolve a block template if the theme doesn’t support block templates
  • Removes the fallback to $EZSQL_ERROR for database query errors as it’s not possible to determine if the error should be ignored

3.12.2

  • Adds the total count to the table footer of the PHP Errors panel
  • Improves the destination URL for links that point to the site editor
  • Implements some minor visual improvements
  • Removes unreliable information about the transport for HTTP API requests
  • Removes Query Monitor output from the interim login modal

3.12.1

  • Corrects some inter-panel links that point to the Queries panel and sub-panels
  • Switches to sessionStorage for the selected table column filters so they don’t persist across tabs or sessions
  • Removes the « Debug Bar: » prefix on the menus for panels inherited from the Debug Bar plugin

3.12.0

  • Clarifies and improves information in the Template panel when a block theme or full site editing (FSE) is in use
  • Avoids PHP warnings if a third party plugin makes unexpected changes to language file paths
  • Implements some minor performance improvements
  • Removes misleading information about WordPress memory limits
  • Removes support for multiple instances of wpdb (see the FAQ for more information)

3.11.2

  • Implements various accessibility improvements
  • Fixes an issue where not all admin area footer scripts were shown in the Scripts panel
  • Improves output when the SQLite feature in the Performance Labs plugin is in use
  • Removes QM output altogether from the Customizer
  • Ensures wp-content/db.php from another plugin doesn’t get removed when deactivating QM

3.11.1

  • Avoids a fatal error in PHP 8 when posix_getpwuid() or posix_getgrgid() doesn’t return an expected value.

3.11.0

  • Adds a new « Multisite » panel that shows usage of switch_to_blog() and restore_current_blog() on Multisite installations
  • Improves the output shown for blocks and template parts when block themes or full site editing is in use
  • Introduces new QM_Data and QM_Component classes to make the data collection more structured and reliable
  • Increases the minimum supported version of PHP to 7.2
  • Improves the performance of SVG icons
  • Removes the ability to completely hide silenced PHP errors
  • Avoids some deprecated notices in PHP 8.2
  • Improves the performance of the PHP class autoloader

3.10.1

  • Prevents logging duplicate entries for multiple calls to load the same translation file
  • Brings the dispatcher priority back down to 9 for maximum compatibility with other plugins that use a shutdown handler

3.10.0

  • Adds information about the current language on the Languages panel
  • Reduces the chance that Query Monitor blames itself for PHP errors that don’t have a stack trace
  • Replaces the use of Dashicons with inline SVGs and removes the dashicons dependency
  • Switches to class autoloading via Composer for reduced memory usage
  • Changes the priority of the shutdown dispatcher from 0 to PHP_INT_MAX to ensure as much data as possible is collected
  • Improves the styling of Debug Bar add-ons
  • Fixes some erroneous localisation of float values in REST API output
  • Bumps the minimum supported PHP version to 5.6
  • Improves various other bits and bobs

3.9.0

  • Introduces a dark mode toggle on the Settings panel, which replaces the QM_DARK_MODE constant
  • Prevents errors with undefined constants being reported in db.php
  • Adds more comprehensive handling of unexpected values in stack traces
  • Fixes PHP Warning ‘Header may not contain NUL bytes’ when outputting headers

3.8.2

  • orrection certains déprécié avis avec PHP 8.1
  • Améliorez la gestion de SQL requêtes qui consistent seulement de MySQL commentaires

3.8.1

  • Corrections une incompatibilité avec les versions PHP antérieures à 7.2
  • Corrections a avertissement qui était déclenché au sein du PHP en-tête répartiteur
  • Introduces the qm/component_type/{$type} filter
  • Introduit un QM_VERSION constant

3.8.0

  • Introduces the ability for a third party to cease all further data collection and output at any point by calling do_action( 'qm/cease' ), for example to prevent memory exhaustion during long-running operations
  • Reduces the width of the admin toolbar menu item by using lower decimal precision
  • Improves the Template panel information when a block theme is in use (for Full Site Editing)
  • Improves the performance and accuracy of stack traces and calling function information
  • Corrects some formatting of numbers and error messages in the REST API output
  • Adds more useful information when a persistent object cache or opcode cache isn’t in use
  • Improves clarity in the Scripts and Styles panels when any of the URLs include a port number
  • Introduces the qm/component_context/{$type} filter to complement qm/component_name/{$type} and qm/component_dirs
  • Improves internal code quality, internationalisation, and further reduces overall memory usage

3.7.1

  • Add a fallback for timing processing during Ajax requests that are dispatched before the shutdown hook.

3.7.0

3.6.8

  • Add WordPress memory usage statistic to Overview panel
  • Add block context information to the Blocks panel
  • Correction mise en évidence des cellules TH
  • Fix some panel resizing bugs

3.6.7

  • Mettre en œuvre un QM_DB_SYMLINK constant pour empêcher le db.php symlink mis en place.
  • Retirer une dépendance sur SAVEQUERIES dans le requête collectionneur.
  • Retirer invalide portée attributs sur les cellules de table.

3.6.6

  • PHP 8 fix.
  • Improve the display for various empty values when logging.
  • Don’t display child menus until the parent menu is active. Makes the menu clearer.
  • Detect local host names in HTTP API requests and don’t mark them as ignoring certificate verification.
  • Prevent the text in toggle buttons from being selected when selecting data in tables.
  • Remove support for the Dark Mode plugin which isn’t Dark Mode any more.

3.6.5

  • Toujours spectacle le Journaux panneau, avec un lien à Aidez-moi docs.
  • Whole bunch of improvements to QM’s « broken » state handling.
  • Retirer utilisation de déprécié méthodes jQuery.
  • Ajouter soutien pour les dépendances Altis en tant que composants.
  • Ajouter innodb_buffer_pool_size variable dans la liste des environnements mysql.
  • Preformat the Logger output
  • Fix the PHP version check.

3.6.4

  • Corriger un erreur introduit en 3.6.2 avec le supplément tôt erreur manipulation (ironique).

3.6.3

  • Corrigez le taille de la fin icône.

3.6.2

  • Capture and display the most recent PHP error that occurred before QM loaded.
  • Add support for the environment type added in WP 5.5.
  • Évitez une traduction potentiellement vierge pour un pluriel formes.
  • Augmentez le contraste en mode sombre.
  • Combinez la réponse-lié sections du Demande panneau.
  • Add extra sanity checking when attempting to fetch the posix user information.

3.6.1

  • Adjust the bottom margin when the QM panel is open so QM doesn’t cover the bottom of the page. Works more often than not.
  • Prevent QM from triggering a fatal itself if a fatal occurs before the HTML dispatcher is loaded.
  • Add an informational message to the template output when template hooks are in use.
  • Fix errors caused by missing user or group IDs when collecting environment data.
  • Add TextMate to list of supported editors.
  • Demote some cache warnings to informational messages.
  • Soutien retour en arrière QM_Backtrace.

3.6.0

  • Improvements to the UI when a fatal error occurs, including an admin toolbar warning.
  • Improvements to the UI when QM is running in « broken » mode due to missing jQuery or an unrecoverable JavaScript error.
  • Don’t display fatal errors if error display is off and the user cannot view QM.
  • Improvements to the visual appearance of the wp_die() output.
  • Simplify re-throwing a caught exception so QM doesn’t get the blame for fatal errors, eg. in the WordPress core fatal error handler.
  • Add support for logging a variable of any type in the logger, as a replacement for var dumping.
  • Don’t show a message for errors in Ajax calls that have already occurred on the main page load.
  • Don’t dispatch QM during an iframed request, eg the plugin info modal or an upgrader action.
  • Hide QM itself from various panels by default to remove noise. Can be controlled via the existing QM_HIDE_SELF configuration constant.
  • Support for the new is_favicon() conditional added in WP 5.4.
  • Fix the side panel resizing functionality.
  • Add a WP-CLI command for creating the symlink to the db file.
  • Add filters to QM_Util::get_file_dirs() and get_file_component() to allow support for non-standard plugin and theme locations.
  • Add an action that fires when QM enqueues its assets, so add-on plugins can enqueue theirs only when necessary.

3.5.2

3.5.1

  • Defer population of the found_formatted property because this can fire before WPML has initialised its locale proxy. Fixes #485.
  • Ensure all error types are accounted for when populating the panel menu error count. Fixes #486.

3.5.0

  • Add an editor selection UI on the Settings panel.
  • Improve the output of missing asset dependencies.
  • Improve the output of unsuccessful template parts.
  • Handle non-boolean constants such as WP_DEBUG_LOG, which now accepts a path too.
  • Add support for touch devices when resizing the panel. (Works alright-ish, probably needs some animation frame work.)
  • Apply the same styles to notices, deprecated, and strict errors.
  • Some more style resets for compatibility with popular themes.
  • Style changes to bring QM inline with WP 5.3’s improved button and focus styles.
  • More colour contrast and dark mode tweaks.
  • Add permalink-related filters to the concerned filters for the Request panel.
  • Fix and improve the admin toolbar menu hover colours.
  • Add the error count to the panel menu.
  • Remove unnecessary use of plural forms added in 3.4.0.
  • More CSS resets to avoid overly tall filters in Firefox.
  • Improved styling for warning rows.
  • Display the log count in the menu item.

3.4.0

  • Introduce an exception handler so a stack trace can be shown for fatal errors in PHP >= 7.
  • Add separate persistence of QM window for front-end and admin area.
  • Add the request and response HTTP headers to the Request panel.
  • Introduce Started and Stopped columns in the Timings panel.
  • By popular demand, revert back to closest first ordering of stack traces so they’re inline with most other dev tools out there.
  • Show the script handle in addition to the text domain in the Languages panel.
  • Improve the panel menu highlighting colours.
  • Better presentation of the default and current values for the settings constants.
  • Truncate long host names in the Scripts and Styles panels.
  • Add some more of the admin screen globals to the admin collector.
  • Switch back to using a monospace font in numeric data cells.
  • Allow dark mode to be enabled with QM_DARK_MODE.
  • Display the total query count even when SAVEQUERIES is defined as false.
  • Allow proper plural forms to be used wherever a phrase includes a numeric value.
  • More style resetting for compatibility with Twenty Twenty.
  • Avoid a division by zero when cache hits is 0.
  • Switch to (mostly) CSS for the child menu item marker.