Skip to content

My Jetpack: answer feature checks locally on WordPress.com hosts - #52575

Closed
jboland88 wants to merge 1 commit into
trunkfrom
update/my-jetpack-wpcom-feature-check
Closed

jboland88 wants to merge 1 commit into
trunkfrom
update/my-jetpack-wpcom-feature-check

Conversation

@jboland88

Copy link
Copy Markdown
Contributor

Allows WoA sites to do feature checks without a remote call to WPCOM

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

No

Testing instructions

  • You will need a WoA test site
  • Apply this PR using the Jetpack Beta plugin
  • Navigate to My Jetpack
  • Feature checks should take less time to load - confirming what exactly to check for here

`Product::does_site_have_feature()` always fetched `/sites/%d/features` to
answer a question WordPress.com can already answer in-process there: wpcomsh
exposes `wpcom_site_has_feature()` on Atomic, gating from the same data the
endpoint is built from.

Hijack to it when it is available, the way `Current_Plan::supports()` already
does, guarded by `wpcom_feature_exists()` so a slug WordPress.com does not gate
falls through to the feature list instead of being answered "no" by a registry
that never had it. Every slug My Jetpack looks up — ai-assistant, antispam,
backups, cloud-critical-css, scan, search, social-enhanced-publishing,
stats-paid, videopress, republicize — is a WPCOM_Features map key, so all of
them take the local path.

Besides removing a blocking request per dashboard render, this makes the answer
independent of WordPress.com being reachable: a failed fetch used to read as
"no feature", which could offer an upsell to a site that owns the product.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 21, 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), and enable the update/my-jetpack-wpcom-feature-check branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/my-jetpack-wpcom-feature-check

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 added [Package] My Jetpack [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Stats Data [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. [Status] In Progress [Tests] Includes Tests labels Sep 21, 2026
@github-actions

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!

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Sep 21, 2026
@jp-launch-control

jp-launch-control Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/my-jetpack/src/products/class-product.php 265/317 (83.60%) 0.42% 0 💚

Full summary · PHP report · JS report

@jboland88

Copy link
Copy Markdown
Contributor Author

closing this, I had originally started it to help with #52495, but then decided to take the PR in a direction that didn't require requesting site features

@jboland88 jboland88 closed this Sep 23, 2026
@github-actions github-actions Bot removed [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] My Jetpack [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Stats Data [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant