Skip to content

wpcomsh: Hide the forced-on Reader row from My Jetpack Features - #55507

Merged
dhasilva merged 2 commits into
trunkfrom
update/wpcomsh-hide-reader-feature-row
Nov 27, 2026
Merged

dhasilva merged 2 commits into
trunkfrom
update/wpcomsh-hide-reader-feature-row

Conversation

@dhasilva

Copy link
Copy Markdown
Contributor

Fixes JETPACK-3940

Proposed changes

Why not take the module out of jetpack_get_available_modules instead: wpcomsh's init hook 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

  • p1HpG7-zcG-p2#comment-79008 (decision: hide the Reader row on WordPress.com rather than add a switch)
  • JETPACK-3914 (the Atomic pass that found the row)

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-plans flag to show My Jetpack)

  1. Go to Jetpack › My Jetpack › Features. Under the other features, WordPress.com Reader shows with a title only. Search for "reader": it is the only match.
  2. wpcomsh can't be switched to a PR build, so stand in for the new callback with a mu-plugin (the unit test covers the wiring):
    <?php
    add_filter( 'jetpack_my_jetpack_feature_visibility', function ( $states ) {
    	$states['wpcom-reader'] = 'hidden';
    	return $states;
    } );
  3. Reload Features. The Reader row is gone, and searching "reader" finds nothing. Blaze Ads keeps its row.
  4. The admin bar still shows the Reader link.
  5. Remove the mu-plugin.

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-reader to Main_Features::get_state()['hidden_modules']. Not yet checked on a live Atomic site.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ABKQhZtYVs6QkJkzmzAJ1c

dhasilva and others added 2 commits November 26, 2026 12:58
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
@dhasilva dhasilva added the [Status] Needs Review This PR is ready for review. label Nov 26, 2026
@dhasilva dhasilva self-assigned this Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (WordPress.com Site Helper), and enable the update/wpcomsh-hide-reader-feature-row branch.

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Wpcomsh plugin:

  • Next scheduled release: Atomic deploys happen twice daily on weekdays (p9o2xV-2EN-p2)

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@jp-launch-control

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/plugins/wpcomsh/feature-plugins/wpcom-reader-link.php 10/16 (62.50%) 12.50% 0 💚

Full summary · PHP report

@CGastrell CGastrell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@dhasilva
dhasilva merged commit 74216c2 into trunk Nov 27, 2026
85 checks passed
@dhasilva
dhasilva deleted the update/wpcomsh-hide-reader-feature-row branch November 27, 2026 12:02
@github-actions github-actions Bot removed the [Status] Needs Review This PR is ready for review. label Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants