$wp_debug ? 'true' : 'false', 'WP_DEBUG_DISPLAY' => $wp_debug_display ? 'true' : 'false', 'WP_DEBUG_LOG' => $wp_debug_log ? ( true === WP_DEBUG_LOG ? 'true' : WP_DEBUG_LOG ) : 'false', 'SCRIPT_DEBUG' => $script_debug ? 'true' : 'false', 'uses_default_log_path' => $uses_default_log_path ? 'yes' : 'no', ); // Most critical: debug display enabled – errors shown to visitors. if ( $wp_debug && $wp_debug_display ) { return static::fail( 'high', __( 'Debug mode is enabled and error messages are being shown to visitors. This can reveal sensitive information about your site\'s code and configuration to hackers.', '0-day-analytics' ), __( 'Edit your wp-config.php file and add these lines before "That\'s all, stop editing!": define(\'WP_DEBUG\', false); or if you need debugging: define(\'WP_DEBUG_DISPLAY\', false); and define(\'WP_DEBUG_LOG\', true);', '0-day-analytics' ), $details ); } // Security issue: debug logging to the default web-accessible path. if ( $wp_debug && $wp_debug_log && $uses_default_log_path ) { return static::fail( 'high', __( 'Debug logging is active and writing to the default wp-content/debug.log file. This file is publicly accessible and can expose sensitive application data, stack traces, and database queries to attackers.', '0-day-analytics' ), sprintf( /* translators: %s: link to settings section */ __( 'Move the debug log outside the web root or use a custom path: define(\'WP_DEBUG_LOG\', \'/path/outside/webroot/debug.log\'); Also consider adding a server rule to block access to .log files. Or use this plugin\'s SECURITY: Generate WP Debug Log File Name to generate random and secure log file name.', '0-day-analytics' ), \esc_url( \admin_url( '/admin.php?page=advan_logs_settings' ) ) ), $details ); } // Script debug enabled – minor concern for production. if ( $script_debug ) { return static::warning( __( 'Script debug mode is enabled, which loads unminified JavaScript and CSS files. This slows down your site and should only be used during development.', '0-day-analytics' ), __( 'Edit wp-config.php and remove or set to false: define(\'SCRIPT_DEBUG\', false);', '0-day-analytics' ), $details ); } return static::pass( __( 'Debug mode is properly configured. Error messages are not visible to visitors and debug logs are not exposed in a default location.', '0-day-analytics' ), $details ); } } }