Debug Mode
Product: Admin Framework Pro
The Debug Mode module enables WordPress debugging tools to help developers troubleshoot issues. It activates WP_DEBUG, displays PHP errors and warnings, and logs debug information—making it easier to identify problems during theme, plugin, or site development.
How to use
To enable the Debug Mode Module:
- Click on the “Security” category
- Search or scroll to locate the Debug Mode Module
- Click on the switch to enable
What’s next?
This module helps you enable WordPress debugging features to identify and fix issues during development. Here’s what happens when you enable it:
1. Automatic Configuration
When activated, the module will:
- Enable
WP_DEBUGin your WordPress configuration - Add a comment to identify the change was made by WP mazic
- Display debug information in the WordPress admin area
2. What’s Enabled
The module enables the following WordPress debugging features:
WP_DEBUG: Enables WordPress debugging mode- Error reporting for all error levels
- Display of PHP errors, warnings, and notices
3. Important Notes
- For Development Use Only: Debug mode should only be enabled on development/staging sites
- Security Warning: Debug information may contain sensitive data
- Performance Impact: Enabling debug mode may impact site performance
- Automatic Cleanup: The module will clean up after itself when deactivated
4. Deactivating Debug Mode
To disable debug mode:
- Go to the WP mazic plugin settings
- Navigate to the “Security” category
- Find the Debug Mode module
- Click the switch to disable it
5. Manual Configuration
If you prefer to configure debug mode manually, add these lines to your wp-config.php file:
// Enable WP_DEBUG
define('WP_DEBUG', true);
// Enable debug logging to /wp-content/debug.log
define('WP_DEBUG_LOG', true);
// Disable display of errors and warnings
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);
// Use dev versions of core JS and CSS files (only needed if you are modifying these files)
define('SCRIPT_DEBUG', true);6. Troubleshooting
If you experience issues:
- White Screen of Death: Check your server’s error logs
- Debug Log: Look for
wp-content/debug.log - Memory Limit: Increase PHP memory limit if needed
- Plugin Conflicts: Deactivate other plugins to check for conflicts
7. Best Practices
- Always back up your site before enabling debug mode
- Never enable debug mode on a production site
- Review debug logs regularly and fix any warnings or notices
- Disable debug mode when not actively troubleshooting
8. Advanced Usage
For developers, you can extend the debug functionality:
// Custom error logging
if (WP_DEBUG === true) {
// Your custom debug code here
error_log('Custom debug message');
}
// Conditional loading of development assets
if (defined('WP_DEBUG') && WP_DEBUG) {
// Load development CSS/JS
wp_enqueue_style('dev-styles', get_stylesheet_directory_uri() . '/css/dev.css');
}Security Warning
Debug mode can expose sensitive information about your site. Always ensure that:
- Debug mode is disabled on production sites
- Debug logs are not accessible via the web
- You understand the security implications before enabling
This module is ideal for:
- Theme and plugin development
- Troubleshooting site issues
- Development and staging environments
- Debugging PHP errors and warnings