Smush Image Compression and Optimization - Version 2.4.3

Version Description

  • Fixed: * Image resizing not working on image upload
Download this release

Release Info

Developer UmeshSingla
Plugin Icon 128x128 Smush Image Compression and Optimization
Version 2.4.3
Comparing to
See all releases

Code changes from version 2.4.2 to 2.4.3

languages/wp-smushit.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the WP Smush package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WP Smush 2.4.2\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/wp-smushit\n"
7
- "POT-Creation-Date: 2016-07-26 08:16:24+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
2
  # This file is distributed under the same license as the WP Smush package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WP Smush 2.4.3\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/wp-smushit\n"
7
+ "POT-Creation-Date: 2016-07-28 11:46:46+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
lib/class-wp-smush-resize.php CHANGED
@@ -62,7 +62,7 @@ if ( ! class_exists( 'WpSmushResize' ) ) {
62
  *
63
  * @return bool
64
  */
65
- public function should_resize( $id = '' ) {
66
 
67
  //If resizing not enabled, or if both max width and height is set to 0, return
68
  if ( ! $this->resize_enabled || ( $this->max_w == 0 && $this->max_h == 0 ) ) {
@@ -105,7 +105,7 @@ if ( ! class_exists( 'WpSmushResize' ) ) {
105
  }
106
 
107
  //Get attachment metadata
108
- $meta = wp_get_attachment_metadata( $id );
109
 
110
  if( !empty( $meta['width'] ) && !empty( $meta['height'] ) ) {
111
  $oldW = $meta['width'];
@@ -144,7 +144,7 @@ if ( ! class_exists( 'WpSmushResize' ) ) {
144
  }
145
 
146
  //Check if the image should be resized or not
147
- $should_resize = $this->should_resize( $id );
148
 
149
  /**
150
  * Filter whether the uploaded image should be resized or not
62
  *
63
  * @return bool
64
  */
65
+ public function should_resize( $id = '', $meta = '' ) {
66
 
67
  //If resizing not enabled, or if both max width and height is set to 0, return
68
  if ( ! $this->resize_enabled || ( $this->max_w == 0 && $this->max_h == 0 ) ) {
105
  }
106
 
107
  //Get attachment metadata
108
+ $meta = empty( $meta ) ? wp_get_attachment_metadata( $id ) : $meta;
109
 
110
  if( !empty( $meta['width'] ) && !empty( $meta['height'] ) ) {
111
  $oldW = $meta['width'];
144
  }
145
 
146
  //Check if the image should be resized or not
147
+ $should_resize = $this->should_resize( $id, $meta );
148
 
149
  /**
150
  * Filter whether the uploaded image should be resized or not
readme.txt CHANGED
@@ -1,13 +1,13 @@
1
  === WP Smush - Image Optimization ===
2
  Plugin Name: WP Smush - Image Optimization
3
- Version: 2.4.2
4
  Author: WPMU DEV
5
  Author URI: http://premium.wpmudev.org/
6
  Contributors: WPMUDEV, alexdunae
7
  Tags: image optimization, image compression, attachment,Attachments,compress,Compress Image File,Compress Image Size,Compress JPG,Compressed JPG, Compression Image,Image,Images,JPG,Optimise,Optimize,Photo,Photos,Pictures,PNG,Reduce Image Size,Smush,Smush.it,Upload,WordPress Compression,WordPress Image Tool,Yahoo, Yahoo Smush.it
8
  Requires at least: 3.5
9
  Tested up to: 4.5.3
10
- Stable tag: 2.4.2
11
  License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
12
 
13
  Reduce image file sizes, improve performance and boost your SEO using the free <a href="https://premium.wpmudev.org/">WPMU DEV</a> WordPress Smush API.
@@ -92,6 +92,11 @@ Yahoo's Smush.it API is gone forever. So WPMU DEV built our own free API that is
92
 
93
  == Changelog ==
94
 
 
 
 
 
 
95
  = 2.4.2 =
96
 
97
  * Fixed:
1
  === WP Smush - Image Optimization ===
2
  Plugin Name: WP Smush - Image Optimization
3
+ Version: 2.4.3
4
  Author: WPMU DEV
5
  Author URI: http://premium.wpmudev.org/
6
  Contributors: WPMUDEV, alexdunae
7
  Tags: image optimization, image compression, attachment,Attachments,compress,Compress Image File,Compress Image Size,Compress JPG,Compressed JPG, Compression Image,Image,Images,JPG,Optimise,Optimize,Photo,Photos,Pictures,PNG,Reduce Image Size,Smush,Smush.it,Upload,WordPress Compression,WordPress Image Tool,Yahoo, Yahoo Smush.it
8
  Requires at least: 3.5
9
  Tested up to: 4.5.3
10
+ Stable tag: 2.4.3
11
  License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
12
 
13
  Reduce image file sizes, improve performance and boost your SEO using the free <a href="https://premium.wpmudev.org/">WPMU DEV</a> WordPress Smush API.
92
 
93
  == Changelog ==
94
 
95
+ = 2.4.3 =
96
+
97
+ * Fixed:
98
+ * Image resizing not working on image upload
99
+
100
  = 2.4.2 =
101
 
102
  * Fixed:
wp-smush.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: WP Smush
4
  Plugin URI: http://wordpress.org/extend/plugins/wp-smushit/
5
  Description: Reduce image file sizes, improve performance and boost your SEO using the free <a href="https://premium.wpmudev.org/">WPMU DEV</a> WordPress Smush API.
6
  Author: WPMU DEV
7
- Version: 2.4.2
8
  Author URI: http://premium.wpmudev.org/
9
  Textdomain: wp-smushit
10
  */
@@ -35,7 +35,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
35
  * Constants
36
  */
37
  $prefix = 'WP_SMUSH_';
38
- $version = '2.4.2';
39
 
40
  //Deactivate the .org version, if pro version is active
41
  add_action( 'admin_init', 'deactivate_smush_org' );
4
  Plugin URI: http://wordpress.org/extend/plugins/wp-smushit/
5
  Description: Reduce image file sizes, improve performance and boost your SEO using the free <a href="https://premium.wpmudev.org/">WPMU DEV</a> WordPress Smush API.
6
  Author: WPMU DEV
7
+ Version: 2.4.3
8
  Author URI: http://premium.wpmudev.org/
9
  Textdomain: wp-smushit
10
  */
35
  * Constants
36
  */
37
  $prefix = 'WP_SMUSH_';
38
+ $version = '2.4.3';
39
 
40
  //Deactivate the .org version, if pro version is active
41
  add_action( 'admin_init', 'deactivate_smush_org' );