Skip to content

Name the table prefix collision in the uninstall limitations - #69

Merged
ahegyes merged 3 commits into
trunkfrom
fix/uninstall-table-prefix-sweeps
Nov 1, 2026
Merged

ahegyes merged 3 commits into
trunkfrom
fix/uninstall-table-prefix-sweeps

Conversation

@ahegyes

@ahegyes ahegyes commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

Limitation 3 names a hazard of the uninstall engine: an option_prefixes or user_meta_global_prefixes entry that the table prefix starts with, such as wp_ on a default install, also deletes the site's roles and every user's capabilities, which WordPress names after the table prefix. The branch first guarded the two sweeps against it, but the collision takes a plugin prefix WordPress reserves, or one that heads a randomized or hand-picked table prefix, so the guard and its row are removed and only the sentence remains.

Affected packages

  • wp-framework-bootstrap
  • wp-framework-shared
  • wp-framework-core
  • wp-framework-settings
  • wp-framework-woocommerce

AGENTS.md only; the packages are as on trunk.

Checklist

  • Tests added or updated (Unit and/or Integration as appropriate) (documentation only)
  • composer quality-check passes locally (PHPCS, PHPStan and the tests) (Unit suite on the final commit; the code is identical to trunk)
  • Public API changes are documented in the affected package's README.md (none)
  • Breaking changes are explicitly justified below (none)

WordPress names each user's roles on a site and the site's role
definitions after the table prefix, as {prefix}capabilities in user
meta and {prefix}user_roles in the options. The option_prefixes and
user_meta_global_prefixes sweeps match names with no site prefix, so a
footprint prefix that heads the table prefix, as a plugin prefix of wp
would on a default install, deletes every user's roles and the role
definitions.

The row runs the engine under a table prefix that a footprint prefix
heads and checks that the rows WordPress names after it survive, while
the plugin's own rows go, those under a longer prefix that starts with
the table prefix included.

Assisted-by: Claude Code:claude-opus-5-5
The option_prefixes and user_meta_global_prefixes sweeps deleted every
name under a footprint prefix, so where that prefix heads the table
prefix they also deleted {table prefix}user_roles and every user's
{table prefix}capabilities, locking every user out of the site.

When a footprint prefix heads the table prefix, those two sweeps leave
out every name that starts with the table prefix; a prefix that does
not head it, such as one longer than the table prefix that starts with
it, sweeps as before. Limitation 3 names the rows that stay.

Assisted-by: Claude Code:claude-opus-5-5
@ahegyes ahegyes changed the title Fix/uninstall table prefix sweeps Keep WordPress's roles out of the uninstall's prefix sweeps Nov 1, 2026
The guard kept WordPress's roles and capabilities out of the option and
global user meta prefix sweeps when a footprint prefix heads the table
prefix, which takes a plugin prefix of wp on the default wp_ table
prefix, reserved by WordPress, or one that heads a randomized or
hand-picked table prefix. That is a consumer's misconfiguration, not a
fault under normal use, so the engine carries no code for it.

The guard and its row go, and limitation 3 names the hazard: such an
entry also deletes the site's roles and every user's capabilities.

Assisted-by: Claude Code:claude-opus-5-5
@ahegyes
ahegyes merged commit 384b656 into trunk Nov 1, 2026
20 checks passed
@ahegyes
ahegyes deleted the fix/uninstall-table-prefix-sweeps branch November 1, 2026 10:48
@ahegyes ahegyes changed the title Keep WordPress's roles out of the uninstall's prefix sweeps Name the table prefix collision in the uninstall limitations Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant