Skip to content
Closed
Changes from 8 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
3f563a1
Media: Skip cross-origin isolation for third-party page builders.
adamsilverstein Mar 5, 2026
055c638
Merge branch 'trunk' into skip-page-builder-dip
adamsilverstein Mar 9, 2026
d8f3209
Merge branch 'trunk' into skip-page-builder-dip
adamsilverstein Mar 10, 2026
12e10a9
Merge branch 'trunk' into skip-page-builder-dip
adamsilverstein Mar 10, 2026
a65f438
Media: Disable client-side processing on non-secure origins
adamsilverstein Mar 10, 2026
1c74821
Media: Use multiline comment style per WP standards
adamsilverstein Mar 10, 2026
2f0421f
Media: Document page builder skip in docblock
adamsilverstein Mar 10, 2026
fb7caae
Merge branch 'trunk' into skip-page-builder-dip
adamsilverstein Mar 10, 2026
e7298c1
Media: Add tests for secure origin check
adamsilverstein Mar 10, 2026
85d6e62
Media: Remove phpcs nonce verification ignore
adamsilverstein Mar 10, 2026
a1e630e
Update src/wp-includes/media.php
adamsilverstein Mar 10, 2026
9ee5ac1
Use class property type hints and null coalescing operator
westonruter Mar 10, 2026
7af02dc
Update media.php
adamsilverstein Mar 10, 2026
ec1490c
Update media.php
adamsilverstein Mar 10, 2026
e26a9c3
Update media.php
adamsilverstein Mar 10, 2026
afacb9e
Update media.php
adamsilverstein Mar 10, 2026
77a504f
Merge branch 'trunk' into skip-page-builder-dip
adamsilverstein Mar 10, 2026
b122f7f
Fix sideload tests for non-secure contexts
adamsilverstein Mar 11, 2026
119efb6
Reinitialize REST server in sideload tests
adamsilverstein Mar 11, 2026
97d4a76
Merge branch 'trunk' into skip-page-builder-dip
adamsilverstein Mar 11, 2026
1ed4cdf
Merge branch 'trunk' into skip-page-builder-dip
adamsilverstein Mar 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions src/wp-includes/media.php
Original file line number Diff line number Diff line change
Expand Up @@ -6371,14 +6371,16 @@ function wp_get_image_editor_output_format( $filename, $mime_type ) {
* @return bool Whether client-side media processing is enabled.
*/
function wp_is_client_side_media_processing_enabled(): bool {
$enabled = ( is_ssl() || 'localhost' === $_SERVER['HTTP_HOST'] );
Comment thread
adamsilverstein marked this conversation as resolved.
Outdated
Comment thread
adamsilverstein marked this conversation as resolved.
Outdated

/**
* Filters whether client-side media processing is enabled.
*
* @since 7.0.0
*
* @param bool $enabled Whether client-side media processing is enabled. Default true.
* @param bool $enabled Whether client-side media processing is enabled. Default true if SSL or localhost.
Comment thread
adamsilverstein marked this conversation as resolved.
Outdated
*/
return (bool) apply_filters( 'wp_client_side_media_processing_enabled', true );
return (bool) apply_filters( 'wp_client_side_media_processing_enabled', $enabled );
}

/**
Expand Down Expand Up @@ -6437,6 +6439,10 @@ function wp_get_chromium_major_version(): ?int {
* media processing in the editor. Uses Document-Isolation-Policy
* on supported browsers (Chromium 137+).
*
* Skips setup when a third-party page builder overrides the block
* editor via a custom `action` query parameter, as DIP would block
* same-origin iframe access that these editors rely on.
*
* @since 7.0.0
*/
function wp_set_up_cross_origin_isolation(): void {
Expand All @@ -6454,6 +6460,16 @@ function wp_set_up_cross_origin_isolation(): void {
return;
}

/*
* Skip when a third-party page builder overrides the block editor.
* DIP isolates the document into its own agent cluster,
* which blocks same-origin iframe access that these editors rely on.
*/
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
Comment thread
adamsilverstein marked this conversation as resolved.
Outdated
if ( isset( $_GET['action'] ) && 'edit' !== $_GET['action'] ) {
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.

While implementing wp_set_up_cross_origin_isolation, was this issue discussed anywhere? If so, could you please share the reference links?

Discuss edge cases where action=edit is used but the block editor is replaced (e.g., Web Stories).

Also, do we have any research or data on how many plugins might be impacted by this?

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.

This is not an issue for Web Stories because it short-circuits here:

if ( ! $screen->is_block_editor() && 'site-editor' !== $screen->id && ! ( 'widgets' === $screen->id && wp_use_widgets_block_editor() ) ) {
return;
}

This is because it is filtering replace_editor in the same way that the latest Elementor is doing in elementor/elementor#34900.

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.

BTW, it also short-circuits here with the Classic Editor plugin.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

While implementing wp_set_up_cross_origin_isolation, was this issue discussed anywhere? If so, could you please share the reference links?

@mukeshpanchal27 -

the original pr included this fix, but it was removed because it was deemed unrelated (#11098 (comment)).

Both changes came out of bugs reports after the release of beta 1 - https://core.trac.wordpress.org/ticket/64740 there is more discussion there about why the fix for Elementor was added

return;
}

// Cross-origin isolation is not needed if users can't upload files anyway.
if ( ! current_user_can( 'upload_files' ) ) {
return;
Expand Down
Loading