| 开发者 | parag44 |
|---|---|
| 更新时间 | 2026年11月19日 18:01 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
debug.log without FTP or SSH.
Debug constants without editing files
Switches at the top of the DebugZen screen read and update these constants in wp-config.php:
WP_DEBUGWP_DEBUG_LOGWP_DEBUG_DISPLAYwp-config.php instead of using regex or string replacement. If WP_DEBUG_LOG points to a custom file, that path is kept. If wp-config.php is read-only, DebugZen shows the exact lines to add yourself. Turning on WP_DEBUG_DISPLAY shows a reminder that errors are now printed to visitors.
A log viewer built for reading
debug.log for new lines by reading only the bytes added since the last check. New entries never move the row you are reading; they wait behind a "new entries" bar./ or Cmd/Ctrl + K to search, j and k to move between entries, r to refresh, t to turn Live on or off, and Esc to close or clear.realpath() checks, never include wp-config.php, dotfiles or the active log, and files are only read, never executed.
Third-party libraries
DebugZen includes WP Config Transformer by the WP-CLI Development Group. It is distributed under the MIT License. Its license is included at vendor/wp-cli/wp-config-transformer/LICENSE.
This plugin does not contact external services, collect telemetry, or load remote executable code.
debugzen folder to /wp-content/plugins/, or install the plugin ZIP from Plugins > Add New > Upload Plugin.vendor directory, run composer install --no-dev --optimize-autoloader inside the plugin directory.wp-config.php is writable before saving changes. Restore restrictive permissions after configuration if required by your hosting environment.No. It uses the WP Config Transformer library from WP-CLI, which reads wp-config.php with PHP's tokenizer and updates only the three debug constants. If a constant is missing, it is added; everything else in the file is left as it was.
wp-config.php is read-only for the web server, which many hosts do on purpose. DebugZen then shows "read-only" next to the switches and lists the exact lines to add to wp-config.php yourself. The log viewer keeps working either way.
DebugZen tried to add a debug constant that is not in wp-config.php yet, but could not find where to put it. New constants go just above the line /* That's all, stop editing! */, and your wp-config.php does not have that line. This happens when the line was deleted or reworded, when WordPress was installed in another language, or when a host generated its own wp-config.php. Nothing is written to the file when this error appears.
To fix it, open wp-config.php and add this line on its own, just above require_once ABSPATH . 'wp-settings.php';:
/* That's all, stop editing! */
Then use the switch again. Or add the constants yourself in the same place:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
Yes, with two precautions. Keep WP_DEBUG_DISPLAY off, so errors are written to the log instead of being shown to visitors; DebugZen warns you while it is on. And because wp-content/debug.log can be downloaded by anyone who guesses the address on many servers, consider setting WP_DEBUG_LOG to a path outside your web root, for example define( 'WP_DEBUG_LOG', '/home/example/logs/debug.log' );. DebugZen reads custom paths and keeps them when you toggle logging.
Administrators with the manage_options capability. On multisite, only super admins can use it, because wp-config.php and the log are shared by the whole network. Developers can change the required capability with the debugzen_capability filter.
No. DebugZen's scripts and styles load only on its own screen. Other admin pages get just the sidebar item and toolbar link. The viewer reads at most the last 1 MB of the log, and Live reads only the bytes added since its last check.
By default, WordPress writes the log to wp-content/debug.log. If WP_DEBUG_LOG contains a custom path, DebugZen uses that path.
Each preview needs a server-signed token tied to your user account. Paths are resolved with realpath() and must stay inside the WordPress installation, and wp-config.php, dotfiles and the active log file are never shown. Files are only read, never executed.
No. DebugZen has no telemetry, analytics, external API connection, or remote code loading.
j and k keyboard shortcuts to move between entries.debugzen_capability filter changes the required capability.<dialog> modals, keyboard shortcuts (/ or Cmd/Ctrl + K to search, r to refresh, t to toggle Live Tail, Esc to clear search or close dialogs), inline retry banners, and Screen Help tab integration.>_) and top WordPress Admin Bar icon to inherit native toolbar colors across all admin color schemes cleanly.#screen-meta-links (Help) cleanly.trailingslashit() + realpath() path boundary enforcement against sibling-directory prefix bypasses in DebugZen_Source_Reader, user-scoped source-context HMAC tokens, edit_plugins/edit_themes capability gating on editor line jumps, explicit log-file exclusion, $_POST['file'] input sanitization, and X-Content-Type-Options: nosniff on log downloads.DebugZen_Config::get_state() memoization with write invalidation, aligned Settings validation with 15s/30s polling intervals, 30 entries/page, 8 context lines, and rotate archive mode, removed legacy unused tail/i18n dead code, and ensured zero WordPress.org Plugin Check warnings or errors.WP_DEBUG, WP_DEBUG_LOG, and WP_DEBUG_DISPLAY.