Skip to content

My Jetpack | Enable access to My Jetpack on WP multisite #44260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 16, 2025

Conversation

manzoorwanijk
Copy link
Member

@manzoorwanijk manzoorwanijk commented Jul 10, 2025

Currently, access to My Jetpack is disabled. See #23069.

Fixes MYJP-105, MYJP-222

Proposed changes:

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

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

Testing instructions:

  • Create a WP multisite on JN.
    • Expand the "Jetpack Live Branches" below
    • Under "Settings", check "Multisite based on subdirectories"
    • Then open the link to create the site
  • Activate Jetpack Network wide.
  • Apart from the main site, create another test site
  • Go to its My Jetpack
  • Confirm that the page is accessible
  • Complete onboarding
  • Goto Products tab
  • Confirm that you see the unavailability warning for Backup, Firewall, and Ads as mentioned in support docs.
Screenshot 2025-07-10 at 10 11 34 AM Screenshot 2025-07-10 at 10 11 42 AM

Small screens
Screenshot 2025-07-10 at 10 32 19 AM

@manzoorwanijk manzoorwanijk requested review from a team and Copilot July 10, 2025 05:24
@manzoorwanijk manzoorwanijk self-assigned this Jul 10, 2025
@manzoorwanijk manzoorwanijk added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Team Review Obsolete. Use Needs Review instead. labels Jul 10, 2025
Copilot

This comment was marked as outdated.

Copy link
Contributor

github-actions bot commented Jul 10, 2025

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 fix/my-jetpack/multisite-access branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/my-jetpack/multisite-access

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] Starter Plugin [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. labels Jul 10, 2025
Copy link
Contributor

github-actions bot commented Jul 10, 2025

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 a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ 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:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: August 5, 2025
    • Code freeze: August 4, 2025

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


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


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


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


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


Starter Plugin 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.


Protect plugin:

  • Next scheduled release: September 1, 2025

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


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

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Enables the My Jetpack interface on WordPress Multisite and updates changelogs across plugins and packages.

  • Remove the multisite guard in should_initialize() so My Jetpack loads on multisite sites
  • Add consistent changelog entries in all affected plugins and the my-jetpack package
  • Note: one plugin (jetpack) uses Type: enhancement while others use Type: changed

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
projects/plugins/videopress/changelog/fix-my-jetpack-multisite-access Add changelog entry enabling My Jetpack on multisite
projects/plugins/starter-plugin/changelog/fix-my-jetpack-multisite-access Add changelog entry enabling My Jetpack on multisite
projects/plugins/social/changelog/fix-my-jetpack-multisite-access Add changelog entry enabling My Jetpack on multisite
projects/plugins/search/changelog/fix-my-jetpack-multisite-access Add changelog entry enabling My Jetpack on multisite
projects/plugins/protect/changelog/fix-my-jetpack-multisite-access Add changelog entry enabling My Jetpack on multisite
projects/plugins/jetpack/changelog/fix-my-jetpack-multisite-access Add changelog entry (Type: enhancement)
projects/plugins/boost/changelog/fix-my-jetpack-multisite-access Add changelog entry enabling My Jetpack on multisite
projects/plugins/backup/changelog/fix-my-jetpack-multisite-access Add changelog entry enabling My Jetpack on multisite
projects/packages/my-jetpack/src/class-initializer.php Remove is_multisite() guard in should_initialize()
projects/packages/my-jetpack/changelog/fix-my-jetpack-multisite-access Add changelog entry for multisite support
Comments suppressed due to low confidence (2)

projects/packages/my-jetpack/src/class-initializer.php:515

  • Consider adding unit or integration tests to cover the multisite scenario for should_initialize(), ensuring that My Jetpack initializes correctly on multisite installations.
	public static function should_initialize() {

projects/packages/my-jetpack/src/class-initializer.php:518

  • [nitpick] It may be helpful to document the removal of the multisite restriction here, explaining why My Jetpack now initializes on multisite contexts.
		// All options presented in My Jetpack require a connection to WordPress.com.

Copy link

jp-launch-control bot commented Jul 10, 2025

Code Coverage Summary

Coverage changed in 5 files.

File Coverage Δ% Δ Uncovered
projects/packages/my-jetpack/_inc/components/my-jetpack-tab-panel/products/utils.ts 0/20 (0.00%) 0.00% 4 💔
projects/packages/my-jetpack/_inc/components/my-jetpack-tab-panel/products/constants.ts 0/8 (0.00%) 0.00% 2 ❤️‍🩹
projects/packages/my-jetpack/_inc/components/modules-list/index.tsx 0/9 (0.00%) 0.00% 1 ❤️‍🩹
projects/packages/my-jetpack/_inc/components/my-jetpack-tab-panel/products/product-card.tsx 0/4 (0.00%) 0.00% 1 ❤️‍🩹
projects/packages/my-jetpack/src/class-initializer.php 54/298 (18.12%) -0.21% -1 💚

1 file is newly checked for coverage.

File Coverage
projects/packages/my-jetpack/_inc/components/modules-list/utils.ts 0/5 (0.00%) 💔

Full summary · PHP report · JS report

Coverage check overridden by Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR .

@manzoorwanijk manzoorwanijk added the Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR label Jul 10, 2025
@jeherve
Copy link
Member

jeherve commented Jul 11, 2025

Some extra references that may be helpful: #35555, #43012

Copy link
Contributor

@robertsreberski robertsreberski left a comment

Choose a reason for hiding this comment

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

I was able to activate all products and modules, no errors! thank you, it's a big milestone since we disabled it in 2022.

We should be sure to loop in our HEs (@StefMattana!) cause it will be a big change for our users, and we will need to update support docs.

Comment on lines 23 to 25
if ( ! isAvailable ) {
reason = __( 'Not available on multisite', 'jetpack-my-jetpack' );
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this function could be immutable, it might be easier to read and extend in the future

Copy link
Member Author

Choose a reason for hiding this comment

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

I am not sure I understand what you mean by that.

Copy link
Contributor

Choose a reason for hiding this comment

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

I meant that instead of using variables (let), we could just use early returns that will make it clearer (in my opinion) of what is actually the output of the function in every code path.

Copy link

That's great @robertsreberski, thanks for the heads up!
I created a doc request for it: JPHDOC-190

I didn't set an ETA in the Doc Linear request above; I'll follow closely but happy to get a ping from you when it's ready to be deployed in a new JP plugin update 🙂

Copy link
Contributor

@robertsreberski robertsreberski left a comment

Choose a reason for hiding this comment

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

A small remark about the code approach in functions. I do prefer to avoid using variables in js/ts when it's unnecessary

Comment on lines 23 to 25
if ( ! isAvailable ) {
reason = __( 'Not available on multisite', 'jetpack-my-jetpack' );
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I meant that instead of using variables (let), we could just use early returns that will make it clearer (in my opinion) of what is actually the output of the function in every code path.

@manzoorwanijk manzoorwanijk merged commit 5e01f51 into trunk Jul 16, 2025
104 of 105 checks passed
@manzoorwanijk manzoorwanijk deleted the fix/my-jetpack/multisite-access branch July 16, 2025 08:10
@github-actions github-actions bot removed the [Status] Needs Team Review Obsolete. Use Needs Review instead. label Jul 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR [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] Starter Plugin [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. [Tests] Includes Tests [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants