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:

  1. Click on the “Security” category
  2. Search or scroll to locate the Debug Mode Module
  3. 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_DEBUG in 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:

  1. Go to the WP mazic plugin settings
  2. Navigate to the “Security” category
  3. Find the Debug Mode module
  4. 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:

  1. White Screen of Death: Check your server’s error logs
  2. Debug Log: Look for wp-content/debug.log
  3. Memory Limit: Increase PHP memory limit if needed
  4. 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:

  1. Debug mode is disabled on production sites
  2. Debug logs are not accessible via the web
  3. 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