Skip to content

tooling: add make doctor to repair local WordPress roles/caps - #53

Merged
Drago37 merged 1 commit into
developfrom
tooling/local-doctor
Sep 22, 2026
Merged

Drago37 merged 1 commit into
developfrom
tooling/local-doctor

Conversation

@Drago37

@Drago37 Drago37 commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Adds make doctor (tools/local-doctor.php) to repair a local dev environment whose WordPress roles drifted (copy-of-prod DB → administrator has no caps → every /wp-admin/ page 403s, breaking make browser-local). It recreates the standard roles + WooCommerce caps and restores admin. Local-only (tools/ never deployed). AGENTS documents it.

Fixes a local dev environment whose WordPress roles drifted — a
copy-of-prod database where the `administrator` role lost its
capabilities, so every /wp-admin/ page returns 403 (which breaks
`make browser-local`). `make doctor` (tools/local-doctor.php) recreates
the standard roles, re-applies the WooCommerce caps and restores `admin`
to administrator.

Local-only: the tools/ folder is never deployed and the tool no-ops
outside WP-CLI. Run via `wp eval "require …"` (not `eval-file`), because
`declare(strict_types=1)` is illegal inside the eval() that `eval-file`
uses. AGENTS documents it next to the browser smoke.
@Drago37 Drago37 added the enhancement New feature or request label Sep 22, 2026
@Drago37 Drago37 self-assigned this Sep 22, 2026
@Drago37
Drago37 merged commit 446aa58 into develop Sep 22, 2026
6 checks passed
@Drago37
Drago37 deleted the tooling/local-doctor branch September 22, 2026 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant