Compress JPEG & PNG images - Version 3.2.1

Version Description

  • Fixed bug that caused the original version of images that started with a special character to not be compressed.
  • Updated Wordpress compatibility.
Download this release

Release Info

Developer TinyPNG
Plugin Icon 128x128 Compress JPEG & PNG images
Version 3.2.1
Comparing to
See all releases

Code changes from version 3.2.0 to 3.2.1

.travis.yml CHANGED
@@ -1,4 +1,5 @@
1
  language: php
 
2
  php:
3
  - 5.4
4
  - 5.5
@@ -12,6 +13,14 @@ matrix:
12
  - dist: precise
13
  php: 5.3
14
  script: bin/unit-tests
 
 
 
 
 
 
 
 
15
  - dist: trusty
16
  php: 7.3
17
  env: WORDPRESS_VERSION=51 INTEGRATION_TESTS=true
1
  language: php
2
+ dist: trusty
3
  php:
4
  - 5.4
5
  - 5.5
13
  - dist: precise
14
  php: 5.3
15
  script: bin/unit-tests
16
+ - dist: trusty
17
+ php: 7.3
18
+ env: WORDPRESS_VERSION=53 INTEGRATION_TESTS=true
19
+ script: bin/integration-tests
20
+ - dist: trusty
21
+ php: 7.3
22
+ env: WORDPRESS_VERSION=52 INTEGRATION_TESTS=true
23
+ script: bin/integration-tests
24
  - dist: trusty
25
  php: 7.3
26
  env: WORDPRESS_VERSION=51 INTEGRATION_TESTS=true
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Compress JPEG & PNG images ===
2
  Contributors: TinyPNG
3
  Donate link: https://tinypng.com/
4
- Tags: optimize, compress, shrink, resize, faster, fit, scale, improve, images, picture, pictures, photo, photos, image, tinypng, tinyjpg, jpeg, jpg, png, lossy, jpegmini, crunch, minify, smush, save, bandwidth, website, speed, performance, panda, george, wordpress app, SEO, lossy, wp compress, sitespeed, shortpixel, kraken, PageRank, cheetaho, s3
5
  Requires at least: 3.4
6
- Tested up to: 5.1
7
- Stable tag: 3.2.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -133,6 +133,10 @@ A: Yes! After installing the plugin, go to *Media > Bulk Optimization*, and clic
133
  A: You can upgrade to a paid account by adding your *Payment details* on your [account dashboard](https://tinypng.com/dashboard/api). Additional compressions above 500 will then be charged at the end of each month as a one-time fee.
134
 
135
  == Changelog ==
 
 
 
 
136
  = 3.2.0 =
137
  * Support for WP Retina 2x Pro.
138
  * More capability checks for extra security.
1
  === Compress JPEG & PNG images ===
2
  Contributors: TinyPNG
3
  Donate link: https://tinypng.com/
4
+ Tags: compress images, compression, image size, page speed, performance
5
  Requires at least: 3.4
6
+ Tested up to: 5.4
7
+ Stable tag: 3.2.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
133
  A: You can upgrade to a paid account by adding your *Payment details* on your [account dashboard](https://tinypng.com/dashboard/api). Additional compressions above 500 will then be charged at the end of each month as a one-time fee.
134
 
135
  == Changelog ==
136
+ = 3.2.1 =
137
+ * Fixed bug that caused the original version of images that started with a special character to not be compressed.
138
+ * Updated Wordpress compatibility.
139
+
140
  = 3.2.0 =
141
  * Support for WP Retina 2x Pro.
142
  * More capability checks for extra security.
src/class-tiny-image.php CHANGED
@@ -57,15 +57,17 @@ class Tiny_Image {
57
  return;
58
  }
59
 
60
- $path_info = pathinfo( $this->wp_metadata['file'] );
61
- $this->name = $path_info['basename'];
62
-
63
  $upload_dir = wp_upload_dir();
64
  $path_prefix = $upload_dir['basedir'] . '/';
 
65
  if ( isset( $path_info['dirname'] ) ) {
66
  $path_prefix .= $path_info['dirname'] . '/';
67
  }
68
 
 
 
 
 
69
  $filename = $path_prefix . $this->name;
70
  $this->sizes[ self::ORIGINAL ] = new Tiny_Image_Size( $filename );
71
 
57
  return;
58
  }
59
 
 
 
 
60
  $upload_dir = wp_upload_dir();
61
  $path_prefix = $upload_dir['basedir'] . '/';
62
+ $path_info = pathinfo( $this->wp_metadata['file'] );
63
  if ( isset( $path_info['dirname'] ) ) {
64
  $path_prefix .= $path_info['dirname'] . '/';
65
  }
66
 
67
+ /* Do not use pathinfo for getting the filename.
68
+ It doesn't work when the filename starts with a special character. */
69
+ $path_parts = explode( '/', $this->wp_metadata['file'] );
70
+ $this->name = end( $path_parts );
71
  $filename = $path_prefix . $this->name;
72
  $this->sizes[ self::ORIGINAL ] = new Tiny_Image_Size( $filename );
73
 
src/class-tiny-plugin.php CHANGED
@@ -18,7 +18,7 @@
18
  * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
  */
20
  class Tiny_Plugin extends Tiny_WP_Base {
21
- const VERSION = '3.2.0';
22
  const MEDIA_COLUMN = self::NAME;
23
  const DATETIME_FORMAT = 'Y-m-d G:i:s';
24
 
@@ -375,6 +375,8 @@ class Tiny_Plugin extends Tiny_WP_Base {
375
  // dimensions of the original image can change. This will then
376
  // trigger other plugins and can result in unexpected behaviour and
377
  // further changes to the image. This may require another approach.
 
 
378
  wp_update_attachment_metadata( $attachment_id, $tiny_image->get_wp_metadata() );
379
  }
380
  }
@@ -419,6 +421,8 @@ class Tiny_Plugin extends Tiny_WP_Base {
419
  // dimensions of the original image can change. This will then
420
  // trigger other plugins and can result in unexpected behaviour and
421
  // further changes to the image. This may require another approach.
 
 
422
  wp_update_attachment_metadata( $id, $tiny_image->get_wp_metadata() );
423
 
424
  echo $this->render_compress_details( $tiny_image );
18
  * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
  */
20
  class Tiny_Plugin extends Tiny_WP_Base {
21
+ const VERSION = '3.2.1';
22
  const MEDIA_COLUMN = self::NAME;
23
  const DATETIME_FORMAT = 'Y-m-d G:i:s';
24
 
375
  // dimensions of the original image can change. This will then
376
  // trigger other plugins and can result in unexpected behaviour and
377
  // further changes to the image. This may require another approach.
378
+ // Note that as of WP 5.3 it is advised to not hook into this filter
379
+ // anymore, so other plugins are less likely to be triggered.
380
  wp_update_attachment_metadata( $attachment_id, $tiny_image->get_wp_metadata() );
381
  }
382
  }
421
  // dimensions of the original image can change. This will then
422
  // trigger other plugins and can result in unexpected behaviour and
423
  // further changes to the image. This may require another approach.
424
+ // Note that as of WP 5.3 it is advised to not hook into this filter
425
+ // anymore, so other plugins are less likely to be triggered.
426
  wp_update_attachment_metadata( $id, $tiny_image->get_wp_metadata() );
427
 
428
  echo $this->render_compress_details( $tiny_image );
src/css/admin.css CHANGED
@@ -146,11 +146,6 @@ div.tiny-account-status div.update {
146
  padding: 22px 28px;
147
  }
148
 
149
- div.tiny-account-status div.update input {
150
- padding-top: 5px;
151
- padding-bottom: 5px;
152
- }
153
-
154
  div.tiny-account-status div.upgrade {
155
  padding: 22px 28px;
156
  background-color: #f5f9fa;
146
  padding: 22px 28px;
147
  }
148
 
 
 
 
 
 
149
  div.tiny-account-status div.upgrade {
150
  padding: 22px 28px;
151
  background-color: #f5f9fa;
tiny-compress-images.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Compress JPEG & PNG images
4
  * Description: Speed up your website. Optimize your JPEG and PNG images automatically with TinyPNG.
5
- * Version: 3.2.0
6
  * Author: TinyPNG
7
  * Author URI: https://tinypng.com
8
  * Text Domain: tiny-compress-images
2
  /**
3
  * Plugin Name: Compress JPEG & PNG images
4
  * Description: Speed up your website. Optimize your JPEG and PNG images automatically with TinyPNG.
5
+ * Version: 3.2.1
6
  * Author: TinyPNG
7
  * Author URI: https://tinypng.com
8
  * Text Domain: tiny-compress-images