-
Notifications
You must be signed in to change notification settings - Fork 851
Modules: Make activate() method Jetpack-the-plugin agnostic #24385
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
|
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 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. |
kangzj
left a comment
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.
Hi @dereksmart, thanks for fixing this! Really appreciate it - this would save us hours if not days exploring! 👍
It works as described. I left a question but which doesn't seem a blocker to me 💯
| } | ||
| // Not available for offline mode. | ||
| $is_offline_mode = ( new Status() )->is_offline_mode(); | ||
| if ( $is_offline_mode ) { |
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'm wondering how Search plugin would claim it needs connection by using the Modules class?
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.
This doesn't seems to matter a lot for standalone plugins tho, since if site is not connected, the search dashboard wouldn't be shown anyway.
|
Hey @dereksmart any plan to merge this? I do think better to have more people testing it before merging. Hey @Automattic/jetpack-search peeps, if you have some time, would you mind spinning of this PR? |
|
hey @kangzj sorry I was waiting some to see if it'd help Social plugin with their issue. It doesn't really, but it does get it a bit closer as they were hitting the file checks anyway. I'll clean it up tomorrow and get more testing so we can merge and can work on the rest in follow-ups. Started a branch in add/debug-helper-modules and hoping to provide some easier ways to debug these modules via the debug plugin. |
|
Thanks for your kind reply. This doesn't block Search anyway, take your time 💯 |
leogermani
left a comment
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've tested in different scenarios... tested integrating it with My Jetpack and also tested for regressions within the Jetpack plugin and it looks good to me
It's an ugly refactor, stuffs Jetpack-specific logic into a class_exists check. However it allows standalone plugins to use the Modules()->activate() method.
Changes proposed in this Pull Request:
Modules()->activate()to execute Jetpack-specific logic only when Jetpack is present.Jetpack product discussion
Does this pull request change what data or activity we track or use?
No
Testing instructions:
Make sure that activating the modules from Jetpack also works: