Last active
August 29, 2015 14:01
-
-
Save rohmann/41d821739edbd3d4517f to your computer and use it in GitHub Desktop.
Debugging for live WordPress environments.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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