2018-05-31, 10:00 PM
Currently the debug page displays on what hook queries were run (global_start, postbit, etc) but not what actual plugin hooks are run on that hook.
Ideally, it should tell me exactly what hook ran that query, but as a quick fix I applied the following:
Now I can know what plugins ran on that hook.
Ideally, it should tell me exactly what hook ran that query, but as a quick fix I applied the following:
function explain_query($string, $qtime)
{
global $plugins;
$debug_extra = '';
if($plugins->current_hook)
{
$debug_extra = "<div style=\"float_right\">(Plugin Hook: {$plugins->current_hook})</div>";
$debug_extra .= "<div style=\"float_right\">(Hooks: ";
foreach($plugins->hooks[$plugins->current_hook] as $plugin_hook)
{
$comma = '';
$debug_extra .= implode(', ', array_keys($plugin_hook)).$comma;
$comma = ', ';
break;
}
$debug_extra .= ")</div>";
}
Now I can know what plugins ran on that hook.