Skip to content
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

My Jetpack: Add filter for avoiding initalization #22553

Merged
merged 7 commits into from
Feb 1, 2022

Conversation

oskosk
Copy link
Contributor

@oskosk oskosk commented Jan 28, 2022

Introduces a method should_initialize on the initializer with jetpack_my_jetpack_should_initialize filter.

Changes proposed in this Pull Request:

  • Introduces a method should_initialize on the initializer..
  • Adds a WordPress filter jetpack_my_jetpack_should_initialize for avoiding initalization

For Rationale, see the request for comments on this P2 p1HpG7-eqp-p2

Jetpack product discussion

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

No

Testing instructions:

  • On a new site, or old one and disconnect Jetpack
  • Verify that the My Jetpack menu is not present
  • Connect site at a site level only (Via the Jetpack plugin). Disconnect
  • Verify that the My Jetpack menu appears
  • Connect a user
  • Verify that the My Jetpack menu appears
  • Unset the constant JETPACK_ENABLE_MY_JETPACK and confirm the menu disappears. Set it back.
  • Add some snippet somewhere with add_filter( 'jetpack_my_jetpack_should_initialize', '__return_false') and confirm My Jetpack does not load.

@oskosk oskosk added this to the My Jetpack MVP milestone Jan 28, 2022
@oskosk oskosk added the [Status] Needs Review To request a review from Crew. Label will be renamed soon. label Jan 28, 2022
@oskosk oskosk requested a review from a team January 28, 2022 19:46
@github-actions
Copy link
Contributor

github-actions bot commented Jan 28, 2022

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.
  • ⚠️ All commits were linted before commit.
  • ✅ Add a "[Status]" label (In Progress, Needs Team 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 🤖


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.
Then, add the "[Status] Needs Team review" label and ask someone from your team review the code.
Once you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.

@oskosk oskosk changed the title My Jetpack: Update the way we check if My jetpack should be loaded My Jetpack: Add filter for avoiding initalization Jan 28, 2022
@oskosk oskosk force-pushed the update/should-init-mechanism-my-jetpack branch from c928a62 to 3258dc3 Compare January 29, 2022 13:01
@retrofox retrofox added [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! and removed [Status] Needs Review To request a review from Crew. Label will be renamed soon. labels Jan 31, 2022
@oskosk oskosk dismissed dereksmart’s stale review January 31, 2022 22:39

Feedback addressed

@oskosk oskosk added [Status] Needs Review To request a review from Crew. Label will be renamed soon. and removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! labels Jan 31, 2022
Copy link
Contributor

@retrofox retrofox left a comment

Choose a reason for hiding this comment

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

LGTM

@retrofox retrofox added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from Crew. Label will be renamed soon. labels Feb 1, 2022
@oskosk oskosk enabled auto-merge (squash) February 1, 2022 16:27
@oskosk oskosk merged commit ab2c107 into master Feb 1, 2022
@oskosk oskosk deleted the update/should-init-mechanism-my-jetpack branch February 1, 2022 16:38
@github-actions github-actions bot removed the [Status] Ready to Merge Go ahead, you can push that green button! label Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants