Skip to content

Commit 3cf7f6f

Browse files
authored
Fix wp-performance: wp doctor check needs --all or check names (#114)
## Problem The `wp-performance` skill tells agents to run `wp doctor check` with no arguments as the first diagnostic step. That command runs no checks and exits with an error: ``` $ wp doctor check Error: Please specify one or more checks, or use --all. ``` The guard is in [`src/Command.php` L120-L123](https://github.com/wp-cli/doctor-command/blob/116316d/src/Command.php#L120-L123) of `wp-cli/doctor-command`, and it is present in every release tag back to v0.1.0. An agent following the skill hits the error at step 2 ("Fast wins"). Fixes #113. ## Changes - `skills/wp-performance/SKILL.md`: step 2 now uses `wp doctor check --all` (with `--spotlight` as an option) and shows the named-check form for a perf-focused run. The Verification bullet uses `--all` too. - `skills/wp-performance/references/wp-cli-doctor.md`: "Recommended usage" lists `--all`, the three perf-related checks by name, and `--all --spotlight`, and notes that one of `--all` or a check name is required. - `eval/scenarios/performance-profile-slow-endpoint.json`: step 4 and the matching success criterion expect `--all` or named checks instead of the bare command. ## Testing - `node shared/scripts/validate-skills.mjs` passes. - Ran the old and new commands against a local WordPress 7.1 site: | doctor-command | WP-CLI | `wp doctor check` | Named checks | `--all` | |---|---|---|---|---| | v2.1.0 to v2.3.0 | 2.12.0 | error, exit 1 | 3 checks run, exit 0 | 16 checks run | | v3.0.0 | 3.0.0-alpha nightly | error, exit 1 | 3 checks run, exit 0 | 16 checks run | - The same guard is in the tagged source of every other release back to v0.1.0.
1 parent 8bd67b0 commit 3cf7f6f

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

‎eval/scenarios/performance-profile-slow-endpoint.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"Step 1: Run wordpress-router to classify repo kind",
77
"Step 2: Run wp-project-triage to verify WP-CLI and profiling tools",
88
"Step 3: Route to wp-performance skill",
9-
"Step 4: Run wp doctor check first for quick diagnostics",
9+
"Step 4: Run wp doctor check --all (or named checks) first for quick diagnostics",
1010
"Step 5: Run wp profile stage --url=/ to profile request stages",
1111
"Step 6: Identify slowest stage (bootstrap, main_query, template)",
1212
"Step 7: Run wp profile hook --stage=<slow-stage> to drill down",
@@ -16,7 +16,7 @@
1616
],
1717
"success_criteria": [
1818
"Routes to wp-performance skill",
19-
"Uses wp doctor check first",
19+
"Uses wp doctor check --all (or named checks) first, never the bare command",
2020
"Uses wp profile stage and wp profile hook",
2121
"Provides backend-only workflow (no browser required)",
2222
"Mentions Query Monitor as optional with REST/envelope usage"

‎skills/wp-performance/SKILL.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ This detects:
5555

5656
If you have WP-CLI access, prefer:
5757

58-
- `wp doctor check`
58+
- `wp doctor check --all` (add `--spotlight` to show only warnings and errors)
59+
- or name the checks for a perf-focused run: `wp doctor check autoload-options-size constant-savequeries-falsy constant-wp-debug-falsy`
60+
61+
`wp doctor check` with no check names and no `--all` exits with an error instead of running anything.
5962

6063
It catches common production foot-guns (autoload bloat, SAVEQUERIES/WP_DEBUG, plugin counts, updates).
6164

@@ -126,7 +129,7 @@ Reference: https://make.wordpress.org/core/2025/11/18/wordpress-6-9-frontend-per
126129
## Verification
127130

128131
- Baseline vs after numbers are captured (same environment, same URL/route).
129-
- `wp doctor check` is clean (or improved) when applicable.
132+
- `wp doctor check --all` is clean (or improved) when applicable.
130133
- No new PHP errors or warnings in logs.
131134
- No cache flush is required for correctness (cache flush should be last resort).
132135

‎skills/wp-performance/references/wp-cli-doctor.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ Docs:
1313

1414
## Recommended usage
1515

16-
- `wp doctor check`
16+
- `wp doctor check --all` (run every registered check)
17+
- `wp doctor check autoload-options-size constant-savequeries-falsy constant-wp-debug-falsy` (perf-focused run)
18+
- `wp doctor check --all --spotlight` (show only warnings and errors)
1719
- `wp doctor list` (to see available checks)
1820

21+
`wp doctor check` needs either `--all` or at least one check name; with neither it exits with "Please specify one or more checks, or use --all."
22+
1923
Especially relevant to performance:
2024

2125
- `autoload-options-size` (autoloaded options threshold)

0 commit comments

Comments
 (0)