Linux 软件免费装
Banner图

Admin Debug Tools

开发者 tjdsneto
更新时间 2025年1月16日 07:38
WordPress版本: 6.7
版权: GPLv2 or later
版权网址: 版权信息

标签

debug error log notice debugging

下载

1.0.0

详情介绍:

安装:

  1. Upload the plugin files to the /wp-content/plugins/admin-debug-tools directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the 'Plugins' screen in WordPress.
  3. Go to Tools->Debug Log screen to enable WP Debug logging and view the log file.

常见问题:

Should I keep WP_DEBUG mode enabled on a live site?

It is generally not recommended to keep debug mode enabled on a live site, as it can expose sensitive information about your site and server, posing a security risk. The main reason is that the default WP_DEBUG_LOG constant saves the log file in the wp-content directory, which is publicly accessible. This can expose sensitive information about your site and server, such as file paths, database credentials, and other details that could be used by malicious actors. To secure the debug log file, you can:

  • Change the location of the log file to a non-public directory (you can do this on Admin Debug Tools's Config screen);
  • Restrict access to the log file using server configuration (e.g., .htaccess, nginx.conf) - You will need assistance from your hosting to do this.;

What if my debug.log file is HUGE?

Debug log files can grow very large over time, especially on high-traffic sites or sites with many errors and warnings. Admin Debug Tools was built from the beggining having that in mind and, by default, will not load the entire log file at once, but only the last 1000 lines. The code is also optimized to avoid memory issues when loading large log files, but if you're experiencing performance issues, you can:

  • Download the log file and use a local tool to analyze it;
  • Clear the log file to start fresh;

How to fix the error "The wp-config.php is not writable"?

Admin Debug Tools needs write access to your wp-config.php file to enable and disable debug mode. If you're seeing the error "The wp-config.php is not writable", you need to give write permissions to the file yourself or ask your hosting provider to do it for you. You can change the permissions of the wp-config.php file using an FTP client, a file manager in your hosting control panel, or via SSH. The file should have the permissions set to 644 or 640. Using SSH:

  1. Connect to your server via SSH:
  2. Open your terminal (Mac/Linux) or Command Prompt (Windows).
  3. Use the ssh command to connect to your server. Replace username and hostname with your actual SSH username and server hostname.
ssh username@hostname ``` 2. Navigate to your WordPress directory: - Use the cd command to change to the directory where your WordPress installation is located. cd /path/to/your/wordpress/directory 3. Check the existing permissions of wp-config.php: - Use the ls -l command to list the file permissions. ls -l wp-config.php - The output will show the current permissions. For example: -rw-r--r-- 1 username group 1234 Jan 01 12:34 wp-config.php 4. Update the permissions of wp-config.php: - Use the chmod command to change the file permissions to 644 or 640. chmod 644 wp-config.php - Or, to set the permissions to 640: chmod 640 wp-config.php 5. Verify the updated permissions: - Use the ls -l command again to confirm the changes. ls -l wp-config.php - The output should now reflect the updated permissions. For example: -rw-r--r-- 1 username group 1234 Jan 01 12:34 wp-config.php

What users can access Admin Debug Tools?

By default, only users with the manage_options capability can access the Debug Log screen. This includes Administrators and Super Admins on multisite networks. But you can change this by using the wp_debug_assistant_capability filter. Here's an example of how you can change the capability to edit_posts: