Skip to content

Conversation

@rcrdortiz
Copy link
Contributor

@rcrdortiz rcrdortiz commented Nov 6, 2025

Fixes:

Proposed changes:

  • Updated the existing function that assigns users to a Global Styles experiment group so that we can handle Simple and Atomic users.
  • Implemented retained benefit logic for atomic users. Users who are part of the experiment under the treatment group will retain global styles on personal.
  • Implemented cleanup logic for atomic users. Once an atomic site is no longer on the personal plan, we clean up so the user loses the retained benefit.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

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

Testing instructions:

  • Create an atomic site (Business) and transfer to dev pool.
  • Using Jetpack beta, apply this branch.
  • Apply 195966-ghe-Automattic/wpcom to your sandbox.
  • Sandbox your API.
  • Use the Calypso live link from Global Styles on Personal: Update Calypso experiment key wp-calypso#107030 for testing Calypso related screens.
  • Apply this in mu-plugins/index.php (or any other file that gets loaded).
add_filter( 'wpcom_global_styles_experiment_cutoff_date', fn() => strtotime( '2000-01-01' ));
add_filter( 'wpcom_global_styles_experiment_cache', fn() => false );
add_filter( 'option_wpcom-global-styles-personal-plan', fn() => false );
  • Go to the experiment page 22374-explat-experiment and assign yourself to either group (you will need to switch groups later)
  • Check that you aren't prompted to upgrade to use global styles on the Theme Showcase, Site Editor, and on the front-end (apply a style variation).
  • On SA, add a Personal plan to your site and remove the Business plan.
  • If you're on Treatment, you should not see any Global Style upgrade messages.
  • On Control, you should see the messages.
  • Switch to a Premium plan and check for regressions.

@rcrdortiz rcrdortiz changed the title Global Styles on Personal: Atomic experiment group WIP => Global Styles on Personal: Atomic experiment group Nov 6, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (WordPress.com Site Helper), and enable the dotcom-14917-global-styles-on-personal-bridge-explat-and-the-gating-logic branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack-mu-wpcom-plugin dotcom-14917-global-styles-on-personal-bridge-explat-and-the-gating-logic

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

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.
  • 🔴 Add a "[Status]" label (In Progress, Needs Review, ...).
  • 🔴 Add a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ 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 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@github-actions github-actions bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Nov 6, 2025
@jp-launch-control
Copy link

jp-launch-control bot commented Nov 6, 2025

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/jetpack-mu-wpcom/src/features/wpcom-global-styles/index.php 22/412 (5.34%) -0.53% 37 💔

Full summary · PHP report

Coverage check overridden by I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. .

@rcrdortiz rcrdortiz self-assigned this Nov 10, 2025
@rcrdortiz rcrdortiz requested a review from a team November 10, 2025 16:52
@rcrdortiz rcrdortiz changed the title WIP => Global Styles on Personal: Atomic experiment group Global Styles on Personal: Atomic experiment group Nov 11, 2025
@rcrdortiz rcrdortiz added the I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. label Nov 11, 2025
xavier-lc
xavier-lc previously approved these changes Nov 11, 2025
Copy link
Contributor

@xavier-lc xavier-lc left a comment

Choose a reason for hiding this comment

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

Works as a charm 👌

@escapemanuele
Copy link
Contributor

escapemanuele commented Nov 11, 2025

@mmtr @rcrdortiz I know it is not the best, but instead of replicating the Explat code, could we do something like:

$explat_controller = new ExPlat_REST_Controller();
$request           = new WP_REST_Request( 'GET', '/jetpack/v4/explat/assignments' );
$request->set_param( 'experiment_name', $experiment_key );
$request->set_param( 'anon_id', (string) get_current_user_id() );
$request->set_param( 'as_connected_user', true );

$assignment_response = $explat_controller->get_assignments( $request );

Probably even better to extract it to a lib. It is nice to not have to hardcode EXPLAT_API_VERSION in the API URL, like in the RDV experiment.

I'm just looking at setting up an experiment in Atomic and so I'm exploring how this works.

@rcrdortiz rcrdortiz requested a review from mmtr November 13, 2025 11:00
@rcrdortiz
Copy link
Contributor Author

I assigned myself to treatment and, when creating a new site, I see that GS is not part of the Personal plan. Is that expected?

Screenshot 2025-11-13 at 12 18 24

After changing your assignment, make sure to wait some time. On that screen, TanStack query caches the api call for some time.

mmtr
mmtr previously approved these changes Nov 13, 2025
Copy link
Member

@mmtr mmtr left a comment

Choose a reason for hiding this comment

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

Tests great for me!

@rcrdortiz rcrdortiz merged commit 9aabf45 into trunk Nov 13, 2025
66 checks passed
@rcrdortiz rcrdortiz deleted the dotcom-14917-global-styles-on-personal-bridge-explat-and-the-gating-logic branch November 13, 2025 19:02
@github-actions github-actions bot removed the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. [mu wpcom Feature] Wpcom Global Styles [Package] Jetpack mu wpcom WordPress.com Features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants