You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Action hooks for runtime environment setup / teardown #1269
The isolated DB / object-cache boundary lives in Runtime_Environment_Setup (set_up() / clean_up()), used from admin AJAX and CLI_Runner. There is no supported hook at that boundary for integrations that need to observe or react to setup/teardown itself.
Proposed solution
Fire do_action() from includes/Checker/Runtime_Environment_Setup.php (names aligned with existing wp_plugin_check_*), at these four moments:
Beforeset_up() mutates state
Afterset_up() completes for this request
Beforeclean_up() runs
Afterclean_up() completes
Optionally pass one small, documented argument to each hook (e.g. an array of stable flags such as early-exit) so listeners get context without a wide, fragile public surface.
Benefits
One extension surface for admin and CLI.
Observability and automation (metrics, assertions) without parsing AJAX.
Matches WordPress patterns; low risk because logic stays centralized.
Implementation notes
Hooks run while DB and drop-in state change—easy to break things if misused. Document which hooks run when set_up() / clean_up() exit early; pass few stable args; add @since on new hooks.
Activity
Add setup/cleanup actions to Runtime_Environment_Setup
Introduce WP_PLUGIN_CHECK_BOOTSTRAP_FILE extension point
Add tests for setup/cleanup hooks and bootstrap file mechanism
Document setup/cleanup hooks and bootstrap file in changelog
Add early-return PHPUnit test and Behat hook scenario
Add wp_plugin_check_phpcs_args filter
Add wp_plugin_check_check_result filter
Add setup/cleanup actions to Runtime_Environment_Setup
Introduce WP_PLUGIN_CHECK_BOOTSTRAP_FILE extension point
Add tests for setup/cleanup hooks and bootstrap file mechanism
Document setup/cleanup hooks and bootstrap file in changelog
Add early-return PHPUnit test and Behat hook scenario
Add wp_plugin_check_phpcs_args filter
Add wp_plugin_check_check_result filter