Multisite stranding guard [2/4]: Answer whether a plugin is active for the whole network - #47
Multisite stranding guard [2/4]: Answer whether a plugin is active for the whole network#47d4mation wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (7)
Included review availability: Your plan provides up to 12 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe plugin checker now exposes ChangesNetwork activation status
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The PR adds a narrowly scoped network-active check and its related test updates; no actionable merge-blocking risk remains after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant Checker
participant WordPressPluginFunctions
participant NetworkActivationFunction
Checker->>WordPressPluginFunctions: load plugin functions
Checker->>NetworkActivationFunction: check plugin basename
NetworkActivationFunction-->>Checker: return network activation status
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
7127ff9 to
f1569c2
Compare
f1569c2 to
481ea2d
Compare
481ea2d to
14384ba
Compare
What: Add
Checker_Interface::is_network_active()and itsPlugin\Checkerimplementation, wrappingis_plugin_active_for_network().Usage:
Why this way:
Interface method only — no
Providerchange.Checkeris bound by class name, so an added interface method needs no constructor wiring; the container builds it exactly as before. The fourChecker_Interfacetest doubles gain the method, which is the whole ripple of the contract addition.Network scope, deliberately not folded into
is_active().is_active()ORs the network check into its answer and means "the standalone's code runs this request"; the stranding guard needs a different question — "deactivating it reaches every site" — so the two stay separate.is_plugin_active_for_network()returnsfalseoff a network, so callers need nois_multisite()guard, which is what lets the guard skip one.Stack created with GitHub Stacks CLI • Give Feedback 💬
Summary by CodeRabbit
New Features
Documentation
Tests