Vulnero

Seamless WordPress and Zend Framework Integration

Out of the box, WordPress provides very little debugging information for its plugins. Exceptions and warnings are hidden. If an error occurs while activating your plugin, a simple "fatal error" may be displayed with no further information. Your PHP error log (if enabled) likely won't be written to.

WP_DEBUG

The first change you'll want to make when developing your application/plugin is enabling the WP_DEBUG flag. Open the WordPress configuration file wp-config.php and modify the line containing the define() to do so.

Be warned, many WordPress plugins (even the most popular) are beasts for notices. If your PHP error_reporting includes E_NOTICE or E_DEPRECATED, you may find your screen littered with warnings and deprecated function messages; therefore, it's is strongly recommended to disable other plugins during development or debugging of your application.

PHP Configuration Directives

If WP_DEBUG doesn't illuminate the problem, it may be that your PHP settings aren't allowing you to see the problem. Although you could tweak your global php.ini file, VirtualHost or .htaccess, the easiest, quickest and most reliable way to set the appropriate directives would be to add them to your wordpress-plugin.php file somewhere near the top:

ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/logs/phperrors.log');
ini_set('display_errors', true);

Of course, take care to remove or comment out the directives once you've found the problem to prevent them from finding their way into production.