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 7db201f0f82a6d5caf63646a638d3caaa53afac6 Mon Sep 17 00:00:00 2001 From: tijmen Date: Tue, 17 Mar 2026 12:26:02 +0100 Subject: [PATCH 2/4] move html to views, use esc_attr for template values --- src/class-tiny-settings.php | 110 +++--------------- .../settings-original-image-original.php | 10 ++ .../settings-original-image-preserve.php | 4 + src/views/settings-original-image.php | 90 ++++++++++++++ src/views/settings.php | 7 +- 5 files changed, 120 insertions(+), 101 deletions(-) create mode 100644 src/views/settings-original-image-original.php create mode 100644 src/views/settings-original-image-preserve.php create mode 100644 src/views/settings-original-image.php diff --git a/src/class-tiny-settings.php b/src/class-tiny-settings.php index e595b523..6386f1e6 100644 --- a/src/class-tiny-settings.php +++ b/src/class-tiny-settings.php @@ -661,85 +661,6 @@ public function render_size_checkboxes_description( echo '

'; } - public function render_resize() { - $strong = array( - 'strong' => array(), - ); - - echo ''; - - $id = self::get_prefixed_name( 'resize_original_enabled' ); - $name = self::get_prefixed_name( 'resize_original[enabled]' ); - $checked = ( $this->get_resize_enabled() ? ' checked="checked"' : '' ); - - $label = esc_html__( - 'Resize the original image', - 'tiny-compress-images' - ); - - echo '
'; - echo ''; - echo '
'; - - echo '
'; - echo ''; - echo wp_kses( - __( - // phpcs:ignore Generic.Files.LineLength - 'Save space by setting a maximum width and height for all images uploaded.', - 'tiny-compress-images' - ), - $strong - ); - echo '
'; - echo wp_kses( - __( - // phpcs:ignore Generic.Files.LineLength - 'Resizing takes 1 additional compression for each image that is larger.', - 'tiny-compress-images' - ), - $strong - ); - echo '
'; - echo '
'; - printf( '%s: ', esc_html__( 'Max Width', 'tiny-compress-images' ) ); - $this->render_resize_input( 'width' ); - printf( '%s: ', esc_html__( 'Max Height', 'tiny-compress-images' ) ); - $this->render_resize_input( 'height' ); - echo '
'; - - $this->render_preserve_input( - 'creation', - esc_html__( - 'Preserve creation date and time in the original image', - 'tiny-compress-images' - ) - ); - - $this->render_preserve_input( - 'copyright', - esc_html__( - 'Preserve copyright information in the original image', - 'tiny-compress-images' - ) - ); - - $this->render_preserve_input( - 'location', - esc_html__( - 'Preserve GPS location in the original image', - 'tiny-compress-images' - ) . ' ' . - esc_html__( '(JPEG only)', 'tiny-compress-images' ) - ); - } - public function render_compression_timing_radiobutton( $name, $label, @@ -776,25 +697,24 @@ public function render_compression_timing_radiobutton( } public function render_preserve_input( $name, $description ) { - echo '

'; - $id = sprintf( self::get_prefixed_name( 'preserve_data_%s' ), $name ); - $field = sprintf( self::get_prefixed_name( 'preserve_data[%s]' ), $name ); - $checked = ( $this->get_preserve_enabled( $name ) ? ' checked="checked"' : '' ); - $label = esc_html( $description, 'tiny-compress-images' ); - echo ''; - echo ''; - echo '
'; - echo '

'; + $data = array( + 'id' => sprintf( self::get_prefixed_name( 'preserve_data_%s' ), $name ), + 'field' => sprintf( self::get_prefixed_name( 'preserve_data[%s]' ), $name ), + 'checked' => $this->get_preserve_enabled( $name ) ? 'checked' : '', + 'label' => $description, + ); + include plugin_dir_path( __FILE__ ) . 'views/settings-original-image-preserve.php'; } - public function render_resize_input( $name ) { - $id = sprintf( self::get_prefixed_name( 'resize_original_%s' ), $name ); - $field = sprintf( self::get_prefixed_name( 'resize_original[%s]' ), $name ); + public function render_resize_input( $name, $label ) { $settings = get_option( self::get_prefixed_name( 'resize_original' ) ); - $value = isset( $settings[ $name ] ) ? $settings[ $name ] : '2048'; - echo ''; + $data = array( + 'id' => sprintf( self::get_prefixed_name( 'resize_original_%s' ), $name ), + 'field' => sprintf( self::get_prefixed_name( 'resize_original[%s]' ), $name ), + 'value' => isset( $settings[ $name ] ) ? $settings[ $name ] : '2048', + 'label' => $label, + ); + include plugin_dir_path( __FILE__ ) . 'views/settings-original-image-original.php'; } public function get_compression_count() { diff --git a/src/views/settings-original-image-original.php b/src/views/settings-original-image-original.php new file mode 100644 index 00000000..e8230427 --- /dev/null +++ b/src/views/settings-original-image-original.php @@ -0,0 +1,10 @@ + + \ No newline at end of file diff --git a/src/views/settings-original-image-preserve.php b/src/views/settings-original-image-preserve.php new file mode 100644 index 00000000..a0f79bd5 --- /dev/null +++ b/src/views/settings-original-image-preserve.php @@ -0,0 +1,4 @@ +

+ value="on"> + +

\ No newline at end of file diff --git a/src/views/settings-original-image.php b/src/views/settings-original-image.php new file mode 100644 index 00000000..c4dc7911 --- /dev/null +++ b/src/views/settings-original-image.php @@ -0,0 +1,90 @@ + array(), +); + +?> + + + + + +
+ get_resize_enabled(); + ?> + + /> +
+
+ + Save space by setting a maximum width and height for all images uploaded.', + 'tiny-compress-images' + ), + $strong, + ); ?> +
+ 1 additional compression for each image that is larger.', + 'tiny-compress-images' + ), + $strong, + ); ?> +
+ +
+ render_resize_input( 'width', 'Max Width' ); + $this->render_resize_input( 'height', 'Max Height' ); + ?> +
+
+ + render_preserve_input( + 'creation', + esc_html__( + 'Preserve creation date and time in the original image', + 'tiny-compress-images' + ) + ); + $this->render_preserve_input( + 'copyright', + esc_html__( + 'Preserve creation date and time in the original image', + 'tiny-compress-images' + ) + ); + $this->render_preserve_input( + 'location', + esc_html__( + 'Preserve GPS location in the original image', + 'tiny-compress-images' + ) . ' ' . + esc_html__( '(JPEG only)', 'tiny-compress-images' ) + ); + ?> +
+ + \ No newline at end of file diff --git a/src/views/settings.php b/src/views/settings.php index 1f70b2a6..c12d4a6e 100644 --- a/src/views/settings.php +++ b/src/views/settings.php @@ -51,12 +51,7 @@ render_format_conversion(); ?> - - - - render_resize(); ?> - - + From 04560f35558bff6393350550c3af7cb797f87243 Mon Sep 17 00:00:00 2001 From: tijmen Date: Tue, 17 Mar 2026 12:54:55 +0100 Subject: [PATCH 3/4] phpcs --- src/class-tiny-settings.php | 9 +- .../settings-original-image-original.php | 13 +- .../settings-original-image-preserve.php | 11 +- src/views/settings-original-image.php | 168 +++++++++--------- 4 files changed, 106 insertions(+), 95 deletions(-) diff --git a/src/class-tiny-settings.php b/src/class-tiny-settings.php index 6386f1e6..290b8b0d 100644 --- a/src/class-tiny-settings.php +++ b/src/class-tiny-settings.php @@ -700,19 +700,18 @@ public function render_preserve_input( $name, $description ) { $data = array( 'id' => sprintf( self::get_prefixed_name( 'preserve_data_%s' ), $name ), 'field' => sprintf( self::get_prefixed_name( 'preserve_data[%s]' ), $name ), - 'checked' => $this->get_preserve_enabled( $name ) ? 'checked' : '', + 'checked' => $this->get_preserve_enabled( $name ), 'label' => $description, ); include plugin_dir_path( __FILE__ ) . 'views/settings-original-image-preserve.php'; } - public function render_resize_input( $name, $label ) { + public function render_resize_input( $name ) { $settings = get_option( self::get_prefixed_name( 'resize_original' ) ); - $data = array( - 'id' => sprintf( self::get_prefixed_name( 'resize_original_%s' ), $name ), + $data = array( + 'id' => sprintf( self::get_prefixed_name( 'resize_original_%s' ), $name ), 'field' => sprintf( self::get_prefixed_name( 'resize_original[%s]' ), $name ), 'value' => isset( $settings[ $name ] ) ? $settings[ $name ] : '2048', - 'label' => $label, ); include plugin_dir_path( __FILE__ ) . 'views/settings-original-image-original.php'; } diff --git a/src/views/settings-original-image-original.php b/src/views/settings-original-image-original.php index e8230427..9607a2f8 100644 --- a/src/views/settings-original-image-original.php +++ b/src/views/settings-original-image-original.php @@ -1,10 +1,7 @@ - \ No newline at end of file diff --git a/src/views/settings-original-image-preserve.php b/src/views/settings-original-image-preserve.php index a0f79bd5..60399e0a 100644 --- a/src/views/settings-original-image-preserve.php +++ b/src/views/settings-original-image-preserve.php @@ -1,4 +1,11 @@

- value="on"> - + + value="on" + /> +

\ No newline at end of file diff --git a/src/views/settings-original-image.php b/src/views/settings-original-image.php index c4dc7911..3ebc1a2a 100644 --- a/src/views/settings-original-image.php +++ b/src/views/settings-original-image.php @@ -1,90 +1,98 @@ array(), + 'strong' => array(), ); ?> - - - -
- get_resize_enabled(); - ?> - - /> -
-
- - Save space by setting a maximum width and height for all images uploaded.', - 'tiny-compress-images' - ), - $strong, - ); ?> -
- 1 additional compression for each image that is larger.', - 'tiny-compress-images' - ), - $strong, - ); ?> -
+ + + +
+ get_resize_enabled(); + ?> + + /> +
+
+ + Save space by setting a maximum width and height for all images uploaded.', + 'tiny-compress-images' + ), + $strong, + ); + ?> +
+ 1 additional compression for each image that is larger.', + 'tiny-compress-images' + ), + $strong, + ); + ?> +
-
- render_resize_input( 'width', 'Max Width' ); - $this->render_resize_input( 'height', 'Max Height' ); - ?> -
-
- - render_preserve_input( - 'creation', - esc_html__( - 'Preserve creation date and time in the original image', - 'tiny-compress-images' - ) - ); - $this->render_preserve_input( - 'copyright', - esc_html__( - 'Preserve creation date and time in the original image', - 'tiny-compress-images' - ) - ); - $this->render_preserve_input( - 'location', - esc_html__( - 'Preserve GPS location in the original image', - 'tiny-compress-images' - ) . ' ' . - esc_html__( '(JPEG only)', 'tiny-compress-images' ) - ); - ?> -
- +
+ : + render_resize_input( 'width' ); ?> + : + render_resize_input( 'height' ); ?> +
+
+ + render_preserve_input( + 'creation', + esc_html__( + 'Preserve creation date and time in the original image', + 'tiny-compress-images' + ) + ); + $this->render_preserve_input( + 'copyright', + esc_html__( + 'Preserve copyright information in the original image', + 'tiny-compress-images' + ) + ); + $this->render_preserve_input( + 'location', + esc_html__( + 'Preserve GPS location in the original image', + 'tiny-compress-images' + ) . ' ' . + esc_html__( '(JPEG only)', 'tiny-compress-images' ) + ); + ?> +
+ \ No newline at end of file From 22837288a994d877b63feac14fccd68ce166c137 Mon Sep 17 00:00:00 2001 From: tijmen Date: Tue, 17 Mar 2026 15:42:54 +0100 Subject: [PATCH 4/4] remove commas, format --- src/views/settings-original-image.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/views/settings-original-image.php b/src/views/settings-original-image.php index 3ebc1a2a..261dd8d9 100644 --- a/src/views/settings-original-image.php +++ b/src/views/settings-original-image.php @@ -28,8 +28,7 @@ id="" name="" value="on" - - /> + />