Skip to content

Use remote feature flag from Site Kit#22548

Merged
leonidasmi merged 2 commits intotrunkfrom
766-enable-the-site-kit-feature-flag-when-site-kit-is-active-alt
Sep 9, 2025
Merged

Use remote feature flag from Site Kit#22548
leonidasmi merged 2 commits intotrunkfrom
766-enable-the-site-kit-feature-flag-when-site-kit-is-active-alt

Conversation

@leonidasmi
Copy link
Copy Markdown
Contributor

@leonidasmi leonidasmi commented Sep 3, 2025

Context

  • The implementation adheres to what has been talked about here.

Summary

This PR can be summarized in the following changelog entry:

  • Allows Site Kit to control the Site Kit feature flag remotely.

Relevant technical choices:

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Since we don't have a way to use Site Kit's services related to remote feature flag, we will edit the relevant DB option to do the same thing. We could have waited to get the test plugin (mentioned here) from Site Kit, but for velocity purposes, we'll do the below until we get it.
  • Make sure you don't have the Site Kit integration's feature flag enabled - go to the Yoast dashboard and confirm you see nothing Site Kit related there.
  • Search in your DB for the googlesitekitpersistent_remote_features option
    • If there's no such option, add it with the a:2:{s:16:"yoastIntegration";a:1:{s:7:"enabled";b:1;}s:15:"last_updated_at";i:1756890270;} value
    • If there's such an option, copy its value, add the yoastIntegration array in the existing value. You can do so like this:
      • Use unserialize.com to unserialize the value, using the var_export setting and copy the results somewhere.
      • Go to onlinephp.io/serialize and paste the unserialized value, but before serializing it again, add the 'yoastIntegration' => array ( 'enabled' => true, ), sub-array before the 'last_updated_at' => 1756890270, pair
      • Serialize the new value and update the googlesitekitpersistent_remote_features option with that
  • Our DB edit essentially mimics how the Site Kit services will enable our integration remotely
  • Refresh the Yoast Dashboard and confirm that the Site Kit integration is now active.
  • Use the modified Test helper to enable our own feature flag too and refresh the Yoast dashboard
  • Confirm you again see the Site Kit integration.
  • If your DB didnt have the googlesitekitpersistent_remote_features option before your edits, delete it again
  • If your DB did have the googlesitekitpersistent_remote_features option before your edits, paste the old value again
  • In both cases, confirm that the Site Kit integration in Yoast Dashboard is still visible.
  • Now use the Test Helper again to disable our own feature flag too
  • Now confirm that the Site Kit integration in Yoast Dashboard is now invisible

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes #

@leonidasmi leonidasmi added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Sep 3, 2025
@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 020e4381c4d923fe7b188689fb38b0acbae8ce2a

Details

  • 0 of 1 (0.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 52.8%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/conditionals/google-site-kit-feature-conditional.php 0 1 0.0%
Totals Coverage Status
Change from base Build bf02b89ced6378a600f87d552675cd892529b92e: 0.0%
Covered Lines: 31213
Relevant Lines: 59228

💛 - Coveralls

@leonidasmi leonidasmi marked this pull request as ready for review September 4, 2025 05:35
Copy link
Copy Markdown
Contributor

@thijsoo thijsoo left a comment

Choose a reason for hiding this comment

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

CR + ACC 👍

@thijsoo thijsoo added this to the 26.0 milestone Sep 4, 2025
@leonidasmi leonidasmi merged commit 85a0f13 into trunk Sep 9, 2025
30 checks passed
@leonidasmi leonidasmi deleted the 766-enable-the-site-kit-feature-flag-when-site-kit-is-active-alt branch September 9, 2025 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants