Compress JPEG & PNG images - Version 2.2.5

Version Description

  • Fixed bug in bulk optimization page that could sometimes cause it to stop.
  • Fixed a problem that would prevent dashboard widget from loading.
  • Tweaked styling of the dashboard widget for the latest version of WordPress.
  • Fixed a warning that sometimes occurred in the media library when certain plugins are used.
Download this release

Release Info

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

Code changes from version 2.2.4 to 2.2.5

readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://tinypng.com/
4
  Tags: optimize, compress, shrink, resize, faster, fit, scale, improve, images, tinypng, tinyjpg, jpeg, jpg, png, lossy, jpegmini, crunch, minify, smush, save, bandwidth, website, speed, performance, panda, wordpress app
5
  Requires at least: 3.0.6
6
  Tested up to: 4.8
7
- Stable tag: 2.2.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -110,6 +110,12 @@ A: Everything will keep on working, but newly uploaded images will not be optimi
110
  A: Yes! After installing the plugin, go to *Media > Bulk Optimization*, and click on the start button to optimize all unoptimized images in your media library.
111
 
112
  == Changelog ==
 
 
 
 
 
 
113
  = 2.2.4 =
114
  * Fixed bug with drop-down menu in the Media Library.
115
  * Compression limit notice now links directly to your API dashboard.
4
  Tags: optimize, compress, shrink, resize, faster, fit, scale, improve, images, tinypng, tinyjpg, jpeg, jpg, png, lossy, jpegmini, crunch, minify, smush, save, bandwidth, website, speed, performance, panda, wordpress app
5
  Requires at least: 3.0.6
6
  Tested up to: 4.8
7
+ Stable tag: 2.2.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
110
  A: Yes! After installing the plugin, go to *Media > Bulk Optimization*, and click on the start button to optimize all unoptimized images in your media library.
111
 
112
  == Changelog ==
113
+ = 2.2.5 =
114
+ * Fixed bug in bulk optimization page that could sometimes cause it to stop.
115
+ * Fixed a problem that would prevent dashboard widget from loading.
116
+ * Tweaked styling of the dashboard widget for the latest version of WordPress.
117
+ * Fixed a warning that sometimes occurred in the media library when certain plugins are used.
118
+
119
  = 2.2.4 =
120
  * Fixed bug with drop-down menu in the Media Library.
121
  * Compression limit notice now links directly to your API dashboard.
src/class-tiny-image.php CHANGED
@@ -45,6 +45,12 @@ class Tiny_Image {
45
  if ( ! is_array( $this->wp_metadata ) ) {
46
  return;
47
  }
 
 
 
 
 
 
48
  $path_info = pathinfo( $this->wp_metadata['file'] );
49
  $this->name = $path_info['basename'];
50
 
45
  if ( ! is_array( $this->wp_metadata ) ) {
46
  return;
47
  }
48
+ if ( ! isset( $this->wp_metadata['file'] ) ) {
49
+ /* No file metadata found, this might be another plugin messing with
50
+ metadata. Simply ignore this! */
51
+ return;
52
+ }
53
+
54
  $path_info = pathinfo( $this->wp_metadata['file'] );
55
  $this->name = $path_info['basename'];
56
 
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 = '2.2.4';
22
  const MEDIA_COLUMN = self::NAME;
23
  const DATETIME_FORMAT = 'Y-m-d G:i:s';
24
 
@@ -466,6 +466,13 @@ class Tiny_Plugin extends Tiny_WP_Base {
466
  array(), self::version(), true
467
  );
468
 
 
 
 
 
 
 
 
469
  wp_enqueue_script( self::NAME . '_dashboard_widget' );
470
 
471
  wp_add_dashboard_widget(
18
  * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
  */
20
  class Tiny_Plugin extends Tiny_WP_Base {
21
+ const VERSION = '2.2.5';
22
  const MEDIA_COLUMN = self::NAME;
23
  const DATETIME_FORMAT = 'Y-m-d G:i:s';
24
 
466
  array(), self::version(), true
467
  );
468
 
469
+ /* This might be deduplicated with the admin script localization, but
470
+ the order of including scripts is sometimes different. So in that
471
+ case we need to make sure that the order of inclusion is correc.t */
472
+ wp_localize_script( self::NAME . '_dashboard_widget', 'tinyCompressDashboard', array(
473
+ 'nonce' => wp_create_nonce( 'tiny-compress' ),
474
+ ));
475
+
476
  wp_enqueue_script( self::NAME . '_dashboard_widget' );
477
 
478
  wp_add_dashboard_widget(
src/css/dashboard-widget.css CHANGED
@@ -123,3 +123,7 @@ div.tiny_dashboard_widget.full-optimized div.inside.mobile div#optimization-char
123
  position: relative;
124
  z-index: 1;
125
  }
 
 
 
 
123
  position: relative;
124
  z-index: 1;
125
  }
126
+
127
+ #tinypng_dashboard_widget > button.handlediv {
128
+ margin-top: 0;
129
+ }
src/js/bulk-optimization.js CHANGED
@@ -62,9 +62,11 @@
62
  row.addClass("failed")
63
  row.find(".status").html(tinyCompress.L10nInternalError + "<br>" + error.toString())
64
  row.find(".status").attr("title", error.toString())
 
65
  } else if (data == null) {
66
  row.addClass("failed")
67
- row.find(".status").html(tinyCompress.L10nCancelled)
 
68
  } else if (data.error) {
69
  row.addClass("failed")
70
  row.find(".status").html(tinyCompress.L10nError + "<br>" + data.error)
62
  row.addClass("failed")
63
  row.find(".status").html(tinyCompress.L10nInternalError + "<br>" + error.toString())
64
  row.find(".status").attr("title", error.toString())
65
+ data = {}
66
  } else if (data == null) {
67
  row.addClass("failed")
68
+ row.find(".status").html(tinyCompress.L10nError)
69
+ data = {}
70
  } else if (data.error) {
71
  row.addClass("failed")
72
  row.find(".status").html(tinyCompress.L10nError + "<br>" + data.error)
src/js/dashboard-widget.js CHANGED
@@ -14,7 +14,7 @@
14
  url: ajaxurl,
15
  type: 'POST',
16
  data: {
17
- _nonce: tinyCompress.nonce,
18
  action: 'tiny_get_optimization_statistics',
19
  id: '#tinypng_dashboard_widget'
20
  },
14
  url: ajaxurl,
15
  type: 'POST',
16
  data: {
17
+ _nonce: tinyCompressDashboard.nonce,
18
  action: 'tiny_get_optimization_statistics',
19
  id: '#tinypng_dashboard_widget'
20
  },
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: 2.2.4
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: 2.2.5
6
  * Author: TinyPNG
7
  * Author URI: https://tinypng.com
8
  * Text Domain: tiny-compress-images