WordPress / WordPress/plugin-check

Action hooks for runtime environment setup / teardown

Open
#1,269 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

[Type] Enhancement
Dominant language
PHP
Stars
362
Forks
126
Avg merge
1d 23h
Merged PRs (30d)
22

Description

Problem

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:

  1. Before set_up() mutates state
  2. After set_up() completes for this request
  3. Before clean_up() runs
  4. After clean_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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading includes/Checker/Runtime_Environment_Setup.php, focusing on set_up() and clean_up(), then trace their use from admin AJAX and CLI_Runner. Done means four documented wp_plugin_check_* hooks cover the before/after points, including early-exit behavior and @since annotations, with a small stable context argument if needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, cli, database
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.