From ee87603cd9df3427bf5ec356d6583cc6bb4b4e18 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Fri, 20 Feb 2026 12:55:49 +1100 Subject: [PATCH 1/3] Client-side media processing: Disable in Gutenberg just for now --- lib/compat/plugin/media.php | 16 ++++++++++++++ lib/load.php | 3 +++ phpunit/bootstrap.php | 5 +++++ phpunit/media/media-processing-test.php | 29 +++++++++++++++---------- 4 files changed, 42 insertions(+), 11 deletions(-) create mode 100644 lib/compat/plugin/media.php diff --git a/lib/compat/plugin/media.php b/lib/compat/plugin/media.php new file mode 100644 index 00000000000000..9f7711c788589b --- /dev/null +++ b/lib/compat/plugin/media.php @@ -0,0 +1,16 @@ +assertTrue( gutenberg_is_client_side_media_processing_enabled() ); + public function test_client_side_media_processing_disabled_by_default_in_plugin() { + // Remove the test bootstrap override to check the plugin's actual default. + remove_filter( 'wp_client_side_media_processing_enabled', '__return_true', 20 ); + $enabled = gutenberg_is_client_side_media_processing_enabled(); + // Restore the test bootstrap override. + add_filter( 'wp_client_side_media_processing_enabled', '__return_true', 20 ); + + $this->assertFalse( $enabled ); } /** - * Tests that client-side media processing can be disabled via filter. + * Tests that client-side media processing can be enabled via filter. * * @covers ::gutenberg_is_client_side_media_processing_enabled */ - public function test_client_side_media_processing_can_be_disabled() { - add_filter( 'wp_client_side_media_processing_enabled', '__return_false' ); - $enabled = gutenberg_is_client_side_media_processing_enabled(); - remove_filter( 'wp_client_side_media_processing_enabled', '__return_false' ); - - $this->assertFalse( $enabled ); + public function test_client_side_media_processing_can_be_enabled() { + $this->assertTrue( gutenberg_is_client_side_media_processing_enabled() ); } /** @@ -242,11 +248,12 @@ public function test_compat_rest_controller_used_when_filter_disabled() { } /** - * Tests that the 6.9 compat REST controller is not used when filter is enabled (default). + * Tests that the 6.9 compat REST controller is not used when filter is enabled. * * @covers ::gutenberg_override_attachments_rest_controller */ public function test_compat_rest_controller_not_used_when_filter_enabled() { + // Feature is enabled via test bootstrap filter at priority 20. $result = gutenberg_override_attachments_rest_controller( array(), 'attachment' ); $this->assertSame( array(), $result ); From 48b8392b637a2b576b28adc14a3bf10be11f1bc9 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Fri, 20 Feb 2026 13:14:50 +1100 Subject: [PATCH 2/3] Try to fix failing test --- phpunit/media/media-processing-test.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/phpunit/media/media-processing-test.php b/phpunit/media/media-processing-test.php index 43d7d88278811e..e8b2afbcdf16c0 100644 --- a/phpunit/media/media-processing-test.php +++ b/phpunit/media/media-processing-test.php @@ -235,11 +235,14 @@ public function test_client_side_media_processing_can_be_enabled() { * @covers ::gutenberg_override_attachments_rest_controller */ public function test_compat_rest_controller_used_when_filter_disabled() { + // Remove the test bootstrap override so the disable filter takes effect. + remove_filter( 'wp_client_side_media_processing_enabled', '__return_true', 20 ); add_filter( 'wp_client_side_media_processing_enabled', '__return_false' ); $result = gutenberg_override_attachments_rest_controller( array(), 'attachment' ); remove_filter( 'wp_client_side_media_processing_enabled', '__return_false' ); + add_filter( 'wp_client_side_media_processing_enabled', '__return_true', 20 ); $this->assertSame( array( 'rest_controller_class' => 'Gutenberg_REST_Attachments_Controller_6_9' ), From dea0272a4bf5fd4e9e2ec3fd9217fe9cdcaad812 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Fri, 20 Feb 2026 13:35:44 +1100 Subject: [PATCH 3/3] Update docblock --- lib/compat/plugin/media.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/compat/plugin/media.php b/lib/compat/plugin/media.php index 9f7711c788589b..eafd8b054aea32 100644 --- a/lib/compat/plugin/media.php +++ b/lib/compat/plugin/media.php @@ -6,6 +6,9 @@ * It is disabled by default in the plugin until known issues are resolved, * but can still be enabled via the filter. * + * Remove this file when the linked issues are resolved and the plugin + * is ready to match Core's default. + * * @see https://github.com/WordPress/gutenberg/issues/75302 * @see https://github.com/WordPress/gutenberg/issues/75605 *