Repository navigation
Name every hook by the slash grammar and move to GPL-3.0-or-later - #66
Merged
Merged
Conversation
Refresh the Composer lock: WordPress core 7.1.4, PHPStan 2.3.4, php-code-coverage 14.5.0 and Symfony patch releases; theseer/tokenizer drops out as no package requires it any more. The npm lock stays as it is, because npm's seven-day release-age cooldown on this host resolved older @WordPress packages than the lock already holds. No code change was needed. Assisted-by: Claude Code:claude-opus-5-5
The framework's hooks take {prefix}_snake names, which give a reader one
delimiter for two jobs: the boundary between levels and the boundary
between words. The tests now expect the names the owner ruled: every
hook is {prefix}/area/name, and its last level says what kind of hook
it is.
- boot outcomes: {prefix}/boot/succeeded, /boot/failed, /boot/blocked;
- admin notices: {prefix}/admin_notice/should_show, /message,
/dismissed;
- the migration runner's scheduled hook {option}/migration/run and its
admin-post action {option}/migration/run_now;
- hooks built from a consumer's id: {id}/options_page/tabs,
{id}/object_form/fields, {id}/product_data_tab/groups;
- the updater's dws_github_updater/config/{slug}.
consumer-a's own safeguard filter follows the same grammar as
acme_ca/exports/should_restrict. Against the current code, 41 of the
193 affected Integration tests fail.
Assisted-by: Claude Code:claude-opus-5-5
The framework fired {prefix}_snake hooks, whose single delimiter hides
the boundary between levels, and whose names did not say whether a
hook is an event, a decision or a value. Every hook is now
{prefix}/area/name with a last level that names its kind: a past
participle for an event, an imperative for a scheduled hook, a
predicate for a boolean filter and the value's noun otherwise.
- PluginBoot fires {prefix}/boot/succeeded, /boot/failed and
/boot/blocked;
- AdminNotices filters {prefix}/admin_notice/should_show and /message
and fires /admin_notice/dismissed;
- MigrationRunner schedules {option}/migration/run, which also names
its admin-post action and nonce, {option}/migration/run_now;
- OptionsPage, ObjectForm and ProductDataTab filter
{id}/options_page/tabs, {id}/object_form/fields and
{id}/product_data_tab/groups;
- the bootstrap updater filters dws_github_updater/config/{slug}.
AGENTS.md states the grammar under Style, because WordPress tells
actions from filters by no name form, and names the boot hook in
convention 5 and limitation 1. Nothing is tagged, so no alias bridges
the old names.
Assisted-by: Claude Code:claude-opus-5-5
Every v1 plugin and framework package, and WooCommerce, the host of most plugins on the framework, is GPL-3.0-or-later, while the v2 framework carried GPL-2.0-or-later. A plugin combining the two ships under GPLv3 through the "or later" clause, so its own header would not state the license it ships under. Moving the framework to GPL-3.0-or-later gives one license across the stack and needs no consent for code derived from v1. The root and package LICENSE files hold the GNU text of version 3, the root and package manifests and the npm manifest declare GPL-3.0-or-later, AGENTS.md names it, and the fixture plugins' headers, manifests and locked framework entries follow. Third-party packages in the locks keep their own licenses. Assisted-by: Claude Code:claude-opus-5-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary. Two changes ahead of the 2.0.0 tag:
every hook the framework fires takes a
{prefix}/area/namename whose last level says what kind of hook it is;the framework moves from GPL-2.0-or-later to GPL-3.0-or-later.
Hook names:
{prefix}_snakegave one delimiter two jobs, the boundary between levels and the boundary between words, and a name did not say whether its hook is an event, a decision or a value./separates levels and_separates words.is_,has_,can_,should_) for a boolean filter, and the noun of the value for any other filter, plural for a list.AGENTS.mdStyle states the grammar, and convention 5 and limitation 1 name the boot hook.PluginBoot{prefix}_initialized,{prefix}_initialization_failure,{prefix}_initialization_blocked{prefix}/boot/succeeded,{prefix}/boot/failed,{prefix}/boot/blockedAdminNotices{prefix}_notice_visible,{prefix}_notice_message,{prefix}_notice_dismissed{prefix}/admin_notice/should_show,{prefix}/admin_notice/message,{prefix}/admin_notice/dismissedMigrationRunner{option}_run, with the admin-post action and nonce{option}_run_now{option}/migration/run, with{option}/migration/run_nowOptionsPage,ObjectForm,ProductDataTab{id}_tabs,{id}_fields,{id}_groups{id}/options_page/tabs,{id}/object_form/fields,{id}/product_data_tab/groupsUpdaterdws_github_updater_config_{slug}dws_github_updater/config/{slug}admin-post.phpreads its action throughsanitize_text_field(), which keeps/, so the run-now link still dispatches.acme_ca/exports/should_restrict.Migration runner: the scheduled hook
{option}/migration/runis longer than the lock{option}_lockthrough which the constructor validated the option, so the runner builds itsScheduledHookin the constructor. An option too long to name the hook fails at construction instead of when a batched step first schedules its continuation.License: every v1 plugin and framework package, and WooCommerce, is GPL-3.0-or-later. A plugin combining them with a GPL-2.0-or-later framework ships under GPLv3 through the "or later" clause, so its header would not state the license it ships under.
LICENSEfiles hold the GNU text of version 3.AGENTS.mdnames it.Packages: the Composer lock moves to WordPress core 7.1.4, PHPStan 2.3.4, php-code-coverage 14.5.0 and Symfony patch releases. The npm lock stays as it is, because npm's seven-day release-age cooldown resolved older
@wordpresspackages than the lock holds.Production code +32 −22 (7 files), tests +69 −61 (12 files), fixtures +28 −28 (20 files), docs +5 −4 (2 files), the six
LICENSEfiles, eight manifests +8 −8, and eight locks (+3,944 −1,959 in all, nearly all the license text).Review points.
@versionstays 2.0.0 and no changelog fragment ships. A development site that queued a migration job under{option}_runkeeps it until Action Scheduler fails it, since no callback listens.AGENTS.mdstates it.$show, matchingshould_show.Testing.
composer quality-checkpasses: validate, changelog validation, PHPCS on both profiles, the PHPStan profiles and every fixture's, Unit 192 and Integration 1,346.composer test:integration:multisitepasses (41), and so doescomposer test:integration:php74(2), which loads the bootstrap package on PHP 7.4.