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

SEO Tools: use new feature gating for WPcom sites #23685

Merged
merged 3 commits into from
Mar 31, 2022

Conversation

michaeldcain
Copy link
Member

@michaeldcain michaeldcain commented Mar 29, 2022

In #23189, we started using the new feature gating for WPcom sites in Jetpack_Plan::supports(). Given upcoming Dotcom pricing changes, this moves the feature gating for the SEO Tools to use Jetpack_Plan on WPcom sites.

See: pdgrnI-wV-p2#comment-1061

Changes proposed in this Pull Request:

  • use Jetpack_Plan::supports() instead of blog stickers for the SEO Tools gating
  • this shouldn't functionally change anything for existing users, just allow the Pro plan to access the tools

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

N/A

Testing instructions:

Jetpack sites:

  • Spin up a JN site using this branch.
  • Set up Jetpack and keep it on the Free plan
  • In Calypso, visit Tools > Marketing > Traffic
  • Verify that you can see the SEO sections without any gating
  • Verify that updating the Page Title Structure correctly saves the changes

Simple sites:

  • Apply D77860-code to your WP.com sandbox and sandbox the API
  • For a simple site with a Free plan:
  • In Calypso, visit Tools > Marketing > Traffic
  • Verify that the SEO tools are gated behind a plan upgrade
  • Add a Pro plan to the site via Store Admin and sandbox the simple site address
  • In Calypso, visit Tools > Marketing > Traffic
  • Verify that you can see the SEO sections without any gating
  • Verify that updating the Page Title Structure correctly saves the changes

Atomic sites:

  • Create a WoA dev blog with a Business plan (p9o2xV-1r2-p2).
  • Install Jetpack Beta, via the Plugins > Upload screen, and activate the branch of this PR.
  • In Calypso, visit Tools > Marketing > Traffic
  • Verify that you can see the SEO sections without any gating
  • Verify that updating the Page Title Structure correctly saves the changes
  • Create a WoA dev blog with a Pro Plan (via Store Admin).
  • Install Jetpack Beta and activate the branch of this PR.
  • In Calypso, visit Tools > Marketing > Traffic
  • Verify that you can see the SEO sections without any gating
  • Verify that updating the Page Title Structure correctly saves the changes

@github-actions github-actions bot added [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Feature] SEO Tools Tools for improving a site's search engine optimization. labels Mar 29, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Mar 29, 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.


Jetpack plugin:

  • Next scheduled release: April 5, 2022.
  • Scheduled code freeze: March 29, 2022.

@github-actions github-actions bot added the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Mar 29, 2022
Copy link
Contributor

@DavidRothstein DavidRothstein left a comment

Choose a reason for hiding this comment

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

I know this is still a draft, but I went ahead and left a drive-by review anyway. Looks good!

Also tracking this here: c/iUNrEVZP-tr

* @return bool True if SEO tools are enabled, false otherwise.
*/
public static function is_enabled_jetpack_seo( $site_id = 0 ) {
public static function is_enabled_jetpack_seo() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Technically I guess you could say this is an API change, but I confirmed nothing in WPCOM is calling it with a site ID passed in, and just in case something else out there is, it wouldn't actually change the behavior anyway (because the function always returns true for Jetpack).

So 👍 from me at least.

return has_any_blog_stickers( array( 'business-plan', 'ecommerce-plan' ), $site_id );
// For WPcom sites.
if ( defined( 'IS_WPCOM' ) && IS_WPCOM && method_exists( 'Jetpack_Plan', 'supports' ) ) {
return Jetpack_Plan::supports( 'advanced-seo' );
Copy link
Contributor

Choose a reason for hiding this comment

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

I checked the feature code and confirmed this looks like the correct one to call, and that it is supported for Pro/Business/eCommerce, which is exactly what we want.

@michaeldcain michaeldcain force-pushed the update/jetpack-seo-feature-gating branch from 6f72fed to 0740781 Compare March 30, 2022 16:17
@michaeldcain michaeldcain marked this pull request as ready for review March 30, 2022 16:18
@michaeldcain michaeldcain removed the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Mar 30, 2022
@github-actions github-actions bot added the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Mar 30, 2022
@michaeldcain michaeldcain 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 Mar 30, 2022
@DavidRothstein DavidRothstein added [Status] Needs Team Review and removed [Status] Needs Review To request a review from Crew. Label will be renamed soon. labels Mar 30, 2022
@DavidRothstein
Copy link
Contributor

This could maybe use a code comment adjustment (see my earlier comment) but is otherwise ready to go -- consider it approved. We can switch this back to the main "Needs Review" label once the tests pass (for the Jetpack Crew), I guess?

I've already tested this on WPCOM and am approving D77860-code now also (we should be able to deploy that before this one to get the bugfix out before the Pro plan is launched).

@michaeldcain michaeldcain force-pushed the update/jetpack-seo-feature-gating branch from 0740781 to 550b9c8 Compare March 30, 2022 19:56
@DavidRothstein
Copy link
Contributor

👍

@DavidRothstein DavidRothstein added [Status] Needs Review To request a review from Crew. Label will be renamed soon. and removed [Status] Needs Team Review labels Mar 30, 2022
Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

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

This tests well for me in Jetpack. 👍

@jeherve jeherve 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 Mar 31, 2022
@jeherve jeherve added this to the jetpack/10.9 milestone Mar 31, 2022
@michaeldcain michaeldcain merged commit 2f404d5 into master Mar 31, 2022
@michaeldcain michaeldcain deleted the update/jetpack-seo-feature-gating branch March 31, 2022 14:25
@github-actions github-actions bot removed the [Status] Ready to Merge Go ahead, you can push that green button! label Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] SEO Tools Tools for improving a site's search engine optimization. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants