Repository navigation
wpcomsh: Hide the forced-on Reader row from My Jetpack Features - #55507
Conversation
wpcomsh keeps wpcom-reader on for every Atomic site, so its Features row is a locked switch with no description. Answer jetpack_my_jetpack_feature_visibility once the module is forced on, as the old Modules screen already hides it. The module stays on, so the admin bar Reader link stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ABKQhZtYVs6QkJkzmzAJ1c
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ABKQhZtYVs6QkJkzmzAJ1c
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
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! Wpcomsh plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCoverage changed in 1 file.
|
CGastrell
left a comment
There was a problem hiding this comment.
Approved. The callback is wired under the same "module is on" check as the forced-on filter, keeps what other hosts hid, and the test covers both.
Checked on an Atomic Business site (Jetpack 16.5-a trunk, rolling wpcomsh) with your callback loaded as a mu-plugin, wired the same way: Main_Features::get_state()['hidden_modules'] went from empty to wpcom-reader. The module stays active, and Blaze is not hidden. I checked the data, not the Features page in a browser.
Note for the gate lift: this filter loads for every user, so it also covers admins not linked to WordPress.com, who already see My Jetpack on Personal and Premium (see JETPACK-3784).
Fixes JETPACK-3940
Proposed changes
wpcom-readeron for every Atomic site (Reader module: ensure it's always active on Atomic sites #46782) and reports it as forced on (wpcomsh: Lock the Blaze and Reader switches in My Jetpack where WordPress.com keeps them on #54815), so the row was a locked switch with no description or link.jetpack_my_jetpack_feature_visibilitywith'wpcom-reader' => 'hidden'once the module is forced on. That's the same file that already hides Reader from the old Modules screen. The row drops out of Features search too.Why not take the module out of
jetpack_get_available_modulesinstead: wpcomsh'sinithook would then try to activate it on every request and fail, and users without a WordPress.com account would lose the admin bar link the module gives them.Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
Automated
jp docker phpunit wpcomsh -- --filter=ReaderLinkTest: the forced-on row is hidden from Features and keeps what other hosts hid; the refused-activation row hides nothing.On an Atomic Business site (Personal and Premium need the
wpcom-my-jetpack-all-atomic-plansflag to show My Jetpack)What I ran: the test above (failing first, then passing, plus a check that a callback dropping the incoming map fails it), the full wpcomsh suite (432 tests, 8 environment skips), and Phan. On a local site running Jetpack trunk, loading this branch's file and callback adds
wpcom-readertoMain_Features::get_state()['hidden_modules']. Not yet checked on a live Atomic site.🤖 Generated with Claude Code
https://claude.ai/code/session_01ABKQhZtYVs6QkJkzmzAJ1c