Skip to content

13A. Report a registration that arrives after the load pass - #74

Open
nikolaystrikhar wants to merge 2 commits into
47-lifecycle-actionsfrom
52-registration-after-the-pass
Open

13A. Report a registration that arrives after the load pass#74
nikolaystrikhar wants to merge 2 commits into
47-lifecycle-actionsfrom
52-registration-after-the-pass

Conversation

@nikolaystrikhar

Copy link
Copy Markdown
Contributor

What: Registry\Reader::buffer() reports a registration that arrives past the load pass, on _doing_it_wrong() and {prefix}/plugin_absorber/error; Boot\Scheduler exposes registration_window_has_closed() and reads the plugins_loaded position once for both windows.

Usage: a host module registering from its own plugins_loaded callback at the default priority used to vanish without a symptom. Now:

Absorber::register() ran after plugins_loaded had gone past the load
pass, so "give-recurring" arrived too late to be read. Register at
plugin-file scope, or no later than plugins_loaded priority 5.

Why this way:

The measurement stays with the priorities. The registry asks; Boot\Scheduler answers, because the answer turns on this library's own priorities and how far its hook has got. A registry reading $GLOBALS['wp_filter'] for itself would hold a second copy of a rule that moves whenever a priority here does.

Reporting is the whole remedy. boot() can fall back inline because the sequence had not run yet. Here it has. Requiring the file from a registration would be a load pass of one that skipped every gate and ran behind the conflict step, landing the bundled copy on a standalone nobody stood down.

It speaks only inside the dispatch. After plugins_loaded a host that has not booted yet is not late — wire() runs the sequence inline and reads the buffer — and nothing here can tell that host from one whose pass is long past. Where the answer is unknowable, the guard says nothing rather than warning about a sub-plugin that loaded.

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Enterprise

Run ID: a63b7fab-10f4-4618-ae89-cf9a607b1b08

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

Boot\Scheduler names Absorber::class in executable code, and has to: a named static
callback is what remove_filter() needs. What the rule is about is the registry -- no
collaborator reaches it through the facade.
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