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/2] 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 0c3158d2a666267d1cffc0eb100346cfb096aa6f Mon Sep 17 00:00:00 2001 From: tijmen Date: Tue, 7 Apr 2026 21:06:36 +0200 Subject: [PATCH 2/2] copy sizes attributes from original img --- src/class-tiny-source-base.php | 5 +++++ test/unit/TinyPictureTest.php | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/class-tiny-source-base.php b/src/class-tiny-source-base.php index 859b208d..c6f3cff5 100644 --- a/src/class-tiny-source-base.php +++ b/src/class-tiny-source-base.php @@ -240,6 +240,11 @@ protected function create_alternative_sources( $original_source_html ) { $source_attr_parts[ $attr ] = $attr_value; } } + } else { + $sizes_value = $this->get_attribute_value( $original_source_html, 'sizes' ); + if ( $sizes_value ) { + $source_attr_parts['sizes'] = $sizes_value; + } } $source_attr_parts['type'] = $mimetype; diff --git a/test/unit/TinyPictureTest.php b/test/unit/TinyPictureTest.php index 68ba2959..95298d21 100644 --- a/test/unit/TinyPictureTest.php +++ b/test/unit/TinyPictureTest.php @@ -366,6 +366,21 @@ public function test_image_without_src() { $this->assertSame($expected, $output); } + /** + * sizes attribute on also have to be set to elements + */ + public function test_img_sizes_attribute_is_propagated_to_sources() { + $this->wp->createImage(1000, '2026/04', 'test-320w.webp'); + $this->wp->createImage(1000, '2026/04', 'test-640w.webp'); + $this->wp->createImage(1000, '2026/04', 'test.webp'); + + $input = ''; + $expected = ''; + $output = $this->tiny_picture->replace_sources($input); + + $this->assertSame($expected, $output); + } + /** * Images with only a srcset are valid and will be wrapped */