Skip to content

Instantly share code, notes, and snippets.

@rohmann
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rohmann/41d821739edbd3d4517f to your computer and use it in GitHub Desktop.
Save rohmann/41d821739edbd3d4517f to your computer and use it in GitHub Desktop.
Debugging for live WordPress environments.
define('WP_DEBUG', true);
if (WP_DEBUG) {
/**
* Log errors to wp-content/debug.log
* Don't forget to delete this when you're finished,
* as it may be publicly accessible.
*/
define('WP_DEBUG_LOG', true);
//Use dev libraries instead of minified versions.
define('SCRIPT_DEBUG', true);
// Log queries so they can be viewed after request. (https://wordpress.org/plugins/debug-bar/)
define('SAVEQUERIES', true);
/**
* Only display errors to users
* Prevents users from being distrubed by errors while you're debugging
* Replace 127.0.0.1 with your IP address, and add as many as you like
*/
if ( in_array( $_SERVER['REMOTE_ADDR'], array( '127.0.0.1', 'more...ips...' ) ) ) {
define('WP_DEBUG_DISPLAY', true);
} else {
define('WP_DEBUG_DISPLAY', false);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment