SCRIPT_DEBUG (breaks wp-admin with caching/CDN)
-
Hello Wibowo,
we love using Debug Log Manager for quick log handling. We’ve run into a reproducible issue in production:
Issue
When we enable error logging, the plugin also writes
define(‘SCRIPT_DEBUG’, true);
into wp-config.php. This makes WordPress load unminified development bundles in wp-admin (e.g., Rank Math). In our environment with caching/CDN (BunnyCDN + WP Fastest Cache; Perfmatters currently disabled) and stricter headers, those dev bundles become fragile (timing/chunk loading), leading to console errors like __webpack_require__ is not defined / module is not defined, and our cookie banner fails to initialize.
Why this shows up in our setup
Because of the caching/CDN layers, chunked dev assets loaded under SCRIPT_DEBUG = true are more sensitive. With SCRIPT_DEBUG = false, wp-admin is stable.
Reproduction
Enable logging in Debug Log Manager
The plugin writes SCRIPT_DEBUG = true to wp-config.php
Reload /wp-admin/ (e.g., Rank Math page) → admin assets break (errors above), cookie banner won’t load
Workaround
Manually restore SCRIPT_DEBUG to false → wp-admin is stable again. But the plugin may overwrite it the next time logging is toggled.
Feature request
Please add a way to enable WP_DEBUG / WP_DEBUG_LOG without touching SCRIPT_DEBUG. For example:
a checkbox “Do not modify SCRIPT_DEBUG” (default off), or
a filter/constant the site owner can set, e.g.:
if (apply_filters(‘dlm_modify_script_debug’, true)) {
// only change SCRIPT_DEBUG when true
}
// or honor a guard:
if (defined(‘SCRIPT_DEBUG_LOCK’) && SCRIPT_DEBUG_LOCK) { /* do not change SCRIPT_DEBUG */ }
We’re happy to provide headers/console screenshots or test a beta build.
Thanks a lot!
ChristineThe page I need help with: [log in to see the link]
You must be logged in to reply to this topic.