Smush Image Compression and Optimization - Version 2.4.2

Version Description

  • Fixed: * PHP 5.2 compatibility
Download this release

Release Info

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

Code changes from version 2.4 to 2.4.2

assets/shared-ui/wdev-ui.css CHANGED
@@ -863,6 +863,9 @@
863
  .wpmud [tooltip].tooltip-right:after {
864
  margin-left: -180px;
865
  }
 
 
 
866
  .wpmud [tooltip].tooltip-s.tooltip-right:after {
867
  margin-left: -130px;
868
  }
863
  .wpmud [tooltip].tooltip-right:after {
864
  margin-left: -180px;
865
  }
866
+ .wpmud [tooltip].tooltip-left:after {
867
+ margin-left: -20px;
868
+ }
869
  .wpmud [tooltip].tooltip-s.tooltip-right:after {
870
  margin-left: -130px;
871
  }
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\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/wp-smushit\n"
7
- "POT-Creation-Date: 2016-07-26 05:38:33+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -86,7 +86,7 @@ msgid "Super-smush my images"
86
  msgstr ""
87
 
88
  #: lib/class-wp-smush-admin.php:175
89
- msgid "Compress images up to 10x more than regular smush with almost no visible drop in quality."
90
  msgstr ""
91
 
92
  #: lib/class-wp-smush-admin.php:178
@@ -251,23 +251,23 @@ msgstr ""
251
  msgid "Unable to smush image, %s"
252
  msgstr ""
253
 
254
- #: lib/class-wp-smush-share.php:29
255
  msgid "%s, you've smushed %d images and saved %s in total. Help your friends save bandwidth easily, and help me in my quest to Smush the internet!"
256
  msgstr ""
257
 
258
- #: lib/class-wp-smush-share.php:30
259
  msgid "I saved %s on my site with WP Smush ( %s ) - wanna make your website smaller and faster?"
260
  msgstr ""
261
 
262
- #: lib/class-wp-smush-share.php:39
263
  msgid "TWEET"
264
  msgstr ""
265
 
266
- #: lib/class-wp-smush-share.php:43
267
  msgid "SHARE"
268
  msgstr ""
269
 
270
- #: lib/class-wp-smush-share.php:47
271
  msgid "WhatsApp"
272
  msgstr ""
273
 
@@ -512,7 +512,7 @@ msgid "Yep, Super Smush your images for double the savings, save originals and b
512
  msgstr ""
513
 
514
  #: lib/class-wp-smush-ui.php:859
515
- msgid "Did you know WP Smush Pro delivers up to 10x better compression, allows you to smush your originals and removes any bulk smushing limits? – %sTry it absolutely FREE%s"
516
  msgstr ""
517
 
518
  #: lib/class-wp-smush-ui.php:859
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"
86
  msgstr ""
87
 
88
  #: lib/class-wp-smush-admin.php:175
89
+ msgid "Compress images up to 2x more than regular smush with almost no visible drop in quality."
90
  msgstr ""
91
 
92
  #: lib/class-wp-smush-admin.php:178
251
  msgid "Unable to smush image, %s"
252
  msgstr ""
253
 
254
+ #: lib/class-wp-smush-share.php:25
255
  msgid "%s, you've smushed %d images and saved %s in total. Help your friends save bandwidth easily, and help me in my quest to Smush the internet!"
256
  msgstr ""
257
 
258
+ #: lib/class-wp-smush-share.php:26
259
  msgid "I saved %s on my site with WP Smush ( %s ) - wanna make your website smaller and faster?"
260
  msgstr ""
261
 
262
+ #: lib/class-wp-smush-share.php:35
263
  msgid "TWEET"
264
  msgstr ""
265
 
266
+ #: lib/class-wp-smush-share.php:39
267
  msgid "SHARE"
268
  msgstr ""
269
 
270
+ #: lib/class-wp-smush-share.php:43
271
  msgid "WhatsApp"
272
  msgstr ""
273
 
512
  msgstr ""
513
 
514
  #: lib/class-wp-smush-ui.php:859
515
+ msgid "Did you know WP Smush Pro delivers up to 2x better compression, allows you to smush your originals and removes any bulk smushing limits? – %sTry it absolutely FREE%s"
516
  msgstr ""
517
 
518
  #: lib/class-wp-smush-ui.php:859
lib/class-wp-smush-admin.php CHANGED
@@ -133,7 +133,7 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
133
  add_action( 'admin_notices', array( $this, 'smush_upgrade' ) );
134
 
135
  // New Features Notice
136
- add_action( 'admin_notices', array( $this, 'smush_updated' ) );
137
 
138
  //Handle the smush pro dismiss features notice ajax
139
  add_action( 'wp_ajax_dismiss_upgrade_notice', array( $this, 'dismiss_upgrade_notice' ) );
@@ -172,7 +172,7 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
172
  ),
173
  'lossy' => array(
174
  'label' => esc_html__( 'Super-smush my images', 'wp-smushit' ),
175
- 'desc' => esc_html__( 'Compress images up to 10x more than regular smush with almost no visible drop in quality.', 'wp-smushit' )
176
  ),
177
  'original' => array(
178
  'label' => esc_html__( 'Include my original full-size images', 'wp-smushit' ),
@@ -450,7 +450,7 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
450
  $transparent_png['convert'] = isset( $_POST['wp-smush-png_to_jpg_transparent'] ) ? 1 : 0;
451
 
452
  //Validate Hexcode and Store it
453
- $transparent_png['background'] = isset( $_POST['wp-smush-png_to_jpg_background'] ) && ctype_xdigit( $_POST['wp-smush-png_to_jpg_background'] ) ? sanitize_hex_color_no_hash( $_POST['wp-smush-png_to_jpg_background'] ) : 'ffffff';
454
 
455
  //If background is not set, or length is not proper
456
  if ( empty( $transparent_png['background'] ) || strlen( $transparent_png['background'] ) < 6 ) {
133
  add_action( 'admin_notices', array( $this, 'smush_upgrade' ) );
134
 
135
  // New Features Notice
136
+ // add_action( 'admin_notices', array( $this, 'smush_updated' ) );
137
 
138
  //Handle the smush pro dismiss features notice ajax
139
  add_action( 'wp_ajax_dismiss_upgrade_notice', array( $this, 'dismiss_upgrade_notice' ) );
172
  ),
173
  'lossy' => array(
174
  'label' => esc_html__( 'Super-smush my images', 'wp-smushit' ),
175
+ 'desc' => esc_html__( 'Compress images up to 2x more than regular smush with almost no visible drop in quality.', 'wp-smushit' )
176
  ),
177
  'original' => array(
178
  'label' => esc_html__( 'Include my original full-size images', 'wp-smushit' ),
450
  $transparent_png['convert'] = isset( $_POST['wp-smush-png_to_jpg_transparent'] ) ? 1 : 0;
451
 
452
  //Validate Hexcode and Store it
453
+ $transparent_png['background'] = isset( $_POST['wp-smush-png_to_jpg_background'] ) && ctype_xdigit( $_POST['wp-smush-png_to_jpg_background'] ) ? smush_sanitize_hex_color_no_hash( $_POST['wp-smush-png_to_jpg_background'] ) : 'ffffff';
454
 
455
  //If background is not set, or length is not proper
456
  if ( empty( $transparent_png['background'] ) || strlen( $transparent_png['background'] ) < 6 ) {
lib/class-wp-smush-png_jpg.php CHANGED
@@ -157,14 +157,14 @@ if ( ! class_exists( 'WpSmushPngtoJpg' ) ) {
157
  * @return bool True/False Can be converted or not
158
  *
159
  */
160
- function can_be_converted( $id = '', $size = 'full' ) {
161
 
162
  if ( empty( $id ) ) {
163
  return false;
164
  }
165
 
166
  //False if not a PNG
167
- $mime = get_post_mime_type( $id );
168
  if ( 'image/png' != $mime ) {
169
  return false;
170
  }
@@ -459,7 +459,7 @@ if ( ! class_exists( 'WpSmushPngtoJpg' ) ) {
459
  foreach ( $meta['sizes'] as $size_k => $data ) {
460
 
461
  /** Whether to convert to jpg or not **/
462
- $should_convert = $this->can_be_converted( $id, $size_k );
463
 
464
  //Perform the conversion
465
  if ( ! $should_convert = apply_filters( 'wp_smush_convert_to_jpg', $should_convert, $id, $file, $size_k ) ) {
@@ -474,13 +474,8 @@ if ( ! class_exists( 'WpSmushPngtoJpg' ) ) {
474
  } else {
475
  $result = $this->convert_tpng_to_jpg( $id, $s_file, $result['meta'], $size_k );
476
  }
477
-
478
- //If there are savings
479
- if ( ! empty( $result['savings'] ) ) {
480
- //Add all the stats
481
- array_walk_recursive( $result['savings'], function ( $item, $key ) use ( &$savings, $size_k ) {
482
- $savings[ $size_k ][ $key ] = isset( $savings[ $size_k ][ $key ] ) ? $item + $savings[ $size_k ][ $key ] : $item;
483
- } );
484
  }
485
  }
486
  }
157
  * @return bool True/False Can be converted or not
158
  *
159
  */
160
+ function can_be_converted( $id = '', $size = 'full', $mime = '' ) {
161
 
162
  if ( empty( $id ) ) {
163
  return false;
164
  }
165
 
166
  //False if not a PNG
167
+ $mime = empty( $mime ) ? get_post_mime_type( $id ) : $mime;
168
  if ( 'image/png' != $mime ) {
169
  return false;
170
  }
459
  foreach ( $meta['sizes'] as $size_k => $data ) {
460
 
461
  /** Whether to convert to jpg or not **/
462
+ $should_convert = $this->can_be_converted( $id, $size_k, 'image/png' );
463
 
464
  //Perform the conversion
465
  if ( ! $should_convert = apply_filters( 'wp_smush_convert_to_jpg', $should_convert, $id, $file, $size_k ) ) {
474
  } else {
475
  $result = $this->convert_tpng_to_jpg( $id, $s_file, $result['meta'], $size_k );
476
  }
477
+ if( !empty( $result['savings'] ) ) {
478
+ $savings[ $size_k ] = $result['savings'];
 
 
 
 
 
479
  }
480
  }
481
  }
lib/class-wp-smush-share.php CHANGED
@@ -11,11 +11,7 @@
11
  if ( ! class_exists( 'WpSmushShare' ) ) {
12
 
13
  class WpSmushShare {
14
- function __construct() {
15
- add_filter( 'language_attributes', array( $this, 'add_opengraph_doctype' ) );
16
- add_action( 'admin_head', array( $this, 'insert_fb_in_head' ), 5 );
17
- // add_action( 'admin_enqueue_scripts', array( $this, 'insert_fb_js' ), 5 );
18
- }
19
 
20
  function share_widget() {
21
  global $wpsmushit_admin, $wpsmush_stats;
@@ -50,56 +46,6 @@ if ( ! class_exists( 'WpSmushShare' ) ) {
50
  </section><?php
51
  }
52
 
53
- //Lets add Open Graph Meta Info
54
-
55
- function insert_fb_in_head() {
56
- if ( ! function_exists( 'get_current_screen' ) ) {
57
- return;
58
- }
59
- $current_screen = get_current_screen();
60
- $current_page = $current_screen->base;
61
- if ( 'media_page_wp-smush-bulk' != $current_page ) {
62
- return;
63
- }
64
- echo '<meta property="og:url" content="https://wordpress.org/plugins/wp-smushit/"/>';
65
- echo '<meta property="og:type" content="article"/>';
66
- echo '<meta property="og:title" content="I saved 6.5MB on my site with WP Smush - wanna make your website smaller and faster?"/>';
67
- echo '<meta property="og:description" content="Resize and optimize all of your images with the incredibly powerful and 100% free image smusher, brought to you by the superteam at WPMU DEV!"/>';
68
- }
69
-
70
- //Adding the Open Graph in the Language Attributes
71
- function add_opengraph_doctype( $output ) {
72
- if ( ! function_exists( 'get_current_screen' ) ) {
73
- return;
74
- }
75
-
76
- $current_screen = get_current_screen();
77
- if ( empty( $current_screen ) ) {
78
- return;
79
- }
80
-
81
- $current_page = $current_screen->base;
82
- if ( 'media_page_wp-smush-bulk' != $current_page ) {
83
- return;
84
- }
85
-
86
- return $output . ' xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"';
87
- }
88
-
89
- function insert_fb_js() { ?>
90
- <!-- Comment #2: SDK -->
91
- <div id="fb-root"></div>
92
- <script>(function (d, s, id) {
93
- var js, fjs = d.getElementsByTagName(s)[0];
94
- if (d.getElementById(id)) return;
95
- js = d.createElement(s);
96
- js.id = id;
97
- js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.6";
98
- fjs.parentNode.insertBefore(js, fjs);
99
- }(document, 'script', 'facebook-jssdk'));</script><?php
100
-
101
- }
102
-
103
  }
104
 
105
  global $wpsmush_share;
11
  if ( ! class_exists( 'WpSmushShare' ) ) {
12
 
13
  class WpSmushShare {
14
+ function __construct() {}
 
 
 
 
15
 
16
  function share_widget() {
17
  global $wpsmushit_admin, $wpsmush_stats;
46
  </section><?php
47
  }
48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  }
50
 
51
  global $wpsmush_share;
lib/class-wp-smush-stats.php CHANGED
@@ -346,9 +346,12 @@ if ( ! class_exists( 'WpSmushStats' ) ) {
346
  if ( ! is_array( $size_savings ) ) {
347
  continue;
348
  }
349
- $savings['bytes'] += $size_savings['bytes'];
350
- $savings['size_before'] += $size_savings['size_before'];
351
- $savings['size_after'] += $size_savings['size_after'];
 
 
 
352
  }
353
  }
354
  }
346
  if ( ! is_array( $size_savings ) ) {
347
  continue;
348
  }
349
+ //If we have savings, add all the stats
350
+ if( !empty( $size_savings['bytes'])) {
351
+ $savings['bytes'] += $size_savings['bytes'];
352
+ $savings['size_before'] += $size_savings['size_before'];
353
+ $savings['size_after'] += $size_savings['size_after'];
354
+ }
355
  }
356
  }
357
  }
lib/class-wp-smush-ui.php CHANGED
@@ -856,7 +856,7 @@ if ( ! class_exists( 'WpSmushBulkUi' ) ) {
856
  ); ?>
857
  <div class="wp-smush-super-smush-promo">
858
  <div class="wp-smush-super-smush-content"><?php
859
- printf( esc_html__("Did you know WP Smush Pro delivers up to 10x better compression, allows you to smush your originals and removes any bulk smushing limits? – %sTry it absolutely FREE%s", "wp-smushit"), '<a href="' . esc_url( $upgrade_url ). '" target="_blank" title="' . esc_html__("Try WP Smush Pro for FREE", "wp-smushit") . '">', '</a>' ); ?>
860
  </div>
861
  </div>
862
  <?php
856
  ); ?>
857
  <div class="wp-smush-super-smush-promo">
858
  <div class="wp-smush-super-smush-content"><?php
859
+ printf( esc_html__("Did you know WP Smush Pro delivers up to 2x better compression, allows you to smush your originals and removes any bulk smushing limits? – %sTry it absolutely FREE%s", "wp-smushit"), '<a href="' . esc_url( $upgrade_url ). '" target="_blank" title="' . esc_html__("Try WP Smush Pro for FREE", "wp-smushit") . '">', '</a>' ); ?>
860
  </div>
861
  </div>
862
  <?php
readme.txt CHANGED
@@ -1,13 +1,13 @@
1
  === WP Smush - Image Optimization ===
2
  Plugin Name: WP Smush - Image Optimization
3
- Version: 2.4
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
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.
@@ -34,7 +34,7 @@ WP Smush meticulously scans every image you upload – or have already added to
34
  ★★★★★ <br>
35
  “I optimize my photos in Photoshop, but Smush makes it so easy – it does it automatically. I can just sit back and enjoy the speed.” - <a href="https://profiles.wordpress.org/helen432">helen432</a>
36
 
37
- WP Smush is super easy to use – no confusing compression software settings! Smush images in your library one at a time or bulk smush up to 50 images at a time. Plus, Smush can help keep your site running fast. Use automatic smush to scale and compress every new image upload without thinking about it.
38
 
39
  The faster your site loads, the more Google, Bing, Yahoo and other search engines will like it. Your site will load faster and rank higher.
40
 
@@ -63,6 +63,7 @@ WP Smush Pro gives you everything you'll find in WP Smush and more:
63
  <li>Get even better lossless compression. We try multiple methods to squeeze every last byte out of your images.</li>
64
  <li>Smush images up to 32MB. Now you can smush any image, even one’s that aren’t web optimized.</li>
65
  <li>Bulk smush ALL your images with one click - no more rate limiting!</li>
 
66
  <li>Keep a backup of original un-smushed images in case you want to restore later.</li>
67
  <li>24/7/365 support from the best WordPress support team on the planet.</li>
68
  <li>Includes Hummingbird pagespeed booster, Uptime monitoring and security hardening.</li>
@@ -91,6 +92,15 @@ Yahoo's Smush.it API is gone forever. So WPMU DEV built our own free API that is
91
 
92
  == Changelog ==
93
 
 
 
 
 
 
 
 
 
 
94
  = 2.4 =
95
 
96
  * Compatibility:
@@ -104,7 +114,7 @@ Yahoo's Smush.it API is gone forever. So WPMU DEV built our own free API that is
104
 
105
  * Updated:
106
  * Minor Tweaks on WP Smush Page ( Bulk Smush )
107
- * Stats calculation
108
  * Show current image size and image size dimensions in media library after image has been smushed
109
  * JPEG optimisation - higher savings for JPEGs lossy optimisation ( Pro Feature )
110
 
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.
34
  ★★★★★ <br>
35
  “I optimize my photos in Photoshop, but Smush makes it so easy – it does it automatically. I can just sit back and enjoy the speed.” - <a href="https://profiles.wordpress.org/helen432">helen432</a>
36
 
37
+ WP Smush is super easy to use – no confusing compression software settings! Smush images in your library one at a time or bulk smush up to 50 images at a time. Plus, configure automatic smush to scale and compress some or all of your images as they are being uploaded.
38
 
39
  The faster your site loads, the more Google, Bing, Yahoo and other search engines will like it. Your site will load faster and rank higher.
40
 
63
  <li>Get even better lossless compression. We try multiple methods to squeeze every last byte out of your images.</li>
64
  <li>Smush images up to 32MB. Now you can smush any image, even one’s that aren’t web optimized.</li>
65
  <li>Bulk smush ALL your images with one click - no more rate limiting!</li>
66
+ <li>Automatically convert PNG files to lossy JPEG if extra savings are found.</li>
67
  <li>Keep a backup of original un-smushed images in case you want to restore later.</li>
68
  <li>24/7/365 support from the best WordPress support team on the planet.</li>
69
  <li>Includes Hummingbird pagespeed booster, Uptime monitoring and security hardening.</li>
92
 
93
  == Changelog ==
94
 
95
+ = 2.4.2 =
96
+
97
+ * Fixed:
98
+ * PHP 5.2 compatibility
99
+
100
+ = 2.4.1 =
101
+
102
+ * Fixed: Conflict with Customizer
103
+
104
  = 2.4 =
105
 
106
  * Compatibility:
114
 
115
  * Updated:
116
  * Minor Tweaks on WP Smush Page ( Bulk Smush )
117
+ * Stats calculation is more accurate
118
  * Show current image size and image size dimensions in media library after image has been smushed
119
  * JPEG optimisation - higher savings for JPEGs lossy optimisation ( Pro Feature )
120
 
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
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';
39
 
40
  //Deactivate the .org version, if pro version is active
41
  add_action( 'admin_init', 'deactivate_smush_org' );
@@ -231,7 +231,7 @@ if ( ! function_exists( 'smush_activated' ) ) {
231
  }
232
 
233
 
234
- if ( ! function_exists( 'sanitize_hex_color' ) ) {
235
  /**
236
  * Sanitizes a hex color.
237
  *
@@ -239,7 +239,7 @@ if ( ! function_exists( 'sanitize_hex_color' ) ) {
239
  *
240
  * @return string Returns either '', a 3 or 6 digit hex color (with #), or nothing
241
  */
242
- function sanitize_hex_color( $color ) {
243
  if ( '' === $color ) {
244
  return '';
245
  }
@@ -251,7 +251,7 @@ if ( ! function_exists( 'sanitize_hex_color' ) ) {
251
  }
252
  }
253
 
254
- if ( ! function_exists( 'sanitize_hex_color_no_hash' ) ) {
255
  /**
256
  * Sanitizes a hex color without hash
257
  *
@@ -259,14 +259,14 @@ if ( ! function_exists( 'sanitize_hex_color_no_hash' ) ) {
259
  *
260
  * @return string Returns either '', a 3 or 6 digit hex color (with #), or nothing
261
  */
262
- function sanitize_hex_color_no_hash( $color ) {
263
  $color = ltrim( $color, '#' );
264
 
265
  if ( '' === $color ) {
266
  return '';
267
  }
268
 
269
- return sanitize_hex_color( '#' . $color ) ? $color : null;
270
  }
271
  }
272
 
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
  * 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' );
231
  }
232
 
233
 
234
+ if ( ! function_exists( 'smush_sanitize_hex_color' ) ) {
235
  /**
236
  * Sanitizes a hex color.
237
  *
239
  *
240
  * @return string Returns either '', a 3 or 6 digit hex color (with #), or nothing
241
  */
242
+ function smush_sanitize_hex_color( $color ) {
243
  if ( '' === $color ) {
244
  return '';
245
  }
251
  }
252
  }
253
 
254
+ if ( ! function_exists( 'smush_sanitize_hex_color_no_hash' ) ) {
255
  /**
256
  * Sanitizes a hex color without hash
257
  *
259
  *
260
  * @return string Returns either '', a 3 or 6 digit hex color (with #), or nothing
261
  */
262
+ function smush_sanitize_hex_color_no_hash( $color ) {
263
  $color = ltrim( $color, '#' );
264
 
265
  if ( '' === $color ) {
266
  return '';
267
  }
268
 
269
+ return smush_sanitize_hex_color( '#' . $color ) ? $color : null;
270
  }
271
  }
272