Debugging in WordPress

Debugging in wordpress can be a bit difficult when your first starting out, while I don’t use breakpoints such as what Visual Studio offers, I can offer advice on how to debug php in general, as well as turning on the debugging output from wordpress. First start by opening up your wp-config.php and finding the … Read more

Suppress deprecated notices

As mmm stated: in which file appears the first notice? Wherever the notice is mentioning the location of this deprecated function (path/to/some/file.php), you would insert the following just below the <?php tag which starts off the file: error_reporting(0); I’ve tried the above functions you mentioned and inserted them in my wp-config.php when I experience something … Read more

Control verbosity level of WP DEBUG?

When WP_DEBUG is set, WordPress sets (via wp_debug_mode() call early in core load process) the error reporting level to E_ALL & ~E_DEPRECATED & ~E_STRICT. This means all warnings and errors except strict errors and PHP deprecated functions (not WordPress ones). You can define your own level in a custom mu-plugin (the override needs to be … Read more

Is it possible to change the log file location for WP_DEBUG_LOG?

It turns out that all WP_DEBUG_LOG does is: ini_set( ‘log_errors’, 1 ); ini_set( ‘error_log’, WP_CONTENT_DIR . ‘/debug.log’ ); So, if you want to change the log location for WP_DEBUG_LOG in a plugin or theme, webaware’s answer is best. If you just want to have it changed within wp-config.php you can replace define( ‘WP_DEBUG_LOG’, true ); … Read more