Query Monitor – the only plugin I (almost) always use

One of the questions I get a lot is: what plugin do you always use. My answer is usually: none … except for when I still develop a site. Then it is Query Monitor and here is why.

What does Query Monitor do?

The Query Monitor plugin is THE debugging plugin for WordPress. It started with only helping to debug SQL queries, but can now be used to debug almost anything in WordPress. I’ve written a couple of posts on it before, but let me list a few of the hundreds of debugging features it has:

  • SQL queries
  • HTTP request
  • Loaded template files (partials) and template hierarchy file used
  • Loaded JavaScript files
  • Loaded CSS files
  • Hooks (actions and filters) used
  • Loaded translation files (and listing those that are missing)
  • HTTP API requests performed by the backend
  • Updated transients
  • Permissions (capabilites) checked
  • Information on the environment (PHP, database, WordPress, server)
  • List of all true/false Conditional Tags on the current page

Query Monitor is available on the frontend and backend. By default, only administator users can use it, but you can set an authentication cookie to even use it when logged out, which is really helpful when you want to debug a site as a normal visitor.

Why do I use Query Monitor?

If you are in the process of creating a website and something does not work, you can take many approached to debug the issue. For many typical issues, however, you don’t even need to activate the WP_DEBUG mode or use something like Xdebug. The Query Monitor plugin might just tell you what went wrong.

It is also really helpful to find slow SQL queries and then investigate further why they are so slow. I also use it a lot to find out why some translations do not work – often times because WordPress tries to load a file with the wrong name.

I don’t know how many hours or even days of debugging time I have saved, just because I always use Query Monitor. At one point, I even added an alias to my Linux system to install Query Monitor using the WP-CLI, just because I did that so often. 😅

Conclusion

If you develop a website and need to debug it, then you should give Query Monitor a try, if you don’t already have it in your toolbox.

You can also extend Query Monitor with your own panel, which I have described in the blog post “Adding a custom panel to Query Monitor” earlier this year.

Do you use Query Monitor? What is the feature you use the most?

Leave a Reply

Your email address will not be published. Required fields are marked *