xrDebug WordPress

Debug WordPress with xrDebug

rodber
rodber   GitHub

I've released xrdebug/wordpress, the official client for debugging WordPress with xrDebug.

This plugin is available for the newly released xrDebug 2.0. It requires PHP 8.1 and it works on WordPress V5.9 (tested up to V6.5). It is based on the xrDebug PHP library and it adds WordPress specific helpers that will make WordPress debugging easy.

# Debug helpers

This plugin includes helpers xr, xrr, xri, vd and vdd.

Use function wp_xri to access the xrDebug WordPress inspector instance, which can be used to control the WordPress inspector logging features.

# showErrors

Use method showErrors to show the PHP errors during the WordPress request.

wp_xri()->showErrors();

To stop showing errors pass FALSE as argument.

wp_xri()->showErrors(FALSE);

# showHooks

Use method showHooks to show the WordPress hooks executed during the WordPress request.

wp_xri()->showHooks();

To stop showing hooks pass FALSE as argument.

wp_xri()->showHooks(FALSE);

# showMails

Use method showMails to show the emails sent during the WordPress request.

wp_xri()->showMails();

To stop showing emails pass FALSE as argument.

wp_xri()->showMails(FALSE);

# showQueries

Use method showQueries to show the SQL queries executed during the WordPress request.

wp_xri()->showQueries();

To stop showing queries pass FALSE as argument.

wp_xri()->showQueries(FALSE);

# Wrapping up

WordPress is a massive popular CMS and now your development experience can be less miserable thanks to xrDebug.

Hope you can give it a try, feel free to spread the word!

Rodolfo blogging since 2012.