Getting started
Table of Contents
WP Core Monitor is a lightweight tool designed to help advanced WordPress users debug theme and plugin conflicts. The plugin offers two useful functionalities that cannot be found in other debugging tools.
- Hooks Scanner that can be used to scan plugins and themes to identify available action and filter hooks for customization and troubleshooting.
- Redirect Debugger allowing to trace WordPress-based redirects and pinpoint the exact plugin or theme calling the wp_redirect() function.
The plugin does not need to be activated at all time. You can enable it just for the debugging process, after which you can either disable in the settings the debug info (displayed in the front-end) or deactivate the plug-in entirely.
Hooks Scanner #
Once installed, WP Core Monitor allows you to scan your plugins and themes for available action and filter hooks. This feature is meant for WordPress developers and experienced users who need to see how their plugins and themes interact with WordPress and each other.
How to Use the Hooks Scanner #
- Go to “Tools -> WP Core Monitor -> Hooks Scanner”.
- Choose the plugin or theme you want to scan from the dropdown menu.
If completed successfully, the tool will display a list of all action hooks [do_action()] and filter hooks [apply_filters()] found in the selected plugin or theme.
The list is organized by file, making it easier to find out where specific hooks are located. In addition to the file name, each entry specifies the line number and the parameters being passed with the hook.
You can use this information to build custom code snippets, troubleshoot conflicts, or integrate additional functionalities.
Redirect Debugger #
Backtracing the WordPress Redirect Function #
The plugin can assist you in tracking down the cause of the triggered redirect. All you need to do is open the URL that initiates the redirection.
If the redirect is initiated via the WordPress redirect function (which is the case for the majority of plugins and themes), you will see debug data.
Now, you have the option to pause the redirect if you would like to examine the displayed information more closely. Unless you do this, the redirect will proceed after 10 seconds.
Interpreting the Data #
Whenever wp_redirect()
is used, there are certain WordPress inbuilt functions that are always used, such as do_action
or apply_filters
. These functions can be disregarded.
The data is shown in the order of the function called last, thus your search for a plugin, theme, or code that calls redirects should begin at the end of the table.
Security #
Please keep in mind that if you pick the last option ("All visitors and users") under “Choose a User Role”, the debug data will be displayed for everyone who visits any URL that initiates the redirect.
To avoid accidentally disclosing information about the plugins used, it is recommended to use the debug data display for brief periods of time if you decide to make it public.
Plugin Settings #
There are a few settings available in the plugin under “Tools –> WP Core Monitor”. The first one ("Debug wp_redirect()") lets you deactivate the function that backtraces redirection.
You can use the second one ("Choose a User Role") to grant access to the debug data so a WordPress expert can assist you in debugging and analyzing the redirect.