Refactor lazy admin component registry - #1403
danieliser wants to merge 1 commit into
Conversation
|
Warning Review limit reachedNext included review available in 50 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Replace the chain of conditionals in PUM_Admin::init_request_components() with two explicit maps: post types to their editor components, and page definition keys to their screen components. Matching stays keyed on page definition keys rather than slugs, since slugs are filterable and translated per site. Extract the upsell context test into request_has_upsell_context(), which now derives the popup/popup_theme check from the post type map instead of repeating the literal list, so the two cannot drift apart. Behavior is unchanged. Registered pages without a screen component of their own, including Help & Support and pages added by other plugins through pum_admin_pages, continue to initialize upsells. Lazy loading is preserved: included-class evidence on an unrelated admin screen and on the settings screen is identical before and after. Expand PUM_Admin_Loader_Test with a request matrix covering each post type and page match, non-matching admin screens, overlapping post type and page requests, pages that match upsells without a screen component, and non-array page slugs. Screen components are asserted through their registered hooks rather than class_exists, because the lazy save hooks autoload PUM_Admin_Popups and PUM_Admin_Themes during bootstrap. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ffc91d5 to
f6f282c
Compare
|
The first CI pass exposed a PHP 7.4-only edge that the agent’s PHP 8 local run missed: |
Summary
Evidence
No public/filterable registry API is added.