Skip to content

mu-wpcom: Add a Protect page offering Scan on WordPress.com sites - #53245

Merged
jboland88 merged 18 commits into
trunkfrom
add/mu-wpcom-scan-page
Oct 21, 2026
Merged

jboland88 merged 18 commits into
trunkfrom
add/mu-wpcom-scan-page

Conversation

@jboland88

@jboland88 jboland88 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Proposed changes

This PR adds a Protect page to wp-admin on Simple and WoA sites, for sites that don't have the Scan feature yet. It works the same way as the Backup page from #52358: it offers a plan upgrade, or, for a Simple site that has the plan, initiates the transfer to WoA.

  • The page lives at admin.php?page=jetpack-protect, labeled "Protect". It's registered but hidden from the Calypso nav. It's hidden only when this package serves the slug, so the standalone Protect plugin keeps its own menu entry.
  • On WoA, the page steps aside once the plan includes Scan. Nothing serves jetpack-protect on WoA yet; that's expected for now.
  • The Backup page's logic is now shared w/ the Protect page: a WPCOM_Hosting_Feature_Page base class plus shared JS components.
  • Each page only supplies its copy, imagery, Tracks IDs and plan check. The Backup page's behavior is unchanged.
  • Two of its eligibility messages now use shared wording ("this feature" in place of "backups"): the generic not-eligible message and the staging-site one.

Related product discussion/links

Does this pull request change what data or activity we track or use?

The page fires the same view and click events as the Backup page, with site-scan as the feature ID, matching the dashboard's Scan upsell.

Testing instructions

Simple

  • Apply this PR to a Simple site (PCYsg-Osp-p2) and sandbox s0.wp.com to load the built assets.
  • On a site without a Business plan, visit /wp-admin/admin.php?page=jetpack-protect and confirm you see the "Protect against security threats" upgrade prompt.
  • Click Upgrade plan and confirm checkout opens with the Business plan. After the purchase, confirm you land back on jetpack-protect with the Activate Protect prompt.
  • Click Activate Protect and confirm the transfer starts.
  • Confirm Jetpack › Protect doesn't appear in the sidebar, and that the Calypso Scan link is still there.

Plan does not support Scan
Screenshot 2026-10-06 at 4 29 18 PM

Plan supports scan - initiate transfer
Screenshot 2026-10-06 at 4 25 18 PM

WoA

  • Get a WoA site with the Personal plan and update wpcomsh to this branch with Jetpack Beta (p9o2xV-1r2-p2).
  • Visit /wp-admin/admin.php?page=jetpack-protect and confirm you see the upgrade prompt.
  • With the standalone Protect plugin active, confirm its own Protect menu entry still shows and the page is the plugin's.

Regression

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jboland88 jboland88 added [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. [Package] Jetpack mu wpcom WordPress.com Features [Tests] Includes Tests [Plugin] Wpcomsh labels Oct 6, 2026
@jboland88 jboland88 self-assigned this Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 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 (Jetpack or WordPress.com Site Helper), and enable the add/mu-wpcom-scan-page branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack add/mu-wpcom-scan-page
bin/jetpack-downloader test jetpack-mu-wpcom-plugin add/mu-wpcom-scan-page

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 Oct 6, 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!


Jetpack plugin:

No scheduled milestone found for this plugin.

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


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

jp-launch-control Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 5 files.

File Coverage Δ% Δ Uncovered
projects/packages/jetpack-mu-wpcom/src/features/wpcom-backup/js/app.tsx 0/80 (0.00%) 0.00% 38 💔
projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php 38/503 (7.55%) -0.03% 2 ❤️‍🩹
projects/packages/jetpack-mu-wpcom/src/features/wpcom-backup/js/use-last-backup-download.ts 0/220 (0.00%) 0.00% 2 ❤️‍🩹
projects/packages/jetpack-mu-wpcom/src/features/wpcom-backup/js/download-panel.tsx 0/230 (0.00%) 0.00% 1 ❤️‍🩹
projects/packages/jetpack-mu-wpcom/src/features/wpcom-backup/wpcom-backup.php 4/6 (66.67%) -15.08% -21 💚

16 files are newly checked for coverage. Only the first 5 are listed here.

File Coverage
projects/packages/jetpack-mu-wpcom/src/features/wpcom-hosting-feature-page/js/activation-modal.tsx 0/180 (0.00%) 💔
projects/packages/jetpack-mu-wpcom/src/features/wpcom-hosting-feature-page/js/callout.tsx 0/62 (0.00%) 💔
projects/packages/jetpack-mu-wpcom/src/features/wpcom-hosting-feature-page/js/error-content-info.tsx 0/94 (0.00%) 💔
projects/packages/jetpack-mu-wpcom/src/features/wpcom-hosting-feature-page/js/feature-context.ts 0/19 (0.00%) 💔
projects/packages/jetpack-mu-wpcom/src/features/wpcom-hosting-feature-page/js/icons.tsx 0/11 (0.00%) 💔

Full summary · PHP report · JS report

Coverage check overridden by I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. .

jboland88 and others added 2 commits October 6, 2026 14:06
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d pages

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ label Oct 6, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jboland88 jboland88 added the I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. label Oct 6, 2026
@jboland88

Copy link
Copy Markdown
Contributor Author

Adding the "dont care" label for code coverage. One of the js files is an encoded svg and has nothing to test. Unit tests on the JS wouldn't add much value.

@jboland88
jboland88 marked this pull request as ready for review October 6, 2026 20:14
jboland88 and others added 2 commits October 7, 2026 11:08
Checkout's "Empty cart" reads only `checkoutBackUrlDomains`, so without it
backing out that way dropped the reader on /plans.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread projects/packages/jetpack-mu-wpcom/src/features/wpcom-scan/wpcom-scan.php Outdated
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jboland88

Copy link
Copy Markdown
Contributor Author

Thanks for the review and suggestions @kraftbj!

Added all 3 in the latest commit 👍

jboland88 and others added 4 commits October 7, 2026 20:45
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rcrdortiz
rcrdortiz previously approved these changes Oct 15, 2026

@rcrdortiz rcrdortiz 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.

Tests well for me and works as expected, I am seeing a JS error on that page that might be worth fixing before we move forward.

@rcrdortiz

Copy link
Copy Markdown
Contributor

@copilot

# Conflicts:
#	projects/packages/jetpack-mu-wpcom/src/features/wpcom-backup/wpcom-backup.php
#	projects/packages/jetpack-mu-wpcom/src/features/wpcom-hosting-feature-page/js/screens.tsx
#	projects/packages/jetpack-mu-wpcom/tests/php/features/wpcom-hosting-feature-page/WPCOM_Hosting_Feature_Page_Test.php
Stubbing wpcom_site_has_feature() with Brain Monkey defines it for the rest of
the run, which breaks the Marketplace tab tests that check function_exists().
kraftbj
kraftbj previously approved these changes Oct 15, 2026

@kraftbj kraftbj 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.

Approving. One optional bit inline.

// Some earlier suites never tear Brain Monkey down, and a leftover stub would block this one.
\Brain\Monkey\tearDown();
\Brain\Monkey\setUp();
$this->grant_feature( '' );

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.

Optional polish: since set_up() always stubs wpcom_site_has_feature(), nothing covers the fallback when it's missing (has_feature() returns false, so the page offers the upgrade). Now that the class runs in separate processes, one test that skips the stub would cover it.

rcrdortiz
rcrdortiz previously approved these changes Oct 19, 2026

@rcrdortiz rcrdortiz 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.

LGTM

# Conflicts:
#	projects/packages/jetpack-mu-wpcom/src/features/wpcom-backup/js/types.ts
#	projects/packages/jetpack-mu-wpcom/src/features/wpcom-backup/wpcom-backup.php
#	projects/packages/jetpack-mu-wpcom/src/features/wpcom-hosting-feature-page/js/screens.tsx
#	projects/packages/jetpack-mu-wpcom/src/features/wpcom-hosting-feature-page/js/style.scss
#	projects/packages/jetpack-mu-wpcom/tests/lib/class-wpcom-features.php
#	projects/packages/jetpack-mu-wpcom/tests/php/features/wpcom-backup/WPCOM_Backup_Test.php
@kraftbj
kraftbj dismissed stale reviews from rcrdortiz and themself via 5804536 October 20, 2026 04:31
jboland88 and others added 3 commits October 20, 2026 08:51
Jetpack's admin menu test referenced REGISTER_PRIORITY through the hosting feature
subclass, which Phan could not resolve since the constant lives on WPCOM_WP_Build_Page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Matches trunk: the legacy Backup entry stays visible to admins without a linked
WordPress.com account, who never load the menu that links Calypso in its place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jboland88
jboland88 merged commit fd462f4 into trunk Oct 21, 2026
87 of 88 checks passed
@jboland88
jboland88 deleted the add/mu-wpcom-scan-page branch October 21, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. [mu wpcom Feature] Wpcom Admin Menu [mu wpcom Feature] Wpcom Backup [mu wpcom Feature] Wpcom Hosting Feature Page [mu wpcom Feature] Wpcom Scan [Package] Jetpack mu wpcom WordPress.com Features [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Wpcomsh [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants