Extract Admin_Manager as a pure admin registration utility#92
Merged
Conversation
This was referenced May 18, 2026
c25f88c to
90e9938
Compare
b0c3ca5 to
fe91936
Compare
71493b9 to
5763c91
Compare
fe91936 to
8a03b94
Compare
5763c91 to
ee308cf
Compare
8a03b94 to
130ca17
Compare
… utility Part of EPIC #86. Closes #89. - New wp-plugin/admin/class-admin-manager.php: register_page(), register_cleanup_handler(), register_asset_enqueuer(), init() - Sybgo::init_admin() delegates all registration to Admin_Manager - init_abilities() deferred to 'init' hook to avoid WP 6.7+ early-textdomain notices - Add AdminManagerTest unit tests - Update docs
fcaf274 to
ee09276
Compare
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.
Description
Closes #89
Part of EPIC #86 — refactor
class-sybgo.phpinto focused OOP classes. Extracts all WordPress admin bootstrapping into a newAdmin_Managerclass following the "registration utility" pattern established in the EPIC.Type of change
Detailed scenario
What was tested
cd wp-plugin && vendor/bin/phpunit --testsuite Unit)cd wp-plugin && composer phpcs)cd wp-plugin && vendor/bin/phpstan analyse --memory-limit=1G)Admin_Manager::init()is the sole entry point for admin bootstrapping — no admin logic remains inclass-sybgo.phpHow to test
feat/admin-manager-89cd wp-plugin && composer installAffected Features & Quality Assurance Scope
Technical description
Documentation
Admin_Manager(wp-plugin/admin/class-admin-manager.php) is a pure registration utility following the same pattern asCron_ManagerandAbility_Manager:register_page(object $page)— accumulates admin page instancesregister_cleanup_handler(callable $handler)— stores the cleanup form callbackregister_asset_enqueuer(callable $enqueuer)— stores the asset enqueue callbackinit()— callsinit()on each page and wires the registered callbacks to WP actionsAll wiring logic (which pages to instantiate, what the cleanup handler does, which hooks to enqueue on) lives in
Sybgo::init_admin()as closures.Admin_Managerhas no knowledge ofFactory,Dashboard_Widget, or any concrete page class.class-sybgo.phpnow delegates all admin bootstrapping toinit_admin(), which creates the manager, registers everything, and callsinit().See wp-plugin/docs/development.md for updated constructor dependencies and project structure.
New dependencies
None.
Risks
None identified. Pure extraction — no logic change. All closures were previously inline in
class-sybgo.php; they now live inSybgo::init_admin().Mandatory Checklist
Code validation
Code style
Unticked items justification
None.
Additional Checks