Skip to content

Jetpack Script Data: Cleanup unused host data and functionality, keeping data close to source #44133

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

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from

Conversation

coder-karen
Copy link
Contributor

@coder-karen coder-karen commented Jun 30, 2025

Fixes VULCAN-212

Proposed changes:

  • This PR is the final cleanup PR as part of a mini-project - VULCAN-115 - to audit and simplify host checks within Jetpack and related packages / plugins.
  • In this PR, now-redundant functions and data are removed.
  • While the intention was originally to remove any reliance on the Status package from within the Assets package, the number of interdependencies on that data is quite large now after Scripts: Switch Shared Extension Utils hosting check usage to Jetpack Script Data #43972, and the complexities of adding the data via the relevant filter everywhere needed, would outweigh having Status as a package dependency of Assets.
  • Instead then, the 'host' data that had been added independently via the Publicize and Connection packages, and hooked into the Assets package using jetpack_admin_js_script_data, is now added to Assets directly (given that it exists for the public script now as well - so this is also more consistent).

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

VULCAN-115

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

No.

Testing instructions:

Code review - the removed functions were not in use, a code check within the monorepo should confirm that.

In terms of the host data moved into the Assets package, follow the testing instructions in the following PR (where related to differences between WoA / Simple / self-hosted sites):

  • Social: Unified connections management #40679
  • Alternatively, to testing the above PR (as it is quite broad and unclear), if the Jetpack plugin is deactivated on a site and Social is active with this branch checked out (so on self-hosted only), confirm via the browser console in a post editor that the window JetpackScriptData object has a site property, which has a host property (on Jurassic Ninja that will be 'atomic'). You may need to 'Get Started' from the Jetpack Social dashboard page too - and should be able to confirm the script data is present on that dashboard too. This script information should be showing generally on a WoA, and Simple site as well.

Also, follow the testing instructions in this PR to ensure the WoA functionality works as expected:

Copy link
Contributor

github-actions bot commented Jun 30, 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 (Jetpack or WordPress.com Site Helper), and enable the update/jetpack-script-data-remove-host-status branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/jetpack-script-data-remove-host-status
bin/jetpack-downloader test jetpack-mu-wpcom-plugin update/jetpack-script-data-remove-host-status

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 github-actions bot added [Feature] Publicize Now Jetpack Social, auto-sharing [JS Package] Script Data [Package] Assets [Package] Connection [Package] Publicize [Plugin] Automattic For Agencies Client [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Classic Theme Helper Plugin [Plugin] CRM Issues about the Jetpack CRM plugin [Plugin] Inspect [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] mu wpcom jetpack-mu-wpcom plugin [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Starter Plugin [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. [Plugin] Wpcomsh RNA labels Jun 30, 2025
Copy link
Contributor

github-actions bot commented Jun 30, 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!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: August 5, 2025
    • Code freeze: August 4, 2025

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Mu Wpcom plugin:

  • Next scheduled release: WordPress.com Simple releases happen semi-continuously (PCYsg-Jjm-p2)

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

Copy link

jp-launch-control bot commented Jun 30, 2025

Code Coverage Summary

Coverage changed in 6 files. Only the first 5 are listed here.

File Coverage Δ% Δ Uncovered
projects/packages/assets/src/class-script-data.php 0/74 (0.00%) 0.00% 1 ❤️‍🩹
projects/plugins/jetpack/_inc/lib/admin-pages/class-jetpack-redux-state-helper.php 156/267 (58.43%) -0.61% 0 💚
projects/packages/connection/src/class-initial-state.php 15/18 (83.33%) 7.14% -2 💚
projects/packages/publicize/src/class-publicize-script-data.php 0/117 (0.00%) 0.00% -2 💚
projects/plugins/jetpack/_inc/client/state/initial-state/reducer.js 58/117 (49.57%) 1.24% -3 💚

Full summary · PHP report · JS report

@coder-karen coder-karen removed [Package] Connection [Plugin] Automattic For Agencies Client [Plugin] Inspect [Plugin] CRM Issues about the Jetpack CRM plugin [Plugin] Classic Theme Helper Plugin [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. [Plugin] Wpcomsh [Plugin] Starter Plugin [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin labels Jun 30, 2025
@coder-karen coder-karen force-pushed the update/jetpack-script-data-remove-host-status branch 2 times, most recently from fae9b7b to 17de626 Compare July 2, 2025 12:29
@github-actions github-actions bot added [JS Package] Shared Extension Utils [Package] Connection Admin Page React-powered dashboard under the Jetpack menu labels Jul 2, 2025
@coder-karen coder-karen changed the title Jetpack Script Data: Ensure host data is added closer to where the data is needed. Jetpack Script Data: Cleanup unused host data and functionality, keeping data close to source Jul 2, 2025
@coder-karen coder-karen force-pushed the update/jetpack-script-data-remove-host-status branch from 3474715 to 6b5994b Compare July 2, 2025 13:39
@coder-karen coder-karen marked this pull request as ready for review July 2, 2025 13:39
@coder-karen coder-karen added [Status] Needs Review This PR is ready for review. and removed [Status] In Progress labels Jul 2, 2025
@coder-karen coder-karen requested a review from a team July 2, 2025 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Admin Page React-powered dashboard under the Jetpack menu [Feature] Publicize Now Jetpack Social, auto-sharing [Feature] Theme Tools [JS Package] Script Data [JS Package] Shared Extension Utils [Package] Assets [Package] Connection [Package] Publicize [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] mu wpcom jetpack-mu-wpcom plugin RNA [Status] Needs Review This PR is ready for review. [Type] Janitorial
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant