Mitap “Debugging in WordPress with Query Monitor”

Another mithap of the technical series in the Latvian WordPress group: "Debugging in WordPress with the Query Monitor

Mitap “Debugging in WordPress with Query Monitor”


The next mitap of the technical series in the Latvian WordPress group was dedicated to the topic “Debugging in WordPress with the Query Monitor plugin”. On November 30, Ekaterina Leurdo made a report on this topic and answered the questions of the participants. The materials of the mitap are available for download at the links at the bottom of this article.

Debugging in WordPress with Query Monitor

At the beginning Katya gave a very detailed description of the Query Monitor plugin settings. She discussed in detail the features of the admin panel and the main information panel of the plugin, gave a description of all available tabs and sections of output information.

Special attention was paid to the installation of the plugin and some subtleties related to this process.

The main purpose of the plugin is to display detailed, versatile information about SQL queries while loading a particular page. The speaker showed how to select “heavy” queries, repeated queries, sort queries by execution time, filter by source – plugins and theme. Debugging in WordPress with Query Monitor is mainly about working with this information on SQL queries and searching for code that produces complex or repetitive queries. Knowing the detailed execution time helps the developer identify code sections that need optimization.

In addition, the plugin provides a lot of additional information about the system, server settings, WordPress global variables, filters and templates used. As a concrete example, Ekaterina showed the determination of the cause of the 404 error on the site. Query Monitor displays information about which rewrite rules were triggered when loading the current page and why. During the discussion it was noted that it is rather difficult to obtain such information with the help of a debugger due to the complexity of the WP_Rewrite class code.

Thus, the talk emphasized the peculiarities of practical application of the Query Monitor plugin. In combination with other debugging tools like xDebug and profiling tools like Blackfire, the plugin is a powerful tool in the hands of a WordPress developer.

In the course of answering questions, a wish was voiced to continue the technical series with a detailed report on the topic of creating and using unit tests in WordPress. Follow the announcements in the Latvian mitap group!

A recording of the mitap is available below.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.