agentleFS
mohitkalemohitkale/wordpress-devkit/skills/wp-debug/SKILL.md

wp-debug

Skill1 starsChanged 4 months agoMITView on GitHub

Diagnose a WordPress white screen, 500 error, or fatal error. Use this when the user says the site is blank, returns HTTP 500, shows "There has been a critical error on this website", or is broken after a plugin, theme, or core update. Walks through WP_DEBUG setup, debug.log interpretation, and the most common root causes.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use the description to prioritize which branch of the workflow to start from.

    line 16
  2. Very specific:

    If wp-config.php is available, read it and look for existing WP_DEBUG constants.

    line 22
  3. Very specific:

    Use Read to open wp-content/debug.log.

    line 39
  4. Very specific:

    After the suggested change, ask the user to reload the page.

    line 65
  5. Distinctive:

    If the site is still broken, re-read the log.

    line 67
  6. Very specific:

    Do not ask the user to set WP_DEBUG_DISPLAY = true on a production site.

    line 92
  7. Very specific:

    Do not delete debug.log. Read it.

    line 93
  8. Very specific:

    Do not run wp db repair or modify the database as a first step.

    line 94
  9. Distinctive:

    Do not edit plugin or theme code to swallow the error.

    line 95

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Diagnose a WordPress white screen or fatal error

Guide the user from "site is broken" to a specific root cause in under ten minutes. Most failures fit one of five patterns: plugin conflict, theme fatal, PHP memory limit, PHP version mismatch, or a missing or corrupt core file.

Inputs

$ARGUMENTS is an optional one-line description of the symptom. Examples: site is blank after updating WooCommerce, 500 error only on /wp-admin, critical error email from WordPress.

Use the description to prioritize which branch of the workflow to start from.

Workflow

Step 1. Enable WP_DEBUG safely

If wp-config.php is available, read it and look for existing WP_DEBUG constants. Ask the user to add or update these three lines above the /* That's all, stop editing! */ line:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

Explanations:

  • WP_DEBUG_LOG = true writes errors to wp-content/debug.log instead of the screen.
  • WP_DEBUG_DISPLAY = false and display_errors = 0 keep errors out of the HTML response, which matters on a production site.

Reload the broken page once to trigger the error, then read the log.

Step 2. Read debug.log

Use Read to open wp-content/debug.log. Use Grep with the pattern PHP Fatal error|PHP Parse error|Uncaught|Allowed memory size on the log to get the relevant lines fast. The newest errors are at the bottom.

Each fatal line follows this shape:

[17-Apr-2026 12:04:11 UTC] PHP Fatal error:  Uncaught Error: Class "Acme\Foo" not found in /var/www/html/wp-content/plugins/acme-forms/includes/bootstrap.php:42

Extract:

  • The error class (Fatal, Parse, Uncaught TypeError, Allowed memory size).
  • The file path. The path tells you whether the fault is in a plugin, a theme, wp-includes, or custom code.
  • The line number.

Step 3. Map the error to one of the five root causes

Signal in debug.logRoot causeFix
Allowed memory size of N bytes exhaustedPHP memory limitRaise WP_MEMORY_LIMIT in wp-config.php to 256M and, if still failing, php_value memory_limit in .htaccess or php.ini.
Error path contains wp-content/plugins/<slug>/Plugin fatal or plugin conflictRename the plugin folder over SFTP or run wp plugin deactivate <slug> to confirm. If the site recovers, the plugin is the cause.
Error path contains wp-content/themes/<slug>/Theme fatalSwitch to a default theme with wp theme activate twentytwentyfour. If the site recovers, the theme is the cause.
syntax error or Parse error in any pathBad PHP editRevert the last change to that file. Parse errors always point to a specific line.
requires PHP version X or higher or cannot redeclare on a core functionPHP version mismatchCheck the hosting PHP version. Plugins often require PHP 8.0 or 8.1. Downgrade the plugin or upgrade PHP.
Path contains wp-includes/ with Call to undefined functionMissing or corrupt core fileReinstall core with wp core download --force --skip-content.

Step 4. Confirm the fix

After the suggested change, ask the user to reload the page. If the page recovers, revert WP_DEBUG_DISPLAY back to whatever it was (most production sites leave it unset or false). Keep WP_DEBUG_LOG on if the user wants continued visibility.

If the site is still broken, re-read the log. A second error often surfaces only after the first one is fixed.

Example

User: /wordpress-devkit:wp-debug site is blank after plugin update

Skill:

  1. Reads wp-config.php and confirms WP_DEBUG is already on.
  2. Greps wp-content/debug.log for PHP Fatal error, finds:
    PHP Fatal error:  Uncaught Error: Call to undefined function WC() in /var/www/html/wp-content/plugins/acme-addon/src/hooks.php:18
  3. Reports: the plugin acme-addon assumes WooCommerce is active. Either WooCommerce was deactivated or it failed to load. Fix options:
    • Deactivate acme-addon with wp plugin deactivate acme-addon.
    • Or reactivate WooCommerce with wp plugin activate woocommerce.
    • Or guard the call in acme-addon/src/hooks.php:18 so it only runs when WooCommerce is loaded:
      if ( function_exists( 'WC' ) ) {
          $cart = WC()->cart;
      }
  4. Suggests reloading the page to confirm.

Do not

  • Do not ask the user to set WP_DEBUG_DISPLAY = true on a production site. It leaks file paths and stack traces to visitors.
  • Do not delete debug.log. Read it. Deleting the log loses history that is often needed to confirm the fix.
  • Do not run wp db repair or modify the database as a first step. WSOD is almost always PHP, not SQL.
  • Do not edit plugin or theme code to swallow the error. Fix the cause, not the symptom.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.