Hack the “Debug Bar”, “Debug Bar Action Hooks” and “Kint Debugger” plugins

I try to trace execution of a plugin in WordPress, so I install several developer's plugins: "Developer", "Debug Bar", "Debug Bar Transients", "Debug Bar Action Hooks", "Kint Debugger". Then I try to show a variable in the "Kint Debugger", but falls. Seems variable was used before the "Kint Debugger" plugin runs, and can not be used yet - the function "d()" was not created yet.

Well, but "Debug Bar Action Hooks" works, and shows hooks before and after the code what I looking for... So I create a new hook with the info I need in the name :-)

do_action("KC level: $level", get_defined_vars());

The hook was fired. Nobody wants it, as no action was created for it. But "Debug Bar Action Hooks" registers it and I was able to see need info inside hooks lists :-) Nobody complains (loudly enough) about spaces in hook's name. It works even I need entire array/object to show:

do_action("KC field: <pre>".print_r($field, true)."</pre>", get_defined_vars());

It is much of fun, so I share it with you :-)

This entry was posted in Blog, Hacks. Bookmark the permalink.

Leave a Reply