-
-
Notifications
You must be signed in to change notification settings - Fork 212
How to use
Install and activate Query Monitor as you would any other WordPress plugin. You can download it here on WordPress.org.
While you're logged in as an Administrator you'll see a new menu item in the admin toolbar menu:
The numbers at the top show, in order:
- Page generation time
- Total memory usage
- Total time taken by SQL queries
- Total number of SQL queries
Click the top of the menu to open the Overview
panel, or click any menu item to open its corresponding panel.
Initially you'll probably be most interested in the Queries
panel, which shows all of the database queries that were performed during the page load, and allows you to filter and sort them and determine which component was responsible for each query.
So your site is slow and you've decided to install Query Monitor in order to identify the cause. There are a few panels that you should look at first.
The Queries -> Queries by Component
panel shows you aggregate information about the database queries that were executed by each plugin and theme during the page load. This is a good way to quickly identify a poorly performing theme or plugins.
This panel is sorted by the total time taken for all the queries executed by each component. A plugin that performs a high number of queries, or performs queries that are slow, will contribute to the time that your site takes to load.
The HTTP API Calls
panel shows you information about the server-side HTTP requests that were performed during the page load. These are usually "invisible" causes of a slow site, and can occur sporadically.
If a plugin or theme regularly triggers an HTTP API call during the loading of a page, this will cause it to increase the time that your site takes to load.
The PHP Errors
panel will appear only if some code that executed during the loading of the page caused a PHP error, such as a notice or a warning. If you see a red or orange highlight in Query Monitor's admin toolbar menu, this means an error occurred during the loading of the page and you should investigate it.
Code that triggers a Warning
means the code is not operating as expected, and may be causing broken behaviour on your site and can contribute to an increase in the time that your site takes to load because each error needs to be logged by your server.
Code that triggers a Notice
is less critical but should still be investigated as it can be indicative of poorly written code. Notices may or may not be logged by your server depending on its configuration, so they may or may not be slowing down your site.
Despite its name, Query Monitor includes a large amount of functionality unrelated to database queries. For example, in the Request
panel you can see information about rewrite rules and query variables; in the Template
panel you can see information about the theme template hierarchy and template parts; and in the Scripts
and Styles
panels you can see information about the JavaScript and CSS dependencies on the page.
Click through each of the panels and hopefully you'll find something interesting!