From 3984932450397d235eacdcb7ea709a8d7ba041c2 Mon Sep 17 00:00:00 2001 From: tijmen Date: Fri, 15 May 2026 15:08:07 +0200 Subject: [PATCH 01/28] autofixes --- src/class-tiny-compress-client.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/class-tiny-compress-client.php b/src/class-tiny-compress-client.php index 8c983ce6..2f3531d6 100644 --- a/src/class-tiny-compress-client.php +++ b/src/class-tiny-compress-client.php @@ -98,7 +98,7 @@ protected function validate() { } throw new Tiny_Exception( - $err->getMessage(), + esc_html( $err->getMessage() ), get_class( $err ), $err->status ); @@ -165,7 +165,7 @@ protected function compress( $input, $resize_opts, $preserve_opts, $convert_to ) ); throw new Tiny_Exception( - $err->getMessage(), + esc_html( $err->getMessage() ), get_class( $err ), $err->status ); @@ -184,7 +184,7 @@ public function create_key( $email, $options ) { $this->last_error_code = $err->status; throw new Tiny_Exception( - $err->getMessage(), + esc_html( $err->getMessage() ), get_class( $err ), $err->status ); From 0ea417f9397438d361170ab3ffab2a826b9ec9d5 Mon Sep 17 00:00:00 2001 From: tijmen Date: Mon, 18 May 2026 14:13:06 +0200 Subject: [PATCH 02/28] remove prefix underscores --- src/class-tiny-image-size.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/class-tiny-image-size.php b/src/class-tiny-image-size.php index f57694a6..e93040d5 100644 --- a/src/class-tiny-image-size.php +++ b/src/class-tiny-image-size.php @@ -231,7 +231,6 @@ public function mark_duplicate( $duplicate_size_name ) { $this->duplicate = true; $this->duplicate_of_size = $duplicate_size_name; } - public function is_duplicate() { return $this->duplicate; } From b96bc262fa412d6df81f61ce9a4919a956d4121c Mon Sep 17 00:00:00 2001 From: tijmen Date: Mon, 18 May 2026 15:27:06 +0200 Subject: [PATCH 03/28] fix spacing in resize text --- src/views/compress-details.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/compress-details.php b/src/views/compress-details.php index 7693f25e..24f21590 100644 --- a/src/views/compress-details.php +++ b/src/views/compress-details.php @@ -177,7 +177,7 @@ echo '' . esc_html__( '(WP Retina 2x)', 'tiny-compress-images' ) . ''; } elseif ( $size->resized() ) { /* translators: %1$dx%2$d: resized image width x height */ - printf( '' . esc_html__( '(resized to %1$dx%2$d)', 'tiny-compress-images' ) . '', $size->meta['output']['width'], $size->meta['output']['height'] ); + printf( '' . esc_html__( ' (resized to %1$dx%2$d)', 'tiny-compress-images' ) . '', $size->meta['output']['width'], $size->meta['output']['height'] ); } echo ''; From a922dcd40b5bed4bcbe10968b275e028e887470b Mon Sep 17 00:00:00 2001 From: tijmen Date: Mon, 18 May 2026 16:29:53 +0200 Subject: [PATCH 04/28] move whitespace --- src/views/compress-details.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/compress-details.php b/src/views/compress-details.php index 24f21590..7693f25e 100644 --- a/src/views/compress-details.php +++ b/src/views/compress-details.php @@ -177,7 +177,7 @@ echo '' . esc_html__( '(WP Retina 2x)', 'tiny-compress-images' ) . ''; } elseif ( $size->resized() ) { /* translators: %1$dx%2$d: resized image width x height */ - printf( '' . esc_html__( ' (resized to %1$dx%2$d)', 'tiny-compress-images' ) . '', $size->meta['output']['width'], $size->meta['output']['height'] ); + printf( '' . esc_html__( '(resized to %1$dx%2$d)', 'tiny-compress-images' ) . '', $size->meta['output']['width'], $size->meta['output']['height'] ); } echo ''; From 56d08f4d75f2c1af1169915d8249015d7f74e5d5 Mon Sep 17 00:00:00 2001 From: tijmen Date: Mon, 18 May 2026 16:34:22 +0200 Subject: [PATCH 05/28] Do not escale error messages before being outputted to html --- src/class-tiny-compress-client.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/class-tiny-compress-client.php b/src/class-tiny-compress-client.php index 2f3531d6..8c983ce6 100644 --- a/src/class-tiny-compress-client.php +++ b/src/class-tiny-compress-client.php @@ -98,7 +98,7 @@ protected function validate() { } throw new Tiny_Exception( - esc_html( $err->getMessage() ), + $err->getMessage(), get_class( $err ), $err->status ); @@ -165,7 +165,7 @@ protected function compress( $input, $resize_opts, $preserve_opts, $convert_to ) ); throw new Tiny_Exception( - esc_html( $err->getMessage() ), + $err->getMessage(), get_class( $err ), $err->status ); @@ -184,7 +184,7 @@ public function create_key( $email, $options ) { $this->last_error_code = $err->status; throw new Tiny_Exception( - esc_html( $err->getMessage() ), + $err->getMessage(), get_class( $err ), $err->status ); From 3b367b2c47a89741fe447ba50822f40d9986574c Mon Sep 17 00:00:00 2001 From: tijmen Date: Tue, 26 May 2026 10:39:37 +0200 Subject: [PATCH 06/28] Unexclude escape output --- phpcs.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/phpcs.xml b/phpcs.xml index b56e261b..d5a4b056 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -11,7 +11,6 @@ - From 3d103a08393110f1279a76bfab191658629221e0 Mon Sep 17 00:00:00 2001 From: tijmen Date: Tue, 26 May 2026 10:48:23 +0200 Subject: [PATCH 07/28] phpcs: bulk-optimization.php --- src/views/bulk-optimization.php | 92 ++++++++++++++++++++------------- 1 file changed, 55 insertions(+), 37 deletions(-) diff --git a/src/views/bulk-optimization.php b/src/views/bulk-optimization.php index b0aaebb2..00d76ff6 100644 --- a/src/views/bulk-optimization.php +++ b/src/views/bulk-optimization.php @@ -1,31 +1,49 @@ +friendly_user_name(); +?> @@ -25,7 +32,7 @@

friendly_user_name() ); + printf( esc_html__( 'Hi %s, you haven\'t compressed any images in your media library.', 'tiny-compress-images' ), esc_html( $this->friendly_user_name() ) ); echo ' '; printf( wp_kses( @@ -37,7 +44,7 @@ ), ) ), - $link + wp_kses( $link, array( 'a' => array( 'href' => array() ) ) ) ); ?>

@@ -46,7 +53,7 @@

friendly_user_name() ); + printf( esc_html__( '%s, you are doing good.', 'tiny-compress-images' ), esc_html( $this->friendly_user_name() ) ); echo ' '; /* translators: %s: number of optimizable sizes and number of uploaded images */ printf( esc_html__( 'With your current settings you can still optimize %1$s image sizes from your %2$s uploaded JPEG, PNG, and WebP images.', 'tiny-compress-images' ), '', '' ); @@ -61,7 +68,7 @@ ), ) ), - $link + wp_kses( $link, array( 'a' => array( 'href' => array() ) ) ) ); ?>

@@ -70,7 +77,7 @@

friendly_user_name() ); + printf( esc_html__( '%s, this is great! Your entire library is optimized!', 'tiny-compress-images' ), esc_html( $this->friendly_user_name() ) ); echo ' '; require __DIR__ . '/request-review.php'; ?> From 5f4a650538f8fd3c5df26faddba76c39f1d63e8e Mon Sep 17 00:00:00 2001 From: tijmen Date: Tue, 26 May 2026 11:02:47 +0200 Subject: [PATCH 12/28] phpcs optimization-chart --- src/views/optimization-chart.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/views/optimization-chart.php b/src/views/optimization-chart.php index 4013b5f3..d9cb1931 100644 --- a/src/views/optimization-chart.php +++ b/src/views/optimization-chart.php @@ -22,34 +22,34 @@ -

- - - +
+ + +
-
%
+
%
From 66812042a5bc391730a8cee0f49d490383467aea Mon Sep 17 00:00:00 2001 From: tijmen Date: Tue, 26 May 2026 11:09:04 +0200 Subject: [PATCH 13/28] phpcs status-connected --- src/views/account-status-connected.php | 29 ++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/src/views/account-status-connected.php b/src/views/account-status-connected.php index 085b1dca..5983bdd7 100644 --- a/src/views/account-status-connected.php +++ b/src/views/account-status-connected.php @@ -1,3 +1,16 @@ +