Posted on

New Features in Query Monitor 3.3

Query Monitor 3.3 has just been released and includes several new features:

  • Related hooks shown for each panel, and the filters or actions attached to them.
  • Debugging output shown when wp_die() is called.
  • Support for debugging JavaScript translation files.
  • Render timing for dynamic blocks in post content.
  • A toggle to move QM to the side of the window.

Let’s look at these in detail.

Related Hooks with Filters or Actions Attached

This is personally one of my favourite new features, and I hope you’ll find it useful.

Many of the panels in QM now track a list of hooks related to that panel, and automatically list them in a sub-menu whenever filters or actions in plugins or themes are attached to them. This can greatly reduce the amount of time you spend trying to find out what’s making changes to certain behaviour on your site.

I’ve found this to be particularly helpful on the Request panel, which tracks hooks related to rewrite rules, query parsing, request handling, query vars, and more.

Screenshot of the "Hooks in Use" sub-menu of the Request panel in Query Monitor.

It’s also very useful for figuring out what’s making changes to user role and capability handling on your site:

Screenshot of the "Hooks in Use" sub-menu of the Capability Checks panel in Query Monitor.

Some panels track certain option names too, which means all the filters related to that option get automatically tracked. For example, you’ll be able to see if something is hooked onto the pre_option_stylesheet filter on the Template panel, or the site_option_WPLANG filter on the Languages panel.

Not all of the panels are tracking related hooks yet. I’ll continue expanding and improving this feature in future releases of QM, including adding a way to expose all of the hooks that each panel is tracking, regardless of whether filters or actions are attached to them.

wp_die() Debugging

The wp_die() output in WordPress is a thing of beauty… if you’re into minimalism.

Screenshot of the useless output of a call to wp_die().

Query Monitor now adds some debugging information to the output of wp_die(), including the component responsible and the call stack, to help you identify the source of the message.

Screenshot of a slightly more useful output of a call to wp_die() with Query Monitor enabled.

Debugging JavaScript Translation Files

WordPress 5.0 introduced the ability to use internationalisation functions in JavaScript and provide Jed translations for messages that use them.

QM now supports debugging the loading of these translation files in the Languages panel, so you know which files WordPress is attempting to load.

Screenshot of the "Languages" panel in Query Monitor showing the Jed translation files that WordPress attempts to load.

Render Timing for Dynamic Blocks

In WordPress 5.1 (which is due to be released on February 21st), some new hooks have been added which allow QM to log the time that it takes for each dynamic block in post content to be rendered. If you’re developing dynamic blocks with complex rendering operations, this will help you keep an eye on the rendering time.

Move QM to the Side

If you use a wide monitor and want to view QM on the side of your screen instead of the bottom, you can now do so with the new toggle button next to the Close and Settings buttons.

Many thanks to Timi Wahalahti for most of the work on this new side view.

Screenshot of Query Monitor attached to the side of the screen instead of the bottom.

I hope you enjoy all the new features!

Download Query Monitor on the WordPress.org Plugin Directory.

One comment New Features in Query Monitor 3.3

  1. I’m always excited to read the changelog of one of my favorite plugins. Thanks again for everything!

Leave a Reply to Chris Cancel reply

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