From 4680f5c69666368ec68e8fd7dfdc992ff7ce9768 Mon Sep 17 00:00:00 2001 From: Sertii <36940685+Sreini@users.noreply.github.com> Date: Mon, 16 Feb 2026 07:34:38 +0100 Subject: [PATCH 1/4] release: 3.6.10 --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 565e7c67..aa6e9ea1 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://tinypng.com/ Tags: compress images, compression, image size, page speed, performance Requires at least: 4.0 Tested up to: 6.9 -Stable tag: 3.6.9 +Stable tag: 3.6.10 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html From 40b1c6cc2391464e0515980154f5feb886e57ec6 Mon Sep 17 00:00:00 2001 From: tijmen Date: Mon, 16 Feb 2026 10:57:38 +0100 Subject: [PATCH 2/4] fix: add tests for scenario --- test/unit/TinyPictureTest.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/unit/TinyPictureTest.php b/test/unit/TinyPictureTest.php index 79ee7fda..68ba2959 100644 --- a/test/unit/TinyPictureTest.php +++ b/test/unit/TinyPictureTest.php @@ -354,4 +354,28 @@ public function test_does_not_register_hooks_when_pagebuilder_request() $_GET = array(); } + + /** + * images that have no src or srcset will be unchanged + */ + public function test_image_without_src() { + $input = 'no source'; + $expected = 'no source'; + $output = $this->tiny_picture->replace_sources($input); + + $this->assertSame($expected, $output); + } + + /** + * Images with only a srcset are valid and will be wrapped + */ + public function test_image_with_only_srcset() { + $this->wp->createImage(37857, '2025/09', 'test_250x250.webp'); + + $input = 'no source but has srcset'; + $expected = 'no source but has srcset'; + $output = $this->tiny_picture->replace_sources($input); + + $this->assertSame($expected, $output); + } } From 4647abebe79caf46614243c765bdf0b75d8ab51f Mon Sep 17 00:00:00 2001 From: tijmen Date: Mon, 16 Feb 2026 11:06:12 +0100 Subject: [PATCH 3/4] fix: skip images without src and srcset --- src/class-tiny-picture.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/class-tiny-picture.php b/src/class-tiny-picture.php index bde4441a..ab318131 100644 --- a/src/class-tiny-picture.php +++ b/src/class-tiny-picture.php @@ -195,6 +195,10 @@ private function filter_images( $content ) { } $images = array(); foreach ( $matches[0] as $img ) { + // Skip images without src or srcset + if ( ! preg_match( '/\b(?:src|srcset)\s*=/i', $img ) ) { + continue; + } $images[] = new Tiny_Source_Image( $img, $this->base_dir, From 5f1a96bc6305d19fbd7f540c752c1d6acb0e2b8f Mon Sep 17 00:00:00 2001 From: tijmen Date: Mon, 16 Feb 2026 11:06:48 +0100 Subject: [PATCH 4/4] fix: add defensive check when source is truely empty --- src/class-tiny-source-base.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/class-tiny-source-base.php b/src/class-tiny-source-base.php index 22e254b8..859b208d 100644 --- a/src/class-tiny-source-base.php +++ b/src/class-tiny-source-base.php @@ -189,7 +189,10 @@ protected function create_alternative_sources( $original_source_html ) { $srcsets = $this->get_image_srcsets( $original_source_html ); if ( empty( $srcsets ) ) { // no srcset, try src attribute - $srcsets[] = $this->get_image_src( $original_source_html ); + $src = $this->get_image_src( $original_source_html ); + if ( ! empty( $src ) ) { + $srcsets[] = $src; + } } if ( empty( $srcsets ) ) {