Skip to content

🐛 fix: activation reads the plugin header; migrate:create creates the table it is given - #120

Merged
gfazioli merged 1 commit into
masterfrom
fix/activation-plugin-header
Oct 6, 2026
Merged

gfazioli merged 1 commit into
masterfrom
fix/activation-plugin-header

Conversation

@gfazioli

@gfazioli gfazioli commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Two 2.x bugs found while working on the 3.0 migrations (#40, #119), for 2.1.1.

  • Activation reads the plugin header. Since Localization stop work with WordPress 6.7 #51 the kernel reads the header on init, and activation comes after init: in Plugin::_activation() the slug was '' and Version was null, so the options delta wrote to an options row with no name, and plugin/activation.php saw no Version. Every WP Bones plugin activated on 2.0.x/2.1.0 left that row behind (it is harmless, and this does not delete it).
  • php bones migrate:create <table> creates <table>. The stub ignored the name and always wrote my_plugin_products.

Proof

  • composer test: 175 tests (one new, for the stub), green.
  • .claude/scripts/activation-live-smoke.sh in the workspace, on WPKirk-Developing:
v2.1.0 this branch
slug during activation ✗ '' ✓ wp_kirk_developing_slug
Version during activation ✗ null ✓ 2.0.8 (the bench's header)
the delta writes the plugin's own options row ✗ ✓

… table it is given

Activation comes after init, which is where the kernel reads the plugin header since #51, so in
Plugin::_activation() the slug was '' and Version null: the options delta wrote to an options
row with no name, and plugin/activation.php saw no Version. It now reads the header first.
Measured live on 2.1.0 (activation-live-smoke.sh): slug '', Version null, no options row of
the plugin's own; all three right on this branch.

The migrate:create stub ignored the table name and always created my_plugin_products.

Both found while working on #40 for 3.0.
@gfazioli
gfazioli merged commit 6b645b0 into master Oct 6, 2026
4 checks passed
@gfazioli
gfazioli deleted the fix/activation-plugin-header branch October 6, 2026 09:25
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