My Jetpack: show the forced note on plugins a host enables or disables - #52584
Merged
kraftbj merged 2 commits intoSep 23, 2026
Conversation
kraftbj
added this pull request to stack #52585
September 21, 2026 21:53
Contributor
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Contributor
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
kraftbj
marked this pull request as ready for review
September 22, 2026 15:19
Read a plugin forced through option_active_plugins, or network-activated, the way Jetpack_Modules_Overrides reads modules, and give its Features grid card and modal the same treatment as a forced module. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…utes The list view's bulk checkbox, select-all and the bulk switch skipped only forced modules, so a forced plugin could still be picked and flipped straight back. The modal's "Available in" also kept showing for a plugin a host forced off. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
kraftbj
force-pushed
the
add/my-jetpack-forced-plugin-note
branch
from
September 22, 2026 17:44
2af2e00 to
e9c56f3
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.
Stacked on PR 52505.
Proposed changes
PR 52505 swaps the switch for a note when a host forces a module on or off. Features switched by a standalone plugin (Akismet, Backup, Boost, CRM, Protect) had no equivalent, so a host pinning one of those still left the owner a switch that flips straight back. This does the same for plugins, on the Features tab.
Main_Features::get_plugin_override()reads a forced plugin the wayJetpack_Modules_Overridesreads a forced module: it runsoption_active_pluginsover an empty list (anything it adds is forced on) and over a list holding just this plugin (dropping it means forced off). A network-activated plugin also counts as forced on, since the site's own switch can't turn it off either.plugin_overrideon each feature, and a forced plugin gets the same treatment PR 52505 gives a forced module: the card and list row show only its status, with no switch and no bulk checkbox. The modal explains it: forced on shows "Enabled by your host or site administrator" beside Open, and forced off says "Disabled by…" under "How to get it" and drops "Available in".getForcedReason()now answers for both kinds, so every one of those spots follows from it.isBulkSwitchable()only left out forced modules, so a forced plugin could be picked by select-all and flipped straight back.Up for discussion:
pre_option_active_pluginsisn't read. A host short-circuiting the whole list wouldn't be detected.Jetpack_Modules_Overrideshas the same blind spot for modules, and the one use of that hook I found (jetpack-mu-wpcom's plugin conflict probe) is request-scoped, not a host pin.Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
Turn on the
my-jetpack-features-tabflag, install Jetpack Boost, and add this as an mu-plugin:$plugins[] = 'jetpack-boost/jetpack-boost.php';). The card shows Active with no switch, and the modal shows "Enabled by your host or site administrator" beside Open.Automated coverage:
Main_Features_Plugin_Override_Testfor the detection, plus the Features grid's Jest tests for the card, list, bulk switch and modal.🤖 Generated with Claude Code