The Vault

Developers, Please Debug!

When developing plugins or themes for WordPress, please, please, please, add this bit of code to your test site’s wp-config.php file:

define('WP_DEBUG', true); # Debugging

If your test site is public and you only want the debug information to show up for yourself, restrict it to your IP address:

if ($_SERVER['REMOTE_ADDR'] == '') define('WP_DEBUG', true);

There's no reason to release a plugin or theme into the wild that's laden with uninitialized variables, deprecated functions, undefined indexes, and so on. Turning debugging on will force you to either ignore the warning messages or will encourage you to clean up your code.

Now you know, and knowing is half the battle. The other half is outclassing the competition. :)

Join the Discussion

Your email address will not be published. Required fields are marked *

Comments must be made in accordance with the comment policy. Use your Gravatar-enabled email address while commenting to automatically enhance your comment with some of Gravatar's open profile data.

You may use Markdown to format your comments; additionally, these HTML tags and attributes may be used: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>