WordPress Plugin Development Tutorial Manual - Plugin Developer Tools
There are a variety of tools available to help us develop WordPress plugins, some of which are integrated into our development environments (e.g. xdebug, PHPCS, etc.) WordPress also provides some excellent developer tools to help us develop plugins correctly and diagnose problems.
Debugging toolbars and add-ons
Debug Bar
When the debug bar is activated, the plugin adds a debug menu to the WordPress admin toolbar, which displays WordPress queries, caching and other useful debugging information, and tracks PHP warnings and notifications when WP_DEBUG is set to true for our convenience, and when SAVEQUERIES is enabled, mysql queries are also tracked and displayed. When SAVEQUERIES is enabled, mysql queries are also tracked and displayed.
Debug Bar Console
This plugin provides a text paragraph field that can run any PHP code, making it easy for us to test the contents of variables.
Debug Bar Console Plugins
Debug Bar Shortcodes
The plugin adds a panel to the Debug Bar that displays the short and medium codes of the current request. In addition to that, this plugin will also display the following information for us:
- Which function/method is called by the shortcode
- Shortcodes used in the current post/page/custom post type and how to use them
- Any additional information about the shortcode, e.g. shortcode description, parameters, whether it is a self-closing shortcode or not
- Find all articles/pages etc. that use shortcodes
Debug Bar Constants
This plugin adds three new panels to the Debug Bar to display the defined constants available for the current request:
- WP Constants
- WP Class Constants
- PHP Constants
Debug Bar Post Types
This plugin adds a post type panel to the Debar Bar, which is used to display the details of custom post types registered on the site.
Debug Bar Cron
This plugin adds an information panel about WP-Cron task scheduling events. This plugin is an extension to Debug Bar, so Debug Bar needs to be enabled for it to work properly. After installation, we can see the following message.
- Number of planned tasks
- Is Cron running?
- Operational events for the next scheduled event
- Currently scheduled events
- Customizing the Scheduled Items List
- List of core programmatic issues
- List of planned activities
Debug Bar Actions and Filters Addon
This plugin adds two tabs to the Debug Bar to display the hooks (Action and Filter) for the current request. The "Action" tab displays the Action operations mounted to the current request, and the "Filter" tab displays the Filter tab and the functions mounted to it with the appropriate priority.
Debug Bar Actions and Filters Addon Plugin
Debug Bar Transients
This plugin adds a panel about WordPress temporary data information to Debar Bar. after installation, we can see the following information:
- Existing provisional data
- Customizing Temporary Data Lists
- Core provisional data list
- Customize the site temporary data list
- Core site provisional data list
- Options for deleting temporary data
Debug Bar List Script & Style Dependencies
This plugin, when enabled, lists the scripts and styles that have been loaded, the order in which they were loaded, and the dependencies that exist in the Debug Bar.
Debug Bar List Script & Style Dependencies Plugin
Debug Bar Remote Requests
This plugin logs and analyzes remote requests made through the HTTP API and adds a "Remote Requests" panel to the Debug Bar, which displays the following information:
- Request methods (GET, POST, etc.)
- Request URL
- Time spent per request
- Total time spent on all requests
- Number of all requests
Alternatively, we can add a ?dbrr_full=1 query parameter to the URL to get additional information, including all request parameters and a full dump with HTTP headers.
Debug Bar Remote Requests Plugin
Helper plug-ins
Query Monitor
Query Monitor is a WordPress development debugging plugin that all developers can use to view debugging and request information about database queries, hooks, conditional functions, HTTP requests, redirects, and more. The plugin has some advanced features that other plugins don't have, including automatic Ajax debugging and the ability to narrow down monitoring by plugin or theme.