enable debugging when developing plug-ins for WordPress
enable debugging when developing plug-ins for WordPress
Enabling debugging requires a little tweaking of code in the “wp-config.php” file. Of course, any good PHP developer knows to make a backup copy of any PHP code page prior to making any changes to the code. Though many tools are available to edit PHP code, most PHP developers prefer a simple text editor, such as Notepad. Some use text editors with line numbering and color coding features, such as Textpad. However, no matter the tool you prefer to use to edit the code page, make sure you create a backup copy of the page before you change one single character of code.
After you have created the backup copy, you will need to replace a single line of code with a few lines of edited code to enable the debugging feature.
You replace the following line of code in the wp-config.php file:
define(‘WP_DEBUG’, false);
Locate this line in the config file and replace the line with the following series of lines:
define(‘WP_DEBUG’, true);
define(‘WP_DEBUG_LOG’, true);
define(‘WP_DEBUG_DISPLAY’, false);
@ini_set(‘display_errors’, 0);
The first line turns on the debugging feature. The second line instructs WordPress to log debugging results to the /wp-content/debug.log text file. The third line ensures that the display errors variable does not need to be on. The final line hides the errors from displaying on the screen. If you prefer, comment each line with its description.
install http://wordpress.org/extend/plugins/blackbox-debug-bar/