Skip to content

Image Studio: Enqueue assets on next_admin_init#47675

Open
t-wright wants to merge 2 commits intotrunkfrom
forno-250/image-studio-ciab-support
Open

Image Studio: Enqueue assets on next_admin_init#47675
t-wright wants to merge 2 commits intotrunkfrom
forno-250/image-studio-ciab-support

Conversation

@t-wright
Copy link
Copy Markdown
Contributor

@t-wright t-wright commented Mar 19, 2026

Part of FORNO-250

Proposed changes

  • Enqueue Image Studio assets on next_admin_init hook to support user in CIAB.
  • Introduce a jetpack_image_studio_available filter to enable consumers to disable Image Studio even if the conditions to enable it are met.

Other information

  • Generate changelog entries for this PR (using AI).

Related product discussion/links

  • FORNO-250

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

No

Testing instructions

Check for regression:

  • bin/jetpack-downloader test jetpack forno-250/image-studio-ciab-support on your sandbox
  • Sandbox a simple site without Big Sky enabled
  • Verify Image Studio is enabled
  • Install Jetpack Beta plugin on an atomic site and select this branch
  • Verify Image Studio is enabled

CIAB integration:

  • Follow testing steps in ciab-admin PR 3814

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 19, 2026

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), and enable the forno-250/image-studio-ciab-support branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack forno-250/image-studio-ciab-support

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 [Extension] Image Studio [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] In Progress [Tests] Includes Tests labels Mar 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 19, 2026

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 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:

No scheduled milestone found for this plugin.

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

@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 Mar 19, 2026
@jp-launch-control
Copy link
Copy Markdown

jp-launch-control bot commented Mar 19, 2026

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/plugins/jetpack/extensions/plugins/image-studio/image-studio.php 144/157 (91.72%) -0.64% 1 ❤️‍🩹

Full summary · PHP report · JS report

@t-wright t-wright marked this pull request as ready for review March 19, 2026 10:21
@t-wright t-wright requested a review from kat3samsin March 19, 2026 10:21
kat3samsin
kat3samsin previously approved these changes Mar 19, 2026
Copy link
Copy Markdown
Contributor

@kat3samsin kat3samsin left a comment

Choose a reason for hiding this comment

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

Works on Atomic and ciab-admin.

kat3samsin
kat3samsin previously approved these changes Mar 20, 2026
@t-wright t-wright force-pushed the forno-250/image-studio-ciab-support branch from d2bf257 to 37f8777 Compare April 8, 2026 05:01
@t-wright t-wright requested review from kat3samsin and saroshaga April 8, 2026 07:44
}

// Signal to Big Sky that Jetpack is handling Image Studio, so it skips its own loading.
add_filter( 'jetpack_image_studio_enabled', '__return_true', 5 );
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Claude flagged this

Nit (non-blocking): The Big Sky signal filter is added before get_asset_data() is checked:

add_filter( 'jetpack_image_studio_enabled', '__return_true', 5 );`

$asset_data = get_asset_data();
if ( ! $asset_data ) {
    return; // Big Sky already told to skip, but Jetpack won't load either
}

If the asset manifest fetch fails (network error, missing file), Big Sky is signaled to stand down, but Jetpack's Image Studio won't actually enqueue — leaving the user with neither implementation.

I realize signal_image_studio_active() on init already has the same behavior (signals without verifying assets), so this isn't a new issue. But since you're already touching this function, would it be worth moving the add_filter to after the get_asset_data() check succeeds? That way the signal in do_enqueue_assets at least only fires when assets actually load. The init hook signal would still have the pre-existing gap, but this would be a small step toward correctness.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hmm I feel it is okay. The intention of setting this filter is to prevent the Big Sky version from loading. Being a legacy version of the Image Studio, I don't think the Big Sky version should act as a fallback. It should probably be removed from the Big Sky plugin once the Jetpack release has completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Extension] Image Studio [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants