-
+
- images', 'tiny-compress-images' ), array(
- 'br' => array(),
- ) ) ?>
+ images', 'tiny-compress-images' ),
+ array(
+ 'br' => array(),
+ )
+ )
+ ?>
@@ -93,12 +98,17 @@
- image sizes', 'tiny-compress-images' ), array(
- 'br' => array(),
- ) ) ?>
+ image sizes', 'tiny-compress-images' ),
+ array(
+ 'br' => array(),
+ )
+ )
+ ?>
-
+
- cost', 'tiny-compress-images' ), array(
- 'br' => array(),
- ) ) ?>
+ cost', 'tiny-compress-images' ),
+ array(
+ 'br' => array(),
+ )
+ )
+ ?>
- $
+ $
USD
0 ) { ?>
@@ -181,22 +225,29 @@
-
+
@@ -205,23 +256,23 @@
-
+
-
+
-
+
-
-
+
+
-
+
@@ -231,28 +282,28 @@
$remaining_credits; ?>
-
+
0 ) {
- require_once dirname( __FILE__ ) . '/bulk-optimization-form.php';
+ require_once __DIR__ . '/bulk-optimization-form.php';
}
?>
-
+
@@ -261,11 +312,11 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/src/views/compress-details-processing.php b/src/views/compress-details-processing.php
index 58687997..7d7c1ee9 100644
--- a/src/views/compress-details-processing.php
+++ b/src/views/compress-details-processing.php
@@ -1,8 +1,8 @@
-
+
diff --git a/src/views/compress-details.php b/src/views/compress-details.php
index 5e22fe5e..882a7dfd 100644
--- a/src/views/compress-details.php
+++ b/src/views/compress-details.php
@@ -1,16 +1,16 @@
settings->get_sizes() );
-$conversion_enabled = $this->settings->get_conversion_enabled();
-$active_sizes = $this->settings->get_sizes();
-$active_tinify_sizes = $this->settings->get_active_tinify_sizes();
-$error = $tiny_image->get_latest_error();
-$total = $tiny_image->get_count( array( 'modified', 'missing', 'has_been_compressed', 'compressed', 'has_been_converted' ) );
-$active = $tiny_image->get_count( array( 'uncompressed', 'never_compressed', 'unconverted' ), $active_tinify_sizes );
-$image_statistics = $tiny_image->get_statistics( $active_sizes, $active_tinify_sizes );
+$available_sizes = array_keys( $this->settings->get_sizes() );
+$conversion_enabled = $this->settings->get_conversion_enabled();
+$active_sizes = $this->settings->get_sizes();
+$active_tinify_sizes = $this->settings->get_active_tinify_sizes();
+$error = $tiny_image->get_latest_error();
+$total = $tiny_image->get_count( array( 'modified', 'missing', 'has_been_compressed', 'compressed', 'has_been_converted' ) );
+$active = $tiny_image->get_count( array( 'uncompressed', 'never_compressed', 'unconverted' ), $active_tinify_sizes );
+$image_statistics = $tiny_image->get_statistics( $active_sizes, $active_tinify_sizes );
$available_uncompressed_sizes = $image_statistics['available_uncompressed_sizes'];
-$size_before = $image_statistics['initial_total_size'];
-$size_after = $image_statistics['compressed_total_size'];
+$size_before = $image_statistics['initial_total_size'];
+$size_after = $image_statistics['compressed_total_size'];
$size_active = array_fill_keys( $active_tinify_sizes, true );
$size_exists = array_fill_keys( $available_sizes, true );
@@ -23,9 +23,10 @@
?>
-
+ ?>
0 || $total['modified'] > 0 ) { ?>
@@ -35,13 +36,19 @@
- 0 || (0 == $total['has_been_compressed'] && 0 == $available_uncompressed_sizes) ) { ?>
+ 0 || ( 0 == $total['has_been_compressed'] && 0 == $available_uncompressed_sizes ) ) { ?>
%d size compressed', '%d sizes compressed', $total['has_been_compressed'], 'tiny-compress-images' ), array(
- 'strong' => array(),
- )), $total['has_been_compressed']);
+ printf(
+ wp_kses(
+ _n( '%d size compressed', '%d sizes compressed', $total['has_been_compressed'], 'tiny-compress-images' ),
+ array(
+ 'strong' => array(),
+ )
+ ),
+ $total['has_been_compressed']
+ );
?>
@@ -55,19 +62,27 @@
- 0 || 0 == $image_statistics['available_unconverted_sizes'] ) { ?>
+ 0 || 0 == $image_statistics['available_unconverted_sizes'] ) {
+ ?>
%d size converted', '%d sizes converted', $total['has_been_converted'], 'tiny-compress-images' ), array(
- 'strong' => array(),
- )), $total['has_been_converted']);
+ printf(
+ wp_kses(
+ _n( '%d size converted', '%d sizes converted', $total['has_been_converted'], 'tiny-compress-images' ),
+ array(
+ 'strong' => array(),
+ )
+ ),
+ $total['has_been_converted']
+ );
?>
- 0 ) { ?>
+ 0 ) { ?>
-
+
-
+
-
-
+
+
0 ) { ?>
get_id(), $images_to_compress ) ) { ?>
-
-
+
+
-
-
+
+
0 && $tiny_image->can_be_converted() ) { ?>
-
-
+
+
-
-
+
+
-
+
-
-
-
-
-
-
+
+
+
+
+
+
+
get_image_sizes() + $size_exists;
foreach ( $sizes as $size_name => $size ) {
if ( ! is_object( $size ) ) {
$size = new Tiny_Image_Size();
}
- ?>
-
+ ?>
+
';
echo '';
- echo (Tiny_Image::is_original( $size_name ) ? esc_html__( 'Original', 'tiny-compress-images' ) : esc_html( ucfirst( rtrim( $size_name, '_wr2x' ) ) ));
+ echo ( Tiny_Image::is_original( $size_name ) ? esc_html__( 'Original', 'tiny-compress-images' ) : esc_html( ucfirst( rtrim( $size_name, '_wr2x' ) ) ) );
echo ' ' . ' ';
if ( ! array_key_exists( $size_name, $active_sizes ) && ! Tiny_Image::is_retina( $size_name ) ) {
echo '' . esc_html__( '(not in use)', 'tiny-compress-images' ) . ' ';
- } elseif ( $size->missing() && (Tiny_Settings::wr2x_active() || ! Tiny_Image::is_retina( $size_name )) ) {
+ } elseif ( $size->missing() && ( Tiny_Settings::wr2x_active() || ! Tiny_Image::is_retina( $size_name ) ) ) {
echo '' . esc_html__( '(file removed)', 'tiny-compress-images' ) . ' ';
} elseif ( $size->modified() ) {
echo '' . esc_html__( '(modified after compression)', 'tiny-compress-images' ) . ' ';
@@ -195,22 +215,28 @@
echo '- ';
}
?>
-
+ 0 ) { ?>
+ if ( $image_statistics['image_sizes_compressed'] > 0 ) {
+ ?>
-
-
-
+
+
+
-
+
+
-
+
+ ?>
@@ -219,7 +245,7 @@
printf(
/* translators: %1$.0f%%: savings percentage, %2$s: total file size savings */
esc_html__( 'Total savings %1$.0f%% (%2$s)', 'tiny-compress-images' ),
- (1 - $size_after / floatval( $size_before )) * 100,
+ ( 1 - $size_after / floatval( $size_before ) ) * 100,
size_format( $size_before - $size_after, 1 )
);
} else {
diff --git a/src/views/dashboard-widget.php b/src/views/dashboard-widget.php
index cd4483cf..55b7c5c1 100644
--- a/src/views/dashboard-widget.php
+++ b/src/views/dashboard-widget.php
@@ -9,7 +9,7 @@
display: none;
}
div#tinypng_dashboard_widget div#optimization-chart svg circle.main {
- stroke: ;
+ stroke: ;
}
@@ -19,7 +19,7 @@
@@ -28,11 +28,17 @@
printf( esc_html__( 'Hi %s, you haven’t compressed any images in your media library.', 'tiny-compress-images' ), $this->friendly_user_name() );
echo ' ';
/* translators: %s: bulk optimization page */
- printf( wp_kses( __( 'If you like you can to optimize your whole library in one go with the %s page.', 'tiny-compress-images' ), array(
- 'a' => array(
- 'href' => array(),
+ printf(
+ wp_kses(
+ __( 'If you like you can to optimize your whole library in one go with the %s page.', 'tiny-compress-images' ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ ),
+ )
),
- ) ), $link );
+ $link
+ );
?>
@@ -46,11 +52,17 @@
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' ), ' ', ' ' );
echo ' ';
/* translators: %s: bulk optimization link */
- printf( wp_kses( __( 'Start the %s to optimize the remainder of your library.', 'tiny-compress-images' ), array(
- 'a' => array(
- 'href' => array(),
+ printf(
+ wp_kses(
+ __( 'Start the %s to optimize the remainder of your library.', 'tiny-compress-images' ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ ),
+ )
),
- ) ), $link );
+ $link
+ );
?>
@@ -68,12 +80,18 @@
saved %s of your media library size.', 'tiny-compress-images' ), array(
- 'span' => array(),
- 'strong' => array(),
- ) ), ' %' );
+ printf(
+ wp_kses(
+ __( 'You have saved %s of your media library size.', 'tiny-compress-images' ),
+ array(
+ 'span' => array(),
+ 'strong' => array(),
+ )
+ ),
+ ' %'
+ );
?>
-
+
diff --git a/src/views/optimization-chart.php b/src/views/optimization-chart.php
index 0081ef61..28e3dca3 100644
--- a/src/views/optimization-chart.php
+++ b/src/views/optimization-chart.php
@@ -6,50 +6,50 @@
$chart['percentage'] = $stats['display-percentage'];
} else {
$chart['percentage'] = 0;
-};
-
-$chart['size'] = 160;
-$chart['radius'] = $chart['size'] / 2 * 0.9;
-$chart['main-radius'] = $chart['radius'] * 0.88;
-$chart['center'] = $chart['size'] / 2;
-$chart['stroke'] = $chart['radius'] / 2;
-$chart['dash-stroke'] = $chart['radius'] / 4;
-$chart['inner-radius'] = $chart['radius'] - $chart['stroke'] / 2;
-$chart['circle-size'] = 2 * pi() * $chart['main-radius'];
+}
+
+$chart['size'] = 160;
+$chart['radius'] = $chart['size'] / 2 * 0.9;
+$chart['main-radius'] = $chart['radius'] * 0.88;
+$chart['center'] = $chart['size'] / 2;
+$chart['stroke'] = $chart['radius'] / 2;
+$chart['dash-stroke'] = $chart['radius'] / 4;
+$chart['inner-radius'] = $chart['radius'] - $chart['stroke'] / 2;
+$chart['circle-size'] = 2 * pi() * $chart['main-radius'];
$chart['dash-array-size'] = $chart['percentage'] / 100 * $chart['circle-size'];
?>
-
-
-
-
+
diff --git a/src/views/settings.php b/src/views/settings.php
index 07946ac1..5c808754 100644
--- a/src/views/settings.php
+++ b/src/views/settings.php
@@ -1,45 +1,45 @@
-
-
+
+
From ca7d4f8891354928829321c4f1365e413bb5a4df Mon Sep 17 00:00:00 2001
From: tijmen
Date: Mon, 24 Nov 2025 16:09:13 +0100
Subject: [PATCH 05/23] fix translations: after formatting
---
src/class-tiny-settings.php | 2 +-
src/views/account-status-connected.php | 8 ++++----
src/views/account-status-create-simple.php | 2 +-
src/views/bulk-optimization-upgrade-notice.php | 2 +-
src/views/compress-details.php | 4 ++--
src/views/dashboard-widget.php | 6 +++---
6 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/class-tiny-settings.php b/src/class-tiny-settings.php
index 13f21713..6309ac2e 100644
--- a/src/class-tiny-settings.php
+++ b/src/class-tiny-settings.php
@@ -618,9 +618,9 @@ public function render_size_checkboxes_description(
'strong' => array(),
);
- /* translators: %1$s: number of images */
printf(
wp_kses(
+ /* translators: %1$s: number of images */
__(
'With these settings you can compress at least %1$s images for free each month.', // WPCS: Needed for proper translation.
'tiny-compress-images'
diff --git a/src/views/account-status-connected.php b/src/views/account-status-connected.php
index bc2d5d23..4f8b1bff 100644
--- a/src/views/account-status-connected.php
+++ b/src/views/account-status-connected.php
@@ -30,9 +30,9 @@
$compressions = self::get_compression_count();
$remaining_credits = self::get_remaining_credits();
if ( self::is_on_free_plan() ) {
- /* translators: %s: number of remaining credits */
printf(
wp_kses(
+ /* translators: %s: number of remaining credits */
__(
'You are on a free plan with %s compressions left this month.', // WPCS: Needed for proper translation.
'tiny-compress-images'
@@ -42,8 +42,8 @@
$remaining_credits
);
} elseif ( ! $status->pending ) {
- /* translators: %s: number of compressions */
printf(
+ /* translators: %s: number of compressions */
esc_html__(
'You have made %s compressions this month.',
'tiny-compress-images'
@@ -67,8 +67,8 @@
%s',
esc_html__( 'API dashboard', 'tiny-compress-images' )
);
- /* translators: %s: link saying API dashboard */
printf(
+ /* translators: %s: link saying API dashboard */
esc_html__(
'Enter your API key. If you have lost your key, go to your %s to retrieve it.',
'tiny-compress-images'
diff --git a/src/views/account-status-create-simple.php b/src/views/account-status-create-simple.php
index de25b363..b3a21420 100644
--- a/src/views/account-status-create-simple.php
+++ b/src/views/account-status-create-simple.php
@@ -11,8 +11,8 @@
esc_html_e( 'Enter your API key.', 'tiny-compress-images' );
echo ' ';
- /* translators: %s: link saying TinyPNG developer section */
printf(
+ /* translators: %s: link saying TinyPNG developer section */
esc_html__(
'If needed you can go to the %s to retrieve it.',
'tiny-compress-images'
diff --git a/src/views/bulk-optimization-upgrade-notice.php b/src/views/bulk-optimization-upgrade-notice.php
index d9557aed..7fa1ed01 100644
--- a/src/views/bulk-optimization-upgrade-notice.php
+++ b/src/views/bulk-optimization-upgrade-notice.php
@@ -5,9 +5,9 @@
$strong = array(
'strong' => array(),
);
- /* translators: %s: number of remaining credits */
printf(
wp_kses(
+ /* translators: %s: number of remaining credits */
__(
'You are on a free plan with %s compressions left this month.', // WPCS: Needed for proper translation.
'tiny-compress-images'
diff --git a/src/views/compress-details.php b/src/views/compress-details.php
index 882a7dfd..b43e5b6e 100644
--- a/src/views/compress-details.php
+++ b/src/views/compress-details.php
@@ -39,9 +39,9 @@
0 || ( 0 == $total['has_been_compressed'] && 0 == $available_uncompressed_sizes ) ) { ?>
%d size compressed', '%d sizes compressed', $total['has_been_compressed'], 'tiny-compress-images' ),
array(
'strong' => array(),
@@ -68,9 +68,9 @@
?>
%d size converted', '%d sizes converted', $total['has_been_converted'], 'tiny-compress-images' ),
array(
'strong' => array(),
diff --git a/src/views/dashboard-widget.php b/src/views/dashboard-widget.php
index 55b7c5c1..fadab1e3 100644
--- a/src/views/dashboard-widget.php
+++ b/src/views/dashboard-widget.php
@@ -27,9 +27,9 @@
/* translators: %s: friendly user name */
printf( esc_html__( 'Hi %s, you haven’t compressed any images in your media library.', 'tiny-compress-images' ), $this->friendly_user_name() );
echo ' ';
- /* translators: %s: bulk optimization page */
printf(
wp_kses(
+ /* translators: %s: bulk optimization page */
__( 'If you like you can to optimize your whole library in one go with the %s page.', 'tiny-compress-images' ),
array(
'a' => array(
@@ -51,9 +51,9 @@
/* 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' ), ' ', ' ' );
echo ' ';
- /* translators: %s: bulk optimization link */
printf(
wp_kses(
+ /* translators: %s: bulk optimization link */
__( 'Start the %s to optimize the remainder of your library.', 'tiny-compress-images' ),
array(
'a' => array(
@@ -79,9 +79,9 @@
saved %s of your media library size.', 'tiny-compress-images' ),
array(
'span' => array(),
From 33b6b12112b492013108543015f89f884b2d5d23 Mon Sep 17 00:00:00 2001
From: tijmen
Date: Mon, 24 Nov 2025 16:10:35 +0100
Subject: [PATCH 06/23] replace date with gmdate
---
src/class-tiny-image-size.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/class-tiny-image-size.php b/src/class-tiny-image-size.php
index 6e80b3cf..ca3fd27e 100644
--- a/src/class-tiny-image-size.php
+++ b/src/class-tiny-image-size.php
@@ -247,7 +247,7 @@ public function delete_converted_image_size() {
}
private function recently_started() {
- $thirty_minutes_ago = date( 'U' ) - ( 60 * 30 );
+ $thirty_minutes_ago = gmdate( 'U' ) - ( 60 * 30 );
return (
isset( $this->meta['start'] ) &&
$this->meta['start'] > $thirty_minutes_ago
From 04f0af5a03ab6d0b6ac70f0f24240564e8367e52 Mon Sep 17 00:00:00 2001
From: tijmen
Date: Mon, 24 Nov 2025 16:20:58 +0100
Subject: [PATCH 07/23] chore: resolve line endings
---
src/class-tiny-bulk-optimization.php | 11 ++++--
src/class-tiny-compress-fopen.php | 10 ++++-
src/class-tiny-image.php | 10 ++++-
src/class-tiny-notices.php | 28 ++++++++------
src/class-tiny-plugin.php | 28 +++++++++++---
src/class-tiny-settings.php | 40 ++++++++++++++++----
src/views/account-status-create-advanced.php | 2 +-
src/views/bulk-optimization.php | 10 ++---
8 files changed, 100 insertions(+), 39 deletions(-)
diff --git a/src/class-tiny-bulk-optimization.php b/src/class-tiny-bulk-optimization.php
index 65afc92b..2052aebb 100644
--- a/src/class-tiny-bulk-optimization.php
+++ b/src/class-tiny-bulk-optimization.php
@@ -128,19 +128,22 @@ private static function populate_optimization_statistics( $settings, $result, $s
$image_stats['available_unconverted_sizes'];
$stats['optimized-image-sizes'] +=
$image_stats['image_sizes_converted'];
- $stats['estimated_credit_use'] += $image_stats['available_unconverted_sizes'];
+ $stats['estimated_credit_use'] +=
+ $image_stats['available_unconverted_sizes'];
} else {
$stats['available-unoptimized-sizes'] +=
- $image_stats['available_uncompressed_sizes'];
+ $image_stats['available_uncompressed_sizes'];
$stats['optimized-image-sizes'] +=
- $image_stats['image_sizes_compressed'];
+ $image_stats['image_sizes_compressed'];
}
$stats['optimized-library-size'] += $image_stats['compressed_total_size'];
$stats['unoptimized-library-size'] += $image_stats['initial_total_size'];
$has_conversions = $image_stats['available_unconverted_sizes'] > 0;
$has_compressions = $image_stats['available_uncompressed_sizes'] > 0;
- $has_optimizations = $has_compressions || ( $conversion_enabled && $has_conversions );
+ $has_optimizations = $has_compressions || (
+ $conversion_enabled && $has_conversions
+ );
if ( $has_optimizations ) {
$stats['available-for-optimization'][] = array(
'ID' => $result[ $i ]['ID'],
diff --git a/src/class-tiny-compress-fopen.php b/src/class-tiny-compress-fopen.php
index 4481b37b..0ee72f7f 100644
--- a/src/class-tiny-compress-fopen.php
+++ b/src/class-tiny-compress-fopen.php
@@ -106,7 +106,10 @@ protected function compress( $input, $resize_opts, $preserve_opts, $convert_to )
);
}
- $params = $this->output_request_options( $resize_opts, $preserve_opts );
+ $params = $this->output_request_options(
+ $resize_opts,
+ $preserve_opts
+ );
list($output, $headers, $status_code) = $this->request( $params, $output_url );
if ( $status_code >= 400 && is_array( $output ) && isset( $output['error'] ) ) {
@@ -140,7 +143,10 @@ protected function compress( $input, $resize_opts, $preserve_opts, $convert_to )
'type' => $headers['content-type'],
'width' => intval( $headers['image-width'] ),
'height' => intval( $headers['image-height'] ),
- 'ratio' => round( strlen( $output ) / strlen( $input ), 4 ),
+ 'ratio' => round(
+ strlen( $output ) / strlen( $input ),
+ 4
+ ),
),
);
diff --git a/src/class-tiny-image.php b/src/class-tiny-image.php
index 63ee8a45..928ce254 100644
--- a/src/class-tiny-image.php
+++ b/src/class-tiny-image.php
@@ -399,9 +399,15 @@ public function get_latest_error() {
foreach ( $this->sizes as $size_name => $size ) {
if ( in_array( $size_name, $active_tinify_sizes, true ) ) {
if ( isset( $size->meta['error'] ) && isset( $size->meta['message'] ) ) {
- if ( null === $last_timestamp || $last_timestamp < $size->meta['timestamp'] ) {
+ if (
+ null === $last_timestamp ||
+ $last_timestamp < $size->meta['timestamp']
+ ) {
$last_timestamp = $size->meta['timestamp'];
- $error_message = Tiny_Helpers::truncate_text( $size->meta['message'], 140 );
+ $error_message = Tiny_Helpers::truncate_text(
+ $size->meta['message'],
+ 140
+ );
}
}
}
diff --git a/src/class-tiny-notices.php b/src/class-tiny-notices.php
index 091738d6..b55d6d4f 100644
--- a/src/class-tiny-notices.php
+++ b/src/class-tiny-notices.php
@@ -238,12 +238,16 @@ public function outdated_platform_notice() {
);
} elseif ( ! Tiny_PHP::curl_available() ) {
$message = esc_html__(
- 'We noticed that cURL is not available. For the best experience we recommend to make sure cURL is available.', // WPCS: Needed for proper translation.
+ 'We noticed that cURL is not available. For the best experience '
+ . 'we recommend to make sure cURL is available.',
+ // WPCS: Needed for proper translation.
'tiny-compress-images'
);
} elseif ( Tiny_PHP::curl_exec_disabled() ) {
$message = esc_html__(
- 'We noticed that curl_exec is disabled in your PHP configuration. Please update this setting for the best experience.', // WPCS: Needed for proper translation.
+ 'We noticed that curl_exec is disabled in your PHP configuration. '
+ . 'Please update this setting for the best experience.',
+ // WPCS: Needed for proper translation.
'tiny-compress-images'
);
}
@@ -259,18 +263,20 @@ public function incompatible_plugins_notice() {
}
private function show_incompatible_plugins( $incompatible_plugins ) {
- $notice = '';
- $notice .= '
';
- $notice .= esc_html__(
+ $notice = '';
+ $notice .= '
';
+ $notice .= esc_html__(
'TinyPNG - JPEG, PNG & WebP image compression',
'tiny-compress-images'
);
- $notice .= ' ';
- $notice .= '
';
- $notice .= esc_html__(
- 'You have activated multiple image optimization plugins. This may lead to unexpected results. The following plugins were detected:', // WPCS: Needed for proper translation.
- 'tiny-compress-images'
- );
+ $notice .= '';
+ $notice .= '
';
+ $notice .= esc_html__(
+ 'You have activated multiple image optimization plugins. This may '
+ . 'lead to unexpected results. The following plugins were detected:',
+ // WPCS: Needed for proper translation.
+ 'tiny-compress-images'
+ );
$notice .= '
';
$notice .= '
';
$notice .= '• ';
diff --git a/src/class-tiny-plugin.php b/src/class-tiny-plugin.php
index 086435bd..915dee1a 100644
--- a/src/class-tiny-plugin.php
+++ b/src/class-tiny-plugin.php
@@ -290,21 +290,36 @@ public function enqueue_scripts( $hook ) {
'wpVersion' => self::wp_version(),
'pluginVersion' => self::version(),
'L10nAllDone' => __( 'All images are processed', 'tiny-compress-images' ),
- 'L10nNoActionTaken' => __( 'No action taken', 'tiny-compress-images' ),
- 'L10nDuplicate' => __( 'Image was already processed', 'tiny-compress-images' ),
+ 'L10nNoActionTaken' => __(
+ 'No action taken',
+ 'tiny-compress-images'
+ ),
+ 'L10nDuplicate' => __(
+ 'Image was already processed',
+ 'tiny-compress-images'
+ ),
'L10nBulkAction' => __( 'Compress Images', 'tiny-compress-images' ),
- 'L10nBulkMarkCompressed' => __( 'Mark as Compressed', 'tiny-compress-images' ),
+ 'L10nBulkMarkCompressed' => __(
+ 'Mark as Compressed',
+ 'tiny-compress-images'
+ ),
'L10nCancelled' => __( 'Cancelled', 'tiny-compress-images' ),
'L10nCompressing' => __( 'Compressing', 'tiny-compress-images' ),
'L10nCompressed' => __( 'compressed', 'tiny-compress-images' ),
'L10nConverted' => __( 'converted', 'tiny-compress-images' ),
'L10nFile' => __( 'File', 'tiny-compress-images' ),
- 'L10nSizesOptimized' => __( 'Sizes optimized', 'tiny-compress-images' ),
+ 'L10nSizesOptimized' => __(
+ 'Sizes optimized',
+ 'tiny-compress-images'
+ ),
'L10nInitialSize' => __( 'Initial size', 'tiny-compress-images' ),
'L10nCurrentSize' => __( 'Current size', 'tiny-compress-images' ),
'L10nSavings' => __( 'Savings', 'tiny-compress-images' ),
'L10nStatus' => __( 'Status', 'tiny-compress-images' ),
- 'L10nShowMoreDetails' => __( 'Show more details', 'tiny-compress-images' ),
+ 'L10nShowMoreDetails' => __(
+ 'Show more details',
+ 'tiny-compress-images'
+ ),
'L10nError' => __( 'Error', 'tiny-compress-images' ),
'L10nLatestError' => __( 'Latest error', 'tiny-compress-images' ),
'L10nInternalError' => __( 'Internal error', 'tiny-compress-images' ),
@@ -813,7 +828,8 @@ function clean_attachment( $post_id ) {
}
static function request_review() {
- $review_url = 'https://wordpress.org/support/plugin/tiny-compress-images/reviews/#new-post';
+ $review_url =
+ 'https://wordpress.org/support/plugin/tiny-compress-images/reviews/#new-post';
$review_block = esc_html__( 'Enjoying TinyPNG?', 'tiny-compress-images' );
$review_block .= ' ';
$review_block .= sprintf(
diff --git a/src/class-tiny-settings.php b/src/class-tiny-settings.php
index 6309ac2e..ea99f2e9 100644
--- a/src/class-tiny-settings.php
+++ b/src/class-tiny-settings.php
@@ -622,7 +622,9 @@ public function render_size_checkboxes_description(
wp_kses(
/* translators: %1$s: number of images */
__(
- 'With these settings you can compress at least %1$s images for free each month.', // WPCS: Needed for proper translation.
+ 'With these settings you can compress '
+ . 'at least %1$s images for free each month.',
+ // WPCS: Needed for proper translation.
'tiny-compress-images'
),
$strong
@@ -673,11 +675,25 @@ public function render_resize() {
'" value="on" ' . $checked . '/>';
echo '' . $label . ' ';
- echo '';
+ echo '
';
echo '
';
- echo wp_kses( __( 'Save space by setting a maximum width and height for all images uploaded.', 'tiny-compress-images' ), $strong ); // WPCS: Needed for proper translation.
+ echo wp_kses(
+ __(
+ 'Save space by setting a maximum width and height '
+ . 'for all images uploaded.',
+ 'tiny-compress-images'
+ ),
+ $strong
+ ); // WPCS: Needed for proper translation.
echo ' ';
- echo wp_kses( __( 'Resizing takes 1 additional compression for each image that is larger.', 'tiny-compress-images' ), $strong ); // WPCS: Needed for proper translation.
+ echo wp_kses(
+ __(
+ 'Resizing takes 1 additional compression '
+ . 'for each image that is larger.',
+ 'tiny-compress-images'
+ ),
+ $strong
+ ); // WPCS: Needed for proper translation.
echo ' ';
echo '
array(
From cf465478d32e263786f9cc4ff0e3cd0c92a43fec Mon Sep 17 00:00:00 2001
From: tijmen
Date: Mon, 24 Nov 2025 16:22:18 +0100
Subject: [PATCH 08/23] chore: make constructor public
---
src/class-tiny-picture.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/class-tiny-picture.php b/src/class-tiny-picture.php
index f4050d95..1cd6c47e 100644
--- a/src/class-tiny-picture.php
+++ b/src/class-tiny-picture.php
@@ -43,7 +43,7 @@ class Tiny_Picture extends Tiny_WP_Base {
* @param string $base_dir Absolute path (e.g. ABSPATH)
* @param array $domains List of allowed domain URLs
*/
- function __construct( $base_dir = ABSPATH, $domains = array() ) {
+ public function __construct( $base_dir = ABSPATH, $domains = array() ) {
$this->base_dir = $base_dir;
$this->allowed_domains = $domains;
From 4b9c5fc17e0c652ce22f77dabda2990d151ba1dd Mon Sep 17 00:00:00 2001
From: tijmen
Date: Mon, 24 Nov 2025 16:46:12 +0100
Subject: [PATCH 09/23] chore: resolve issues with translations and line
endings
---
src/class-tiny-notices.php | 15 ++++++---------
src/class-tiny-settings.php | 27 +++++++++++++--------------
2 files changed, 19 insertions(+), 23 deletions(-)
diff --git a/src/class-tiny-notices.php b/src/class-tiny-notices.php
index b55d6d4f..fce29796 100644
--- a/src/class-tiny-notices.php
+++ b/src/class-tiny-notices.php
@@ -238,16 +238,14 @@ public function outdated_platform_notice() {
);
} elseif ( ! Tiny_PHP::curl_available() ) {
$message = esc_html__(
- 'We noticed that cURL is not available. For the best experience '
- . 'we recommend to make sure cURL is available.',
- // WPCS: Needed for proper translation.
+ // phpcs:ignore Generic.Files.LineLength
+ 'We noticed that cURL is not available. For the best experience we recommend to make sure cURL is available.',
'tiny-compress-images'
);
} elseif ( Tiny_PHP::curl_exec_disabled() ) {
$message = esc_html__(
- 'We noticed that curl_exec is disabled in your PHP configuration. '
- . 'Please update this setting for the best experience.',
- // WPCS: Needed for proper translation.
+ // phpcs:ignore Generic.Files.LineLength
+ 'We noticed that curl_exec is disabled in your PHP configuration. Please update this setting for the best experience.',
'tiny-compress-images'
);
}
@@ -272,9 +270,8 @@ private function show_incompatible_plugins( $incompatible_plugins ) {
$notice .= '';
$notice .= '';
$notice .= esc_html__(
- 'You have activated multiple image optimization plugins. This may '
- . 'lead to unexpected results. The following plugins were detected:',
- // WPCS: Needed for proper translation.
+ // phpcs:ignore Generic.Files.LineLength
+ 'You have activated multiple image optimization plugins. This may lead to unexpected results. The following plugins were detected:',
'tiny-compress-images'
);
$notice .= '
';
diff --git a/src/class-tiny-settings.php b/src/class-tiny-settings.php
index ea99f2e9..2e1eccb8 100644
--- a/src/class-tiny-settings.php
+++ b/src/class-tiny-settings.php
@@ -622,9 +622,8 @@ public function render_size_checkboxes_description(
wp_kses(
/* translators: %1$s: number of images */
__(
- 'With these settings you can compress '
- . 'at least %1$s images for free each month.',
- // WPCS: Needed for proper translation.
+ // phpcs:ignore Generic.Files.LineLength
+ 'With these settings you can compress at least %1$s images for free each month.',
'tiny-compress-images'
),
$strong
@@ -679,21 +678,21 @@ public function render_resize() {
echo '';
echo wp_kses(
__(
- 'Save space by setting a maximum width and height '
- . 'for all images uploaded.',
+ // phpcs:ignore Generic.Files.LineLength
+ 'Save space by setting a maximum width and height for all images uploaded.',
'tiny-compress-images'
),
$strong
- ); // WPCS: Needed for proper translation.
+ );
echo ' ';
echo wp_kses(
__(
- 'Resizing takes 1 additional compression '
- . 'for each image that is larger.',
+ // phpcs:ignore Generic.Files.LineLength
+ 'Resizing takes 1 additional compression for each image that is larger.',
'tiny-compress-images'
),
$strong
- ); // WPCS: Needed for proper translation.
+ );
echo ' ';
echo '