Skip to content

Gate client-side media processing as plugin-only#76700

Merged
ellatrix merged 1 commit intotrunkfrom
csm-plugin-only
Mar 20, 2026
Merged

Gate client-side media processing as plugin-only#76700
ellatrix merged 1 commit intotrunkfrom
csm-plugin-only

Conversation

@adamsilverstein
Copy link
Copy Markdown
Member

@adamsilverstein adamsilverstein commented Mar 19, 2026

Summary

  • Gates the client-side media processing (wasm-vips) feature behind IS_GUTENBERG_PLUGIN so it only loads when running as the Gutenberg plugin
  • The vips WASM worker adds ~16MB to the build output, which is too much overhead for WordPress core at this stage
  • The feature continues to work fully in the Gutenberg plugin but will be excluded when syncing to core
  • Companion core PR: Remove client-side media processing feature wordpress-develop#11309

Changes

  • lib/media/load.php: Early return when IS_GUTENBERG_PLUGIN is not defined, preventing all client-side media processing infrastructure (cross-origin isolation, JS flags, REST API modifications) from loading outside the plugin
  • lib/client-assets.php: Gate the gutenberg_enqueue_vips_loader action hook behind IS_GUTENBERG_PLUGIN, preventing the vips script module from being enqueued outside the plugin

Test plan

  • Activate Gutenberg plugin on a local site with HTTPS, upload an image in the block editor — client-side media processing should still work
  • Deactivate Gutenberg plugin, upload an image — standard server-side processing works normally
  • Verify gutenberg_is_client_side_media_processing_enabled() still returns true in plugin context on secure origins

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 19, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: adamsilverstein <adamsilverstein@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: ellatrix <ellatrix@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@adamsilverstein adamsilverstein self-assigned this Mar 19, 2026
@adamsilverstein adamsilverstein added [Type] Bug An existing feature does not function as intended [Status] In Progress Tracking issues with work in progress [Feature] Client Side Media Media processing in the browser with WASM No Core Sync Required Indicates that any changes do not need to be synced to WordPress Core labels Mar 19, 2026

// Client-side media processing is currently plugin-only while the feature matures.
if ( ! defined( 'IS_GUTENBERG_PLUGIN' ) || ! IS_GUTENBERG_PLUGIN ) {
return;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for prepping this PR!

Just checking, I set define( 'IS_GUTENBERG_PLUGIN', false ); and it does stop here. 👍🏻

But I noticed that window.__clientSideMediaProcessing is still true and worker.js loads when I upload an image. Is that expected?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How did you test this? Is that because the core patch hasn't landed yet?

Client-side media processing (wasm-vips) adds ~16MB of
WASM to the build. Gate the feature behind IS_GUTENBERG_PLUGIN
so it remains active in the plugin but is excluded when
syncing to WordPress core, reducing core bundle size.
@ellatrix ellatrix added the Backport to WP 7.0 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Mar 20, 2026
@ellatrix
Copy link
Copy Markdown
Member

I rebased to restart the tests. The 26 failures were the same as the ones earlier in trunk. I'm going to force a merge since there is time pressure for Beta 6. We can double check the tests during the code freeze.

@ellatrix ellatrix merged commit d259aab into trunk Mar 20, 2026
44 checks passed
@ellatrix ellatrix deleted the csm-plugin-only branch March 20, 2026 13:33
@github-actions github-actions bot added this to the Gutenberg 22.9 milestone Mar 20, 2026
@github-actions github-actions bot removed the Backport to WP 7.0 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Mar 20, 2026
gutenbergplugin pushed a commit that referenced this pull request Mar 20, 2026
Client-side media processing (wasm-vips) adds ~16MB of
WASM to the build. Gate the feature behind IS_GUTENBERG_PLUGIN
so it remains active in the plugin but is excluded when
syncing to WordPress core, reducing core bundle size.

Co-authored-by: adamsilverstein <adamsilverstein@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: ellatrix <ellatrix@git.wordpress.org>
@github-actions github-actions bot added the Backported to WP Core Pull request that has been successfully merged into WP Core label Mar 20, 2026
@github-actions
Copy link
Copy Markdown

I just cherry-picked this PR to the wp/7.0 branch to get it included in the next release: 2ee7ede

@github-actions
Copy link
Copy Markdown

Flaky tests detected in 675f005.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/23344982432
📝 Reported issues:

pento pushed a commit to WordPress/wordpress-develop that referenced this pull request Mar 20, 2026
This updates the pinned hash from the `gutenberg` from `487a096a9782ba6110a7686d7b4b2d0c55ed1b06` to `2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d`.

The following changes are included:

- RTC: Backport race condition fix (WordPress/gutenberg#76649)
- Fix navigation block rendering unit test (WordPress/gutenberg#76685)
- Hide Additional CSS controls when block is inside contentOnly editing mode (WordPress/gutenberg#76512)
- RTC: Increase polling intervals, increase polling on primary room only (WordPress/gutenberg#76704)
- Navigation: Avoid List View changing position when navigation block saves (WordPress/gutenberg#76659)
- Fix navigation block unit test and e2e test (WordPress/gutenberg#76692)
- Fix locked content when switching to a different template without exiting 'Edit pattern' (WordPress/gutenberg#76710)
- Metabox: Fix checkbox style in sidebar (WordPress/gutenberg#76718)
- Stop keeping stale controlled blocks after reset (WordPress/gutenberg#76591)
- Gate client-side media processing as plugin-only (WordPress/gutenberg#76700)

A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/487a096a9782ba6110a7686d7b4b2d0c55ed1b06…2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d.

Log created with:

git log --reverse --format="- %s" 487a096a9782ba6110a7686d7b4b2d0c55ed1b06..2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy

See #64595.

git-svn-id: https://develop.svn.wordpress.org/trunk@62076 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Mar 20, 2026
This updates the pinned hash from the `gutenberg` from `487a096a9782ba6110a7686d7b4b2d0c55ed1b06` to `2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d`.

The following changes are included:

- RTC: Backport race condition fix (WordPress/gutenberg#76649)
- Fix navigation block rendering unit test (WordPress/gutenberg#76685)
- Hide Additional CSS controls when block is inside contentOnly editing mode (WordPress/gutenberg#76512)
- RTC: Increase polling intervals, increase polling on primary room only (WordPress/gutenberg#76704)
- Navigation: Avoid List View changing position when navigation block saves (WordPress/gutenberg#76659)
- Fix navigation block unit test and e2e test (WordPress/gutenberg#76692)
- Fix locked content when switching to a different template without exiting 'Edit pattern' (WordPress/gutenberg#76710)
- Metabox: Fix checkbox style in sidebar (WordPress/gutenberg#76718)
- Stop keeping stale controlled blocks after reset (WordPress/gutenberg#76591)
- Gate client-side media processing as plugin-only (WordPress/gutenberg#76700)

A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/487a096a9782ba6110a7686d7b4b2d0c55ed1b06…2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d.

Log created with:

git log --reverse --format="- %s" 487a096a9782ba6110a7686d7b4b2d0c55ed1b06..2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy

See #64595.
Built from https://develop.svn.wordpress.org/trunk@62076


git-svn-id: http://core.svn.wordpress.org/trunk@61358 1a063a9b-81f0-0310-95a4-ce76da25c4cd
adamsilverstein added a commit that referenced this pull request Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backported to WP Core Pull request that has been successfully merged into WP Core [Feature] Client Side Media Media processing in the browser with WASM No Core Sync Required Indicates that any changes do not need to be synced to WordPress Core [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants