-
Notifications
You must be signed in to change notification settings - Fork 812
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
Performance: avoid unnecessary hosting provider detection when possible. #41890
Conversation
In a lot of situations, we are not interested in knowing the exact hosting provider ; we just want to know if the site is on the WordPress.com platform (and if so, which one).
We do not need to know exactly what host we're with. It's enough to know it's a WordPress.com platform. See #41076 where this was set up.
We only need to check for specific WordPress.com platforms here (WoA or Atomic), so we can ditch the generic host detection and only look for those 2. This was added in #39155.
This was added in #34864, but never actually used. We can consequently remove it.
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 🤖 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. Follow this PR Review Process:
Still unsure? Reach out in #jetpack-developers for guidance! Boost plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCoverage changed in 2 files.
Full summary · PHP report · JS report Coverage check overridden by
I don't care about code coverage for this PR
|
cc'ing @oskosk since we talked about this on Friday. |
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.
Thank you for this. Works fine.
I wanted to make such a change when that NON_SELF_HOSTED_TYPES
was added but I wasn't sure whether unknown
is equal to being a Jetpack site.
…le. (#41890) * Status: add parameter to bring more specificity to host detection In a lot of situations, we are not interested in knowing the exact hosting provider ; we just want to know if the site is on the WordPress.com platform (and if so, which one). * Script data: provide less specific host info for Jetpack Social We do not need to know exactly what host we're with. It's enough to know it's a WordPress.com platform. See #41076 where this was set up. * Boost: be more specific in hosting provider check. We only need to check for specific WordPress.com platforms here (WoA or Atomic), so we can ditch the generic host detection and only look for those 2. This was added in #39155. * My Jetpack: remove unused parameter. This was added in #34864, but never actually used. We can consequently remove it. * Update Phan baseline
Proposed changes:
This PR brings in a number of changes to improve performance around host detection in our plugins (plugins using My Jetpack, Boost, Social). In general, this starts from a simple premise: in many situations in our codebase, we do not need to know the specific hosting provider on a given site ; we really only want to know that the site is hosted on a specific WordPress.com platform.
All this will also have a nice side-effect ; we will no longer see an error when installing Jetpack on a site built with Studio / Playground. See https://github.com/Automattic/dotcom-forge/issues/10427 for more info.
Note
I added the " I don't care about code coverage for this PR" to this PR since I'm making changes to an existing file that has no tests so far. I would have added some, but it seems there are no tests for the whole Boost app/admin page right now.
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
Note
This needs to be tested on 3 different plugins, installed separately: Jetpack, Boost, and Social.
Jetpack (My Jetpack)
Boost
Social
https://jetpack.com/redirect/?source=wpcom-contact-support
https://jetpack.com/redirect/?source=jetpack-contact-support