-
Notifications
You must be signed in to change notification settings - Fork 823
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
Conversation
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! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
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:
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. |
There was a problem hiding this 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
) usesType: enhancement
while others useType: 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.
Code Coverage SummaryCoverage changed in 5 files.
1 file is newly checked for coverage.
Full summary · PHP report · JS report Coverage check overridden by
Coverage tests to be added later
|
There was a problem hiding this 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.
projects/packages/my-jetpack/_inc/components/modules-list/utils.ts
Outdated
Show resolved
Hide resolved
if ( ! isAvailable ) { | ||
reason = __( 'Not available on multisite', 'jetpack-my-jetpack' ); | ||
} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
projects/packages/my-jetpack/_inc/components/my-jetpack-tab-panel/products/utils.ts
Show resolved
Hide resolved
That's great @robertsreberski, thanks for the heads up! |
There was a problem hiding this 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
if ( ! isAvailable ) { | ||
reason = __( 'Not available on multisite', 'jetpack-my-jetpack' ); | ||
} |
There was a problem hiding this comment.
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.
Currently, access to My Jetpack is disabled. See #23069.
Fixes MYJP-105, MYJP-222
Proposed changes:
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
Small screens
