ShortPixel Image Optimizer - Version 3.3.4

Version Description

  • Fix Settings Resources display
  • Add user and password authentication option for downloading images
  • fix for PHP installs that lack utf8_encode function
  • retry from the optimize Ajax post when server sends a 500 error
Download this release

Release Info

Developer ShortPixel
Plugin Icon 128x128 ShortPixel Image Optimizer
Version 3.3.4
Comparing to
See all releases

Code changes from version 3.3.3 to 3.3.4

js/short-pixel.js CHANGED
@@ -46,6 +46,13 @@ var ShortPixel = function() {
46
  }
47
  }
48
 
 
 
 
 
 
 
 
49
  function dismissMediaAlert() {
50
  var data = { action : 'shortpixel_dismiss_media_alert'};
51
  jQuery.get(ajaxurl, data, function(response) {
@@ -67,12 +74,25 @@ var ShortPixel = function() {
67
  }
68
  }
69
 
 
 
 
 
 
 
 
 
 
 
 
70
  return {
71
  setOptions : setOptions,
72
  checkThumbsUpdTotal : checkThumbsUpdTotal,
73
  switchSettingsTab : switchSettingsTab,
 
74
  onBulkThumbsCheck : onBulkThumbsCheck,
75
- dismissMediaAlert : dismissMediaAlert
 
76
  }
77
  }();
78
 
@@ -175,114 +195,115 @@ function checkBulkProgress() {
175
  function checkBulkProcessingCallApi(){
176
  var data = { 'action': 'shortpixel_image_processing' };
177
  // since WP 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
178
- jQuery.post(ajaxurl, data, function(response)
179
- {
180
- if(response.length > 0) {
181
- var data = null;
182
- try {
183
- var data = JSON.parse(response);
184
- } catch (e) {
185
- ShortPixel.retries++;
186
- if(isNaN(ShortPixel.retries)) ShortPixel.retries = 1;
187
- if(ShortPixel.retries < 6) {
188
- console.log("Invalid response from server. Retrying pass " + (ShortPixel.retries + 1) + "...");
189
- setTimeout(checkBulkProgress, 5000);
190
- } else {
191
- console.log("Invalid response from server 6 times. Giving up.");
192
  }
193
- return;
194
- }
195
- var id = data["ImageID"];
196
-
197
- var isBulkPage = (jQuery("div.short-pixel-bulk-page").length > 0);
198
 
199
- switch (data["Status"]) {
200
- case ShortPixel.STATUS_NO_KEY:
201
- setCellMessage(id, data["Message"] + " | <a href=\"https://shortpixel.com/wp-apikey\" target=\"_blank\">Get API Key</a>");
202
- showToolBarAlert(ShortPixel.STATUS_NO_KEY);
203
- break;
204
- case ShortPixel.STATUS_QUOTA_EXCEEDED:
205
- setCellMessage(id, "<div class='sp-column-actions' style='width:110px;'><a class='button button-smaller button-primary' href=\"https://shortpixel.com/login/"
206
- + ShortPixel.API_KEY + "\" target=\"_blank\">Extend Quota</a>"
207
- + "<a class='button button-smaller' href='admin.php?action=shortpixel_check_quota'>Check&nbsp;&nbsp;Quota</a></div>"
208
- + "<div class='sp-column-info'>" + data["Message"] + "</div>" );
209
- showToolBarAlert(ShortPixel.STATUS_QUOTA_EXCEEDED);
210
- break;
211
- case ShortPixel.STATUS_FAIL:
212
- setCellMessage(id, data["Message"]);
213
- if(isBulkPage) {
214
- showToolBarAlert(ShortPixel.STATUS_FAIL, data["Message"]);
215
- progressUpdate(data["BulkPercent"], data["BulkMsg"]);
216
- }
217
- console.log(data["Message"]);
218
- setTimeout(checkBulkProgress, 5000);
219
- break;
220
- case ShortPixel.STATUS_EMPTY_QUEUE:
221
- console.log(data["Message"]);
222
- clearBulkProcessor(); //nothing to process, leave the role. Next page load will check again
223
- hideToolBarAlert();
224
- var progress = jQuery("#bulk-progress");
225
- if(isBulkPage && progress.length && data["BulkStatus"] != '2') {
226
- progressUpdate(100, "Bulk finished!");
227
- jQuery("a.bulk-cancel").attr("disabled", "disabled");
228
- hideSlider();
229
- //showStats();
230
- setTimeout(function(){
231
- window.location.reload();
232
- }, 3000);
233
- }
234
- break;
235
- case ShortPixel.STATUS_SUCCESS:
236
- var percent = data["PercentImprovement"];
237
- var otherType = data["Type"].length > 0 ? (data["Type"] == "lossy" ? "lossless" : "lossy") : "";
238
-
239
- var cellMsg = (percent > 0 ? "<div class='sp-column-info'>Reduced by <span class='percent'>" + percent + "%</span> " : "")
240
- + (percent > 0 && percent < 5 ? "<br>" : '')
241
- + (percent < 5 ? "Bonus processing" : '')
242
- + (data["Type"].length > 0 ? " ("+data["Type"]+")" : "")
243
- + (0 + data['ThumbsCount'] > 0 ? "<br>+" + data['ThumbsCount'] + " thumbnails optimized" :"")
244
- + "</div>";
245
-
246
- if(data["BackupEnabled"] == 1) {
247
- cellMsg = '<div class="sp-column-actions">'
248
- + (data["ThumbsTotal"] > data["ThumbsCount"] ? "<a class='button button-smaller button-primary' href=\"javascript:optimizeThumbs(" + id + ");\">Optimize " + (data["ThumbsTotal"] - data["ThumbsCount"]) + " thumbnails</a>" : "")
249
- + (otherType.length ? "<a class='button button-smaller' href=\"javascript:reoptimize(" + id + ", '" + otherType + "');\">Re-optimize " + otherType + "</a>" : "")
250
- + "<a class='button button-smaller' href=\"admin.php?action=shortpixel_restore_backup&attachment_ID=" + id + ")\">Restore backup</a>"
251
- + "</div>" + cellMsg;
252
- }
253
-
254
- showToolBarAlert(ShortPixel.STATUS_SUCCESS, "");
255
- setCellMessage(id, cellMsg);
256
- var animator = new PercentageAnimator("#sp-msg-" + id + " span.percent", percent);
257
- animator.animate(percent);
258
- if(isBulkPage && typeof data["Thumb"] !== 'undefined') { // && data["PercentImprovement"] > 0) {
259
- progressUpdate(data["BulkPercent"], data["BulkMsg"]);
260
- if(data["Thumb"].length > 0){
261
- sliderUpdate(id, data["Thumb"], data["BkThumb"], data["PercentImprovement"]);
262
- }
263
- }
264
- console.log('Server response: ' + response);
265
- if(isBulkPage && typeof data["BulkPercent"] !== 'undefined') {
266
- progressUpdate(data["BulkPercent"], data["BulkMsg"]);
267
- }
268
- setTimeout(checkBulkProgress, 5000);
269
- break;
270
-
271
- case ShortPixel.STATUS_ERROR: //for error and skip also we retry
272
- case ShortPixel.STATUS_SKIP:
273
- if(typeof data["Message"] !== 'undefined') {
274
- showToolBarAlert(ShortPixel.STATUS_SKIP, data["Message"] + ' Image ID: ' + id);
275
  setCellMessage(id, data["Message"]);
276
- }
277
- case ShortPixel.STATUS_RETRY:
278
- console.log('Server response: ' + response);
279
- showToolBarAlert(ShortPixel.STATUS_RETRY, "");
280
- if(isBulkPage && typeof data["BulkPercent"] !== 'undefined') {
281
- progressUpdate(data["BulkPercent"], data["BulkMsg"]);
282
- }
283
- setTimeout(checkBulkProgress, 5000);
284
- break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
285
  }
 
 
 
286
  }
287
  });
288
  }
46
  }
47
  }
48
 
49
+ function adjustSettingsTabsHeight(){
50
+ var sectionHeight = jQuery('#wp_shortpixel_options').height() + 60;
51
+ sectionHeight = Math.max(sectionHeight, jQuery('section#tab-resources .area1').height() + 20);
52
+ jQuery('#shortpixel-settings-tabs').css('height', sectionHeight);
53
+ jQuery('#shortpixel-settings-tabs section').css('height', sectionHeight);
54
+ }
55
+
56
  function dismissMediaAlert() {
57
  var data = { action : 'shortpixel_dismiss_media_alert'};
58
  jQuery.get(ajaxurl, data, function(response) {
74
  }
75
  }
76
 
77
+ function retry(msg) {
78
+ ShortPixel.retries++;
79
+ if(isNaN(ShortPixel.retries)) ShortPixel.retries = 1;
80
+ if(ShortPixel.retries < 6) {
81
+ console.log("Invalid response from server (Error: " + msg + "). Retrying pass " + (ShortPixel.retries + 1) + "...");
82
+ setTimeout(checkBulkProgress, 5000);
83
+ } else {
84
+ console.log("Invalid response from server 6 times. Giving up.");
85
+ }
86
+ }
87
+
88
  return {
89
  setOptions : setOptions,
90
  checkThumbsUpdTotal : checkThumbsUpdTotal,
91
  switchSettingsTab : switchSettingsTab,
92
+ adjustSettingsTabs : adjustSettingsTabsHeight,
93
  onBulkThumbsCheck : onBulkThumbsCheck,
94
+ dismissMediaAlert : dismissMediaAlert,
95
+ retry : retry
96
  }
97
  }();
98
 
195
  function checkBulkProcessingCallApi(){
196
  var data = { 'action': 'shortpixel_image_processing' };
197
  // since WP 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
198
+ jQuery.ajax({
199
+ type: "POST",
200
+ url: ajaxurl,
201
+ data: data,
202
+ success: function(response)
203
+ {
204
+ if(response.length > 0) {
205
+ var data = null;
206
+ try {
207
+ var data = JSON.parse(response);
208
+ } catch (e) {
209
+ ShortPixel.retry(e.message);
210
+ return;
 
211
  }
212
+ var id = data["ImageID"];
213
+
214
+ var isBulkPage = (jQuery("div.short-pixel-bulk-page").length > 0);
 
 
215
 
216
+ switch (data["Status"]) {
217
+ case ShortPixel.STATUS_NO_KEY:
218
+ setCellMessage(id, data["Message"] + " | <a href=\"https://shortpixel.com/wp-apikey\" target=\"_blank\">Get API Key</a>");
219
+ showToolBarAlert(ShortPixel.STATUS_NO_KEY);
220
+ break;
221
+ case ShortPixel.STATUS_QUOTA_EXCEEDED:
222
+ setCellMessage(id, "<div class='sp-column-actions' style='width:110px;'><a class='button button-smaller button-primary' href=\"https://shortpixel.com/login/"
223
+ + ShortPixel.API_KEY + "\" target=\"_blank\">Extend Quota</a>"
224
+ + "<a class='button button-smaller' href='admin.php?action=shortpixel_check_quota'>Check&nbsp;&nbsp;Quota</a></div>"
225
+ + "<div class='sp-column-info'>" + data["Message"] + "</div>" );
226
+ showToolBarAlert(ShortPixel.STATUS_QUOTA_EXCEEDED);
227
+ break;
228
+ case ShortPixel.STATUS_FAIL:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  setCellMessage(id, data["Message"]);
230
+ if(isBulkPage) {
231
+ showToolBarAlert(ShortPixel.STATUS_FAIL, data["Message"]);
232
+ progressUpdate(data["BulkPercent"], data["BulkMsg"]);
233
+ }
234
+ console.log(data["Message"]);
235
+ setTimeout(checkBulkProgress, 5000);
236
+ break;
237
+ case ShortPixel.STATUS_EMPTY_QUEUE:
238
+ console.log(data["Message"]);
239
+ clearBulkProcessor(); //nothing to process, leave the role. Next page load will check again
240
+ hideToolBarAlert();
241
+ var progress = jQuery("#bulk-progress");
242
+ if(isBulkPage && progress.length && data["BulkStatus"] != '2') {
243
+ progressUpdate(100, "Bulk finished!");
244
+ jQuery("a.bulk-cancel").attr("disabled", "disabled");
245
+ hideSlider();
246
+ //showStats();
247
+ setTimeout(function(){
248
+ window.location.reload();
249
+ }, 3000);
250
+ }
251
+ break;
252
+ case ShortPixel.STATUS_SUCCESS:
253
+ var percent = data["PercentImprovement"];
254
+ var otherType = data["Type"].length > 0 ? (data["Type"] == "lossy" ? "lossless" : "lossy") : "";
255
+
256
+ var cellMsg = (percent > 0 ? "<div class='sp-column-info'>Reduced by <span class='percent'>" + percent + "%</span> " : "")
257
+ + (percent > 0 && percent < 5 ? "<br>" : '')
258
+ + (percent < 5 ? "Bonus processing" : '')
259
+ + (data["Type"].length > 0 ? " ("+data["Type"]+")" : "")
260
+ + (0 + data['ThumbsCount'] > 0 ? "<br>+" + data['ThumbsCount'] + " thumbnails optimized" :"")
261
+ + "</div>";
262
+
263
+ if(data["BackupEnabled"] == 1) {
264
+ cellMsg = '<div class="sp-column-actions">'
265
+ + (data["ThumbsTotal"] > data["ThumbsCount"] ? "<a class='button button-smaller button-primary' href=\"javascript:optimizeThumbs(" + id + ");\">Optimize " + (data["ThumbsTotal"] - data["ThumbsCount"]) + " thumbnails</a>" : "")
266
+ + (otherType.length ? "<a class='button button-smaller' href=\"javascript:reoptimize(" + id + ", '" + otherType + "');\">Re-optimize " + otherType + "</a>" : "")
267
+ + "<a class='button button-smaller' href=\"admin.php?action=shortpixel_restore_backup&attachment_ID=" + id + ")\">Restore backup</a>"
268
+ + "</div>" + cellMsg;
269
+ }
270
+
271
+ showToolBarAlert(ShortPixel.STATUS_SUCCESS, "");
272
+ setCellMessage(id, cellMsg);
273
+ var animator = new PercentageAnimator("#sp-msg-" + id + " span.percent", percent);
274
+ animator.animate(percent);
275
+ if(isBulkPage && typeof data["Thumb"] !== 'undefined') { // && data["PercentImprovement"] > 0) {
276
+ progressUpdate(data["BulkPercent"], data["BulkMsg"]);
277
+ if(data["Thumb"].length > 0){
278
+ sliderUpdate(id, data["Thumb"], data["BkThumb"], data["PercentImprovement"]);
279
+ }
280
+ }
281
+ console.log('Server response: ' + response);
282
+ if(isBulkPage && typeof data["BulkPercent"] !== 'undefined') {
283
+ progressUpdate(data["BulkPercent"], data["BulkMsg"]);
284
+ }
285
+ setTimeout(checkBulkProgress, 5000);
286
+ break;
287
+
288
+ case ShortPixel.STATUS_ERROR: //for error and skip also we retry
289
+ case ShortPixel.STATUS_SKIP:
290
+ if(typeof data["Message"] !== 'undefined') {
291
+ showToolBarAlert(ShortPixel.STATUS_SKIP, data["Message"] + ' Image ID: ' + id);
292
+ setCellMessage(id, data["Message"]);
293
+ }
294
+ case ShortPixel.STATUS_RETRY:
295
+ console.log('Server response: ' + response);
296
+ showToolBarAlert(ShortPixel.STATUS_RETRY, "");
297
+ if(isBulkPage && typeof data["BulkPercent"] !== 'undefined') {
298
+ progressUpdate(data["BulkPercent"], data["BulkMsg"]);
299
+ }
300
+ setTimeout(checkBulkProgress, 5000);
301
+ break;
302
+ }
303
  }
304
+ },
305
+ error: function(response){
306
+ ShortPixel.retry(response.statusText);
307
  }
308
  });
309
  }
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: image optimizer, image optimization, compress pdf, compress jpeg, compress
5
 
6
  Requires at least: 3.2.0
7
  Tested up to: 4.5
8
- Stable tag: 3.3.3
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -193,6 +193,13 @@ The ShortPixel team is here to help. <a href="https://shortpixel.com/contact">Co
193
 
194
  == Changelog ==
195
 
 
 
 
 
 
 
 
196
  = 3.3.3 =
197
 
198
  * Compatibility with WPML Media plugin
5
 
6
  Requires at least: 3.2.0
7
  Tested up to: 4.5
8
+ Stable tag: 3.3.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
193
 
194
  == Changelog ==
195
 
196
+ = 3.3.4 =
197
+
198
+ * Fix Settings Resources display
199
+ * Add user and password authentication option for downloading images
200
+ * fix for PHP installs that lack utf8_encode function
201
+ * retry from the optimize Ajax post when server sends a 500 error
202
+
203
  = 3.3.3 =
204
 
205
  * Compatibility with WPML Media plugin
shortpixel_view.php CHANGED
@@ -360,7 +360,7 @@ class ShortPixelView {
360
  </div>
361
  <?php } ?>
362
 
363
- <article class="tabs">
364
  <section class='sel-tab' id="tab-settings">
365
  <h2><a class='tab-link' href='javascript:void(0);' data-id="tab-settings">Settings</a></h2>
366
  <?php $this->displaySettingsForm($showApiKey, $quotaData);?>
@@ -382,6 +382,8 @@ class ShortPixelView {
382
  </article>
383
  <script>
384
  jQuery(document).ready(function () {
 
 
385
  if(window.location.hash) {
386
  var target = 'tab-' + window.location.hash.substring(window.location.hash.indexOf("#")+1)
387
  ShortPixel.switchSettingsTab(target);
@@ -495,6 +497,14 @@ class ShortPixelView {
495
  or, if you have a Retina images plugin, <?php echo(2 * $minSizes['width']);?> &times; <?php echo(2 * $minSizes['height']);?> pixels.</p>
496
  </td>
497
  </tr>
 
 
 
 
 
 
 
 
498
  </tbody>
499
  </table>
500
  <p class="submit">
360
  </div>
361
  <?php } ?>
362
 
363
+ <article id="shortpixel-settings-tabs" class="tabs">
364
  <section class='sel-tab' id="tab-settings">
365
  <h2><a class='tab-link' href='javascript:void(0);' data-id="tab-settings">Settings</a></h2>
366
  <?php $this->displaySettingsForm($showApiKey, $quotaData);?>
382
  </article>
383
  <script>
384
  jQuery(document).ready(function () {
385
+ ShortPixel.adjustSettingsTabs();
386
+
387
  if(window.location.hash) {
388
  var target = 'tab-' + window.location.hash.substring(window.location.hash.indexOf("#")+1)
389
  ShortPixel.switchSettingsTab(target);
497
  or, if you have a Retina images plugin, <?php echo(2 * $minSizes['width']);?> &times; <?php echo(2 * $minSizes['height']);?> pixels.</p>
498
  </td>
499
  </tr>
500
+ <tr>
501
+ <th scope="row"><label for="authentication">Site authentication credentials</label></th>
502
+ <td>
503
+ <input name="siteAuthUser" type="text" id="siteAuthUser" value="<?php echo( $settings->siteAuthUser );?>" class="regular-text" placeholder="User"><br>
504
+ <input name="siteAuthPass" type="text" id="siteAuthPass" value="<?php echo( $settings->siteAuthPass );?>" class="regular-text" placeholder="Password">
505
+ <p class="settings-info"> If your site needs credentials to connect to, please enter them here for our servers to be able to download the images that need to be optimized.</p></br>
506
+ </td>
507
+ </tr>
508
  </tbody>
509
  </table>
510
  <p class="submit">
wp-shortpixel-settings.php CHANGED
@@ -36,6 +36,8 @@ class WPShortPixelSettings {
36
  'httpProto' => 'wp-short-pixel-protocol',
37
  'downloadProto' => 'wp-short-pixel-download-protocol',
38
  'mediaAlert' => 'wp-short-pixel-media-alert',
 
 
39
  '' => '',
40
  );
41
 
36
  'httpProto' => 'wp-short-pixel-protocol',
37
  'downloadProto' => 'wp-short-pixel-download-protocol',
38
  'mediaAlert' => 'wp-short-pixel-media-alert',
39
+ 'siteAuthUser' => 'wp-short-pixel-site-auth-user',
40
+ 'siteAuthPass' => 'wp-short-pixel-site-auth-pass',
41
  '' => '',
42
  );
43
 
wp-shortpixel.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: ShortPixel Image Optimizer
4
  * Plugin URI: https://shortpixel.com/
5
  * Description: ShortPixel optimizes images automatically, while guarding the quality of your images. Check your <a href="options-general.php?page=wp-shortpixel" target="_blank">Settings &gt; ShortPixel</a> page on how to start optimizing your image library and make your website load faster.
6
- * Version: 3.3.3
7
  * Author: ShortPixel
8
  * Author URI: https://shortpixel.com
9
  */
@@ -22,7 +22,7 @@ define('SP_RESET_ON_ACTIVATE', false); //if true TODO set false
22
 
23
  define('SP_AFFILIATE_CODE', '');
24
 
25
- define('PLUGIN_VERSION', "3.3.3");
26
  define('SP_MAX_TIMEOUT', 10);
27
  define('SP_VALIDATE_MAX_TIMEOUT', 15);
28
  define('SP_BACKUP', 'ShortpixelBackups');
@@ -658,7 +658,7 @@ class WPShortPixel {
658
  // - collect the thumbs paths in the process
659
  if(! $this->setFilePerms($bkFile) ) return false;
660
  $thumbsPaths = array();
661
- if( !empty($meta['file']) ) {
662
  foreach($meta["sizes"] as $size => $imageData) {
663
  $source = $bkFolder . $imageData['file'];
664
  $thumbsPaths[$source] = $pathInfo['dirname'] . DIRECTORY_SEPARATOR . $imageData['file'];
@@ -1016,9 +1016,11 @@ class WPShortPixel {
1016
  if(isset($_POST['cmyk2rgb'])) { $this->_settings->CMYKtoRGBconversion = 1; } else { $this->_settings->CMYKtoRGBconversion = 0; }
1017
  $this->_settings->keepExif = isset($_POST['removeExif']) ? 0 : 1;
1018
  //delete_option('wp-short-pixel-keep-exif');
1019
- $this->_settings->resizeImages = (isset($_POST['resize']) ? 1: 0);
1020
  $this->_settings->resizeWidth = (isset($_POST['width']) ? $_POST['width']: $this->_settings->resizeWidth);
1021
  $this->_settings->resizeHeight = (isset($_POST['height']) ? $_POST['height']: $this->_settings->resizeHeight);
 
 
1022
 
1023
  if($_POST['save'] == "Save and Go to Bulk Process") {
1024
  wp_redirect("upload.php?page=wp-short-pixel-bulk");
@@ -1104,6 +1106,12 @@ class WPShortPixel {
1104
  $args['body']['ThumbsCount'] = $imageCount['totalFiles'] - $imageCount['mainFiles'];
1105
  $argsStr .= "&DomainCheck={$args['body']['DomainCheck']}&ImagesCount={$imageCount['mainFiles']}&ThumbsCount={$args['body']['ThumbsCount']}";
1106
  }
 
 
 
 
 
 
1107
 
1108
  $comm = array();
1109
 
@@ -1645,7 +1653,7 @@ class WPShortPixel {
1645
  */
1646
  public static function encrypt($pure_string, $encryption_key)
1647
  {
1648
- if(!function_exists("mcrypt_get_iv_size")) {
1649
  return "";
1650
  }
1651
  $iv_size = \mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);
3
  * Plugin Name: ShortPixel Image Optimizer
4
  * Plugin URI: https://shortpixel.com/
5
  * Description: ShortPixel optimizes images automatically, while guarding the quality of your images. Check your <a href="options-general.php?page=wp-shortpixel" target="_blank">Settings &gt; ShortPixel</a> page on how to start optimizing your image library and make your website load faster.
6
+ * Version: 3.3.4
7
  * Author: ShortPixel
8
  * Author URI: https://shortpixel.com
9
  */
22
 
23
  define('SP_AFFILIATE_CODE', '');
24
 
25
+ define('PLUGIN_VERSION', "3.3.4");
26
  define('SP_MAX_TIMEOUT', 10);
27
  define('SP_VALIDATE_MAX_TIMEOUT', 15);
28
  define('SP_BACKUP', 'ShortpixelBackups');
658
  // - collect the thumbs paths in the process
659
  if(! $this->setFilePerms($bkFile) ) return false;
660
  $thumbsPaths = array();
661
+ if( !empty($meta['file']) && is_array($meta["sizes"]) ) {
662
  foreach($meta["sizes"] as $size => $imageData) {
663
  $source = $bkFolder . $imageData['file'];
664
  $thumbsPaths[$source] = $pathInfo['dirname'] . DIRECTORY_SEPARATOR . $imageData['file'];
1016
  if(isset($_POST['cmyk2rgb'])) { $this->_settings->CMYKtoRGBconversion = 1; } else { $this->_settings->CMYKtoRGBconversion = 0; }
1017
  $this->_settings->keepExif = isset($_POST['removeExif']) ? 0 : 1;
1018
  //delete_option('wp-short-pixel-keep-exif');
1019
+ $this->_settings->resizeImages = (isset($_POST['resize']) ? 1: 0);
1020
  $this->_settings->resizeWidth = (isset($_POST['width']) ? $_POST['width']: $this->_settings->resizeWidth);
1021
  $this->_settings->resizeHeight = (isset($_POST['height']) ? $_POST['height']: $this->_settings->resizeHeight);
1022
+ $this->_settings->siteAuthUser = (isset($_POST['siteAuthUser']) ? $_POST['siteAuthUser']: $this->_settings->siteAuthUser);
1023
+ $this->_settings->siteAuthPass = (isset($_POST['siteAuthPass']) ? $_POST['siteAuthPass']: $this->_settings->siteAuthPass);
1024
 
1025
  if($_POST['save'] == "Save and Go to Bulk Process") {
1026
  wp_redirect("upload.php?page=wp-short-pixel-bulk");
1106
  $args['body']['ThumbsCount'] = $imageCount['totalFiles'] - $imageCount['mainFiles'];
1107
  $argsStr .= "&DomainCheck={$args['body']['DomainCheck']}&ImagesCount={$imageCount['mainFiles']}&ThumbsCount={$args['body']['ThumbsCount']}";
1108
  }
1109
+ if(strlen($this->_settings->siteAuthUser)) {
1110
+ $args['body']['url'] = parse_url(get_site_url(),PHP_URL_HOST);
1111
+ $args['body']['user'] = $this->_settings->siteAuthUser;
1112
+ $args['body']['pass'] = urlencode($this->_settings->siteAuthPass);
1113
+ $argsStr .= "&url={$args['body']['url']}&user={$args['body']['user']}&pass={$args['body']['pass']}";
1114
+ }
1115
 
1116
  $comm = array();
1117
 
1653
  */
1654
  public static function encrypt($pure_string, $encryption_key)
1655
  {
1656
+ if(!function_exists("mcrypt_get_iv_size") || !function_exists('utf8_encode')) {
1657
  return "";
1658
  }
1659
  $iv_size = \mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);