Enable WordPress Debugging For Efficient Plugin Development

Enable WordPress Debugging For Efficient Plugin Development

Enable WP_DEBUG and start seeing PHP notices and also WordPress-generated debug messages.

This is helpful when building plugins. WP_DEBUG tells PHP to report more errors, specifically “notices,” since WordPress normally instructs PHP to only report warnings and fatal errors. It also will help you to know if you’re using a deprecated function, deprecated file, or an old API.

Simply open wp-config.php and define:

define( 'WP_DEBUG', true );

You can also define WP_DEBUG_DISPLAY and WP_DEBUG_LOG to suppress the notices and log them to a wp-content/debug.log file if you’re debugging on a production site:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
ini_set( 'display_errors', 0 );

Free Video Why 100 is NOT a Perfect Google PageSpeed Score (*5 Min Watch) Learn how to use Google PageSpeed Insights to set realistic goals, improve site speed, and why aiming for a perfect 100 is the WRONG goal.
Tags: