PinkCrab Debugging Plugin releases
A selection of debugging tools. Should not really be used on production sites. Contains dump(), dd(), adump() & adie() plus custom error messages over WSOD
Install
The author publishes release zips, so WP-CLI can install straight from GitHub:
wp plugin install https://github.com/pink-crab/debug-plugin/releases/download/1.1.0/debug-plugin.zipPinkCrab Debug Plugin
A wordpress plugin to help with debugging and development.
Functions.
dump(...$data)
The modern dump function created by symfony. This function will output the variable in a readable format.
dump($var);
dd(...$data)
The modern dump function created by symfony. This function will output the variable in a readable format and then die.
dd($var);
You have access to all underlying symfony var dump functions, uses the same naming conventions.
adump(...$data)
This is an ajax ready take on dump(), which outputs in a readable format via the network tab on the browser.
adump($var);
Casts true to
TRUE, false toFALSEand null toNULL. To avoid confusion caused with phps print_r function.
adie(...$data)
This is an ajax ready take on dd(), which outputs in a readable format via the network tab on the browser and then dies.
adie($var);
write_log($data)
This function will write to the debug.log file in the wp-content directory.
write_log($var);
pclog($data, $type = 'log')
This writes to a custom pc-debug.log file in the wp-content directory. This is useful for separating out debug data, from general errors.
pclog($var, 'error');
pclog($var);
Will only create the file if it does not exist.
pinkcrab_is_rest()
This function will return true if the current request is a rest request.
if(pinkcrab_is_rest()){
// Do something
}
URL Parameters
?pc_show_enqueue
This will output all the scripts and styles that have been enqueued on the page.
?pc_show_hooks=hook,hook2
This will output all the hooks that have been added to the page. You can pass multiple hooks by comma separating them.
Releases
3 releases. Each count is every asset in that release; expand a row for the breakdown.
Active-site estimate ≈20 comes from the median of recent superseded releases. Method.