ShortPixel Image Optimizer - Version 4.8.8

Version Description

  • fix for trying to convert .png files that are not png actually
  • fix for installs which don't have PHP GD - deactivate the png 2 jpg conversion
  • fix for unserialize warnings
  • improvements in bulk speed when passing through already optimized images.
  • fix unsupported usage of const by third party punycode.js
  • fix emails with new root domains like user@domain.store
  • fix unsupported flock problem
  • hidden button pending cleanup
  • fix javascript not being able to generate the actions menu upon image being optimized while inside the image edit and displaying false instead
Download this release

Release Info

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

Code changes from version 4.8.7 to 4.8.8

class/db/shortpixel-custom-meta-dao.php CHANGED
@@ -434,9 +434,13 @@ class ShortPixelCustomMetaDao {
434
  $filesWithErrors = array();
435
  $sql = "SELECT id, name, path, message FROM {$this->db->getPrefix()}shortpixel_meta WHERE status < -1 AND retries >= 3 LIMIT 30";
436
  $failRows = $this->db->query($sql);
437
- $filesWithErrors = array();
438
  foreach($failRows as $failLine) {
439
- $filesWithErrors['C-' . $failLine->id] = array('Name' => $failLine->name, 'Message' => $failLine->message, 'Path' => $failLine->path);
 
 
 
 
440
  }
441
 
442
  if(!isset($rows[0])) {
@@ -453,7 +457,8 @@ class ShortPixelCustomMetaDao {
453
  "totalProcLossyCustomFiles" => $rows[0]->totalProcLossyFiles, "mainProcLossyCustomFiles" => $rows[0]->totalProcLossyFiles,
454
  "totalProcGlossyCustomFiles" => $rows[0]->totalProcGlossyFiles, "mainProcGlossyCustomFiles" => $rows[0]->totalProcGlossyFiles,
455
  "totalProcLosslessCustomFiles" => $rows[0]->totalProcLosslessFiles, "mainProcLosslessCustomFiles" => $rows[0]->totalProcLosslessFiles,
456
- "filesWithErrors" => $filesWithErrors
 
457
  );
458
 
459
  }
434
  $filesWithErrors = array();
435
  $sql = "SELECT id, name, path, message FROM {$this->db->getPrefix()}shortpixel_meta WHERE status < -1 AND retries >= 3 LIMIT 30";
436
  $failRows = $this->db->query($sql);
437
+ $filesWithErrors = array(); $moreFilesWithErrors = 0;
438
  foreach($failRows as $failLine) {
439
+ if(count($filesWithErrors) < 50){
440
+ $filesWithErrors['C-' . $failLine->id] = array('Name' => $failLine->name, 'Message' => $failLine->message, 'Path' => $failLine->path);
441
+ } else {
442
+ $moreFilesWithErrors++;
443
+ }
444
  }
445
 
446
  if(!isset($rows[0])) {
457
  "totalProcLossyCustomFiles" => $rows[0]->totalProcLossyFiles, "mainProcLossyCustomFiles" => $rows[0]->totalProcLossyFiles,
458
  "totalProcGlossyCustomFiles" => $rows[0]->totalProcGlossyFiles, "mainProcGlossyCustomFiles" => $rows[0]->totalProcGlossyFiles,
459
  "totalProcLosslessCustomFiles" => $rows[0]->totalProcLosslessFiles, "mainProcLosslessCustomFiles" => $rows[0]->totalProcLosslessFiles,
460
+ "filesWithErrors" => $filesWithErrors,
461
+ "moreFilesWithErrors" => $moreFilesWithErrors
462
  );
463
 
464
  }
class/db/shortpixel-meta-facade.php CHANGED
@@ -189,16 +189,24 @@ class ShortPixelMetaFacade {
189
  }
190
  }
191
 
192
- function cleanupMeta() {
193
  if($this->type == ShortPixelMetaFacade::MEDIA_LIBRARY_TYPE) {
194
  if(!isset($this->rawMeta)) {
195
- $rawMeta = $this->sanitizeMeta(wp_get_attachment_metadata($_ID));
196
  } else {
197
  $rawMeta = $this->rawMeta;
198
  }
199
- unset($rawMeta["ShortPixelImprovement"]);
200
- unset($rawMeta['ShortPixel']);
201
- unset($rawMeta['ShortPixelPng2Jpg']);
 
 
 
 
 
 
 
 
202
  unset($this->meta);
203
  wp_update_attachment_metadata($this->ID, $rawMeta);
204
  $this->rawMeta = $rawMeta;
189
  }
190
  }
191
 
192
+ function cleanupMeta($fakeOptPending = false) {
193
  if($this->type == ShortPixelMetaFacade::MEDIA_LIBRARY_TYPE) {
194
  if(!isset($this->rawMeta)) {
195
+ $rawMeta = $this->sanitizeMeta(wp_get_attachment_metadata($this->getId()));
196
  } else {
197
  $rawMeta = $this->rawMeta;
198
  }
199
+
200
+ if($fakeOptPending && !isset($rawMeta['ShortPixel']['WaitingProcessing'])) {
201
+ return;
202
+ } elseif ($fakeOptPending) {
203
+ unset($rawMeta['ShortPixel']['WaitingProcessing']);
204
+ $rawMeta["ShortPixelImprovement"] = '999';
205
+ } else {
206
+ unset($rawMeta["ShortPixelImprovement"]);
207
+ unset($rawMeta['ShortPixel']);
208
+ unset($rawMeta['ShortPixelPng2Jpg']);
209
+ }
210
  unset($this->meta);
211
  wp_update_attachment_metadata($this->ID, $rawMeta);
212
  $this->rawMeta = $rawMeta;
class/db/wp-shortpixel-media-library-adapter.php CHANGED
@@ -11,7 +11,7 @@ class WpShortPixelMediaLbraryAdapter {
11
  $filesMap = $processedFilesMap = array();
12
  $limit = self::getOptimalChunkSize();
13
  $pointer = 0;
14
- $filesWithErrors = array();
15
  $excludePatterns = WPShortPixelSettings::getOpt("excludePatterns");
16
 
17
  if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
@@ -62,9 +62,9 @@ class WpShortPixelMediaLbraryAdapter {
62
  $filesMap[$file->meta_value] = 1;
63
  }
64
  }
65
- else //_wp_attachment_metadata
66
  {
67
- $attachment = unserialize($file->meta_value);
68
  $sizesCount = isset($attachment['sizes']) ? WpShortPixelMediaLbraryAdapter::countNonWebpSizes($attachment['sizes']) : 0;
69
 
70
  // LA FIECARE 100 de imagini facem un test si daca findThumbs da diferit, sa dam o avertizare si eventual optiune
@@ -176,10 +176,14 @@ class WpShortPixelMediaLbraryAdapter {
176
  $processedFilesMap[$attachment['file']] = 1;
177
  }
178
  }
179
- elseif($isProcessable && isset($attachment['ShortPixelImprovement']) && count($filesWithErrors) < 50) {
180
- $filePath = explode("/", $attachment["file"]);
181
- $name = is_array($filePath)? $filePath[count($filePath) - 1] : $file->post_id;
182
- $filesWithErrors[$file->post_id] = array('Name' => $name, 'Message' => $attachment['ShortPixelImprovement']);
 
 
 
 
183
  }
184
 
185
  }
@@ -214,6 +218,7 @@ class WpShortPixelMediaLbraryAdapter {
214
  "totalProcUndefMlFiles" => $procUndefTotalFiles, "mainProcUndefMlFiles" => $procUndefMainFiles,
215
  "mainUnprocessedThumbs" => $mainUnprocessedThumbs, "totalM1" => $totalFilesM1, "totalM2" => $totalFilesM2, "totalM3" => $totalFilesM3, "totalM4" => $totalFilesM4,
216
  "filesWithErrors" => $filesWithErrors,
 
217
  "foundUnlistedThumbs" => $foundUnlistedThumbs
218
  );
219
  }
11
  $filesMap = $processedFilesMap = array();
12
  $limit = self::getOptimalChunkSize();
13
  $pointer = 0;
14
+ $filesWithErrors = array(); $moreFilesWithErrors = 0;
15
  $excludePatterns = WPShortPixelSettings::getOpt("excludePatterns");
16
 
17
  if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
62
  $filesMap[$file->meta_value] = 1;
63
  }
64
  }
65
+ elseif ( $file->meta_key == "_wp_attachment_metadata" ) //_wp_attachment_metadata
66
  {
67
+ $attachment = @unserialize($file->meta_value);
68
  $sizesCount = isset($attachment['sizes']) ? WpShortPixelMediaLbraryAdapter::countNonWebpSizes($attachment['sizes']) : 0;
69
 
70
  // LA FIECARE 100 de imagini facem un test si daca findThumbs da diferit, sa dam o avertizare si eventual optiune
176
  $processedFilesMap[$attachment['file']] = 1;
177
  }
178
  }
179
+ elseif($isProcessable && isset($attachment['ShortPixelImprovement'])) {
180
+ if(count($filesWithErrors) < 50) {
181
+ $filePath = explode("/", $attachment["file"]);
182
+ $name = is_array($filePath)? $filePath[count($filePath) - 1] : $file->post_id;
183
+ $filesWithErrors[$file->post_id] = array('Name' => $name, 'Message' => $attachment['ShortPixelImprovement']);
184
+ } else {
185
+ $moreFilesWithErrors++;
186
+ }
187
  }
188
 
189
  }
218
  "totalProcUndefMlFiles" => $procUndefTotalFiles, "mainProcUndefMlFiles" => $procUndefMainFiles,
219
  "mainUnprocessedThumbs" => $mainUnprocessedThumbs, "totalM1" => $totalFilesM1, "totalM2" => $totalFilesM2, "totalM3" => $totalFilesM3, "totalM4" => $totalFilesM4,
220
  "filesWithErrors" => $filesWithErrors,
221
+ "moreFilesWithErrors" => $moreFilesWithErrors,
222
  "foundUnlistedThumbs" => $foundUnlistedThumbs
223
  );
224
  }
class/shortpixel-png2jpg.php CHANGED
@@ -55,6 +55,9 @@ class ShortPixelPng2Jpg {
55
  $image = $params['file'];
56
  if(!$img) {
57
  $img = imagecreatefrompng($image);
 
 
 
58
  }
59
 
60
  $bg = imagecreatetruecolor(imagesx($img), imagesy($img));
55
  $image = $params['file'];
56
  if(!$img) {
57
  $img = imagecreatefrompng($image);
58
+ if(!$img) {
59
+ return $params; //actually not a PNG.
60
+ }
61
  }
62
 
63
  $bg = imagecreatetruecolor(imagesx($img), imagesy($img));
class/shortpixel_queue.php CHANGED
@@ -8,7 +8,8 @@ class ShortPixelQueue {
8
  const BULK_TYPE_OPTIMIZE = 0;
9
  const BULK_TYPE_RESTORE = 1;
10
  const BULK_TYPE_CLEANUP = 2;
11
-
 
12
  const BULK_NEVER = 0; //bulk never ran
13
  const BULK_RUNNING = 1; //bulk is running
14
  const BULK_PAUSED = 2; //bulk is paused
@@ -75,7 +76,7 @@ class ShortPixelQueue {
75
  $fp = @fopen($queueName, "w");
76
  }
77
  if(!$fp) return false;
78
- while (!flock($fp, $lock)) {usleep(100000);} // acquire the lock, the stubborn way...
79
  return $fp;
80
  }
81
  protected static function closeQ($fp) {
8
  const BULK_TYPE_OPTIMIZE = 0;
9
  const BULK_TYPE_RESTORE = 1;
10
  const BULK_TYPE_CLEANUP = 2;
11
+ const BULK_TYPE_CLEANUP_PENDING = 3;
12
+
13
  const BULK_NEVER = 0; //bulk never ran
14
  const BULK_RUNNING = 1; //bulk is running
15
  const BULK_PAUSED = 2; //bulk is paused
76
  $fp = @fopen($queueName, "w");
77
  }
78
  if(!$fp) return false;
79
+ flock($fp, $lock);
80
  return $fp;
81
  }
82
  protected static function closeQ($fp) {
class/view/shortpixel_view.php CHANGED
@@ -77,17 +77,18 @@ class ShortPixelView {
77
  }
78
 
79
  public static function displayActivationNotice($when = 'activate', $extra = '') {
80
- $extraStyle = $when == 'compat' || $when == 'fileperms' ? "style='border-left: 4px solid #ff0000;'" :
81
  ($when == 'upgmonth' || $when == 'upgbulk' ? "style='border-left: 4px solid #46b450;'" : '');
82
- $icon = false;
83
  switch($when) {
 
84
  case 'fileperms': $icon = 'scared'; break;
85
  case 'unlisted': $icon = 'magnifier'; break;
86
  case 'upgmonth':
87
  case 'upgbulk': $icon = 'notes'; break;
88
  }
89
  ?>
90
- <div class='notice notice-warning' id='short-pixel-notice-<?php echo($when);?>' <?php echo($extraStyle);?>>
91
  <?php if($when != 'activate') { ?>
92
  <div style="float:right;">
93
  <?php if($when == 'upgmonth' || $when == 'upgbulk'){ ?>
@@ -98,8 +99,11 @@ class ShortPixelView {
98
  <a href="javascript:ShortPixel.includeUnlisted()" class="button button-primary" style="margin-top:10px;margin-left:10px;">
99
  <strong><?php _e('Yes, include these thumbnails','shortpixel-image-optimiser');?></strong></a>
100
  <?php }
101
- if($when !== 'fileperms') { ?>
102
  <a href="javascript:dismissShortPixelNotice('<?php echo($when);?>')" class="button" style="margin-top:10px;"><?php _e('Dismiss','shortpixel-image-optimiser');?></a>
 
 
 
103
  <?php } ?>
104
  </div>
105
  <?php if($icon){ ?>
@@ -128,11 +132,11 @@ class ShortPixelView {
128
  SHORTPIXEL_UPLOADS_BASE);
129
  break;
130
  case 'compat' :
131
- _e("Using ShortPixel while other image optimization plugins are active can lead to unpredictable results. We recommend to deactivate the following plugin(s): ",'shortpixel-image-optimiser');
132
  echo('<ul>');
133
  foreach($extra as $plugin) {
134
  echo('<li class="sp-conflict-plugins-list"><strong>' . $plugin['name'] . '</strong>');
135
- echo('<a href="' . wp_nonce_url( admin_url( 'admin-post.php?action=shortpixel_deactivate_plugin&plugin=' . urlencode( $plugin['path'] ) ), 'sp_deactivate_plugin_nonce' ) . '" class="button">'
136
  . __( 'Deactivate', 'shortpixel_image_optimiser' ) . '</a>');
137
  }
138
  echo("</ul>");
@@ -244,7 +248,8 @@ class ShortPixelView {
244
  <?php if($quotaData['mainProcessedMlFiles'] > 0) {?>
245
  <div style="position: absolute;bottom: 10px;right: 10px;">
246
  <input type='submit' name='bulkRestore' id='bulkRestore' class='button' value='<?php _e('Bulk Restore Media Library','shortpixel-image-optimiser');?>' onclick="ShortPixel.confirmBulkAction('Restore', event)" style="margin-bottom:10px;"><br>
247
- <input type='submit' name='bulkCleanup' id='bulkRestore' class='button' value='<?php _e('Bulk Delete Metadata','shortpixel-image-optimiser');?>' onclick="ShortPixel.confirmBulkAction('Cleanup', event)" style="width:100%">
 
248
  </div>
249
 
250
  <?php }
@@ -405,15 +410,24 @@ class ShortPixelView {
405
  printf(__("%s thumbnails are not yet optimized by ShortPixel.",'shortpixel-image-optimiser'), number_format($thumbsNotProcessed));
406
  }
407
  _e('','shortpixel-image-optimiser');
408
- if (count($quotaData['filesWithErrors'])) {
 
409
  _e('Some have errors:','shortpixel-image-optimiser'); echo(' ');
 
410
  foreach($quotaData['filesWithErrors'] as $id => $data) {
 
 
 
 
411
  if(ShortPixelMetaFacade::isCustomQueuedId($id)) {
412
- echo('<a href="'. ShortPixelMetaFacade::getHomeUrl() . ShortPixelMetaFacade::filenameToRootRelative($data['Path']).'" title="'.$data['Message'].'" target="_blank">'.$data['Name'].'</a>,&nbsp;');
413
  } else {
414
- echo('<a href="post.php?post='.$id.'&action=edit" title="'.$data['Message'].'">'.$data['Name'].'</a>,&nbsp;');
415
  }
416
- }
 
 
 
417
  } ?>
418
  </p>
419
  <?php }
@@ -478,7 +492,8 @@ class ShortPixelView {
478
  onchange="ShortPixel.onBulkThumbsCheck(this)"> <?php _e('Include thumbnails','shortpixel-image-optimiser');?><br><br>
479
  <input type='submit' name='bulkProcess' id='bulkProcess' class='button button-primary' value='<?php _e('Restart Optimizing','shortpixel-image-optimiser');?>'>
480
  <input type='submit' name='bulkRestore' id='bulkRestore' class='button' value='<?php _e('Bulk Restore Media Library','shortpixel-image-optimiser');?>' onclick="ShortPixel.confirmBulkAction('Restore',event)" style="float: right;">
481
- <input type='submit' name='bulkCleanup' id='bulkRestore' class='button' value='<?php _e('Bulk Delete Metadata','shortpixel-image-optimiser');?>' onclick="ShortPixel.confirmBulkAction('Cleanup',event)" style="float: right;margin-right:10px;">
 
482
  </form>
483
  </div>
484
  <?php } ?>
@@ -951,6 +966,10 @@ class ShortPixelView {
951
  }
952
  $excludePatterns = substr($excludePatterns, 0, -2);
953
  }
 
 
 
 
954
  $convertPng2Jpg = ($settings->png2jpg ? 'checked' : '');
955
  ?>
956
  <div class="wp-shortpixel-options">
@@ -1062,7 +1081,10 @@ class ShortPixelView {
1062
  <tr>
1063
  <th scope="row"><label for="png2jpg"><?php _e('Convert PNG images to JPEG','shortpixel-image-optimiser');?></label></th>
1064
  <td>
1065
- <input name="png2jpg" type="checkbox" id="resize" <?php echo( $convertPng2Jpg );?>> <?php _e('Automatically convert the PNG images to JPEG if possible.','shortpixel-image-optimiser');?>
 
 
 
1066
  <p class="settings-info">
1067
  <?php _e('Converts all PNGs that don\'t have transparent pixels to JPEG. This can dramatically reduce the file size, especially if you have camera pictures that are saved in PNG format. <strong>PNGs with transparency will not be converted.</strong> The plugin will also search for references of the image in posts and will replace them.','shortpixel-image-optimiser');?>
1068
  </p>
@@ -1351,6 +1373,7 @@ class ShortPixelView {
1351
  }
1352
 
1353
  public function getSuccessText($percent, $bonus, $type, $thumbsOpt = 0, $thumbsTotal = 0, $retinasOpt = 0) {
 
1354
  return ($percent && $percent > 0 ? __('Reduced by','shortpixel-image-optimiser') . ' <strong>' . $percent . '%</strong> ' : '')
1355
  .(!$bonus ? ' ('.$type.')':'')
1356
  .($bonus && $percent ? '<br>' : '')
77
  }
78
 
79
  public static function displayActivationNotice($when = 'activate', $extra = '') {
80
+ $extraStyle = $when == 'compat' || $when == 'fileperms' ? "style='border-left: 4px solid #ff0000;background-color: #ff9999;margin: 5px 20px 15px 0;'" :
81
  ($when == 'upgmonth' || $when == 'upgbulk' ? "style='border-left: 4px solid #46b450;'" : '');
82
+ $icon = false; $extraClass = '';
83
  switch($when) {
84
+ case 'compat': $extraClass = 'below-h2';
85
  case 'fileperms': $icon = 'scared'; break;
86
  case 'unlisted': $icon = 'magnifier'; break;
87
  case 'upgmonth':
88
  case 'upgbulk': $icon = 'notes'; break;
89
  }
90
  ?>
91
+ <div class='notice <?php echo($extraClass);?> notice-warning' id='short-pixel-notice-<?php echo($when);?>' <?php echo($extraStyle);?>>
92
  <?php if($when != 'activate') { ?>
93
  <div style="float:right;">
94
  <?php if($when == 'upgmonth' || $when == 'upgbulk'){ ?>
99
  <a href="javascript:ShortPixel.includeUnlisted()" class="button button-primary" style="margin-top:10px;margin-left:10px;">
100
  <strong><?php _e('Yes, include these thumbnails','shortpixel-image-optimiser');?></strong></a>
101
  <?php }
102
+ if($when !== 'fileperms' && $when !== 'compat') { ?>
103
  <a href="javascript:dismissShortPixelNotice('<?php echo($when);?>')" class="button" style="margin-top:10px;"><?php _e('Dismiss','shortpixel-image-optimiser');?></a>
104
+ <?php }
105
+ if($when == 'compat') { ?>
106
+ <a href="javascript:dismissShortPixelNotice('<?php echo($when);?>')" class="button" style="margin-top:10px;"><?php _e('I know what I\'m doing','shortpixel-image-optimiser');?></a>
107
  <?php } ?>
108
  </div>
109
  <?php if($icon){ ?>
132
  SHORTPIXEL_UPLOADS_BASE);
133
  break;
134
  case 'compat' :
135
+ _e("The following plugins are not compatible with ShortPixel and may lead to unexpected results: ",'shortpixel-image-optimiser');
136
  echo('<ul>');
137
  foreach($extra as $plugin) {
138
  echo('<li class="sp-conflict-plugins-list"><strong>' . $plugin['name'] . '</strong>');
139
+ echo('<a href="' . wp_nonce_url( admin_url( 'admin-post.php?action=shortpixel_deactivate_plugin&plugin=' . urlencode( $plugin['path'] ) ), 'sp_deactivate_plugin_nonce' ) . '" class="button button-primary">'
140
  . __( 'Deactivate', 'shortpixel_image_optimiser' ) . '</a>');
141
  }
142
  echo("</ul>");
248
  <?php if($quotaData['mainProcessedMlFiles'] > 0) {?>
249
  <div style="position: absolute;bottom: 10px;right: 10px;">
250
  <input type='submit' name='bulkRestore' id='bulkRestore' class='button' value='<?php _e('Bulk Restore Media Library','shortpixel-image-optimiser');?>' onclick="ShortPixel.confirmBulkAction('Restore', event)" style="margin-bottom:10px;"><br>
251
+ <input type='submit' name='bulkCleanup' id='bulkCleanup' class='button' value='<?php _e('Bulk Delete Metadata','shortpixel-image-optimiser');?>' onclick="ShortPixel.confirmBulkAction('Cleanup', event)" style="width:100%">
252
+ <input type='submit' name='bulkCleanupPending' id='bulkCleanupPending' class='button' value='<?php _e('Bulk Delete Pending Metadata','shortpixel-image-optimiser');?>' onclick="ShortPixel.confirmBulkAction('CleanupPending', event)" style="display:none">
253
  </div>
254
 
255
  <?php }
410
  printf(__("%s thumbnails are not yet optimized by ShortPixel.",'shortpixel-image-optimiser'), number_format($thumbsNotProcessed));
411
  }
412
  _e('','shortpixel-image-optimiser');
413
+ if (count($quotaData['filesWithErrors'])) {
414
+ echo('&nbsp;');
415
  _e('Some have errors:','shortpixel-image-optimiser'); echo(' ');
416
+ $first = true;
417
  foreach($quotaData['filesWithErrors'] as $id => $data) {
418
+ if(!$first) {
419
+ echo(",&nbsp;");
420
+ }
421
+ $first = false;
422
  if(ShortPixelMetaFacade::isCustomQueuedId($id)) {
423
+ echo('<a href="'. ShortPixelMetaFacade::getHomeUrl() . ShortPixelMetaFacade::filenameToRootRelative($data['Path']).'" title="'.$data['Message'].'" target="_blank">'.$data['Name'].'</a>');
424
  } else {
425
+ echo('<a href="post.php?post='.$id.'&action=edit" title="'.$data['Message'].'">'.$data['Name'].'</a>');
426
  }
427
+ }
428
+ if(isset($quotaData['moreFilesWithErrors']) && $quotaData['moreFilesWithErrors']) {
429
+ echo('&nbsp;');printf(__("(%s more)",'shortpixel-image-optimiser'), $quotaData['moreFilesWithErrors']);
430
+ }
431
  } ?>
432
  </p>
433
  <?php }
492
  onchange="ShortPixel.onBulkThumbsCheck(this)"> <?php _e('Include thumbnails','shortpixel-image-optimiser');?><br><br>
493
  <input type='submit' name='bulkProcess' id='bulkProcess' class='button button-primary' value='<?php _e('Restart Optimizing','shortpixel-image-optimiser');?>'>
494
  <input type='submit' name='bulkRestore' id='bulkRestore' class='button' value='<?php _e('Bulk Restore Media Library','shortpixel-image-optimiser');?>' onclick="ShortPixel.confirmBulkAction('Restore',event)" style="float: right;">
495
+ <input type='submit' name='bulkCleanup' id='bulkCleanup' class='button' value='<?php _e('Bulk Delete Metadata','shortpixel-image-optimiser');?>' onclick="ShortPixel.confirmBulkAction('Cleanup',event)" style="float: right;margin-right:10px;">
496
+ <input type='submit' name='bulkCleanupPending' id='bulkCleanupPending' class='button' value='<?php _e('Bulk Delete Pending Metadata','shortpixel-image-optimiser');?>' onclick="ShortPixel.confirmBulkAction('CleanupPending', event)" style="display:none">
497
  </form>
498
  </div>
499
  <?php } ?>
966
  }
967
  $excludePatterns = substr($excludePatterns, 0, -2);
968
  }
969
+ $gdInstalled = function_exists('imagecreatefrompng');
970
+ if(!$gdInstalled) {
971
+ $settings->png2jpg = 0;
972
+ }
973
  $convertPng2Jpg = ($settings->png2jpg ? 'checked' : '');
974
  ?>
975
  <div class="wp-shortpixel-options">
1081
  <tr>
1082
  <th scope="row"><label for="png2jpg"><?php _e('Convert PNG images to JPEG','shortpixel-image-optimiser');?></label></th>
1083
  <td>
1084
+ <input name="png2jpg" type="checkbox" id="resize" <?php echo( $convertPng2Jpg );?> <?php echo($gdInstalled ? '' : 'disabled') ?>> <?php
1085
+ _e('Automatically convert the PNG images to JPEG if possible.','shortpixel-image-optimiser');
1086
+ if(!$gdInstalled) {echo("&nbsp;<span style='color:red;'>" . __('You need PHP GD for this. Please ask your hosting to install it.','shortpixel-image-optimiser') . "</span>");}
1087
+ ?>
1088
  <p class="settings-info">
1089
  <?php _e('Converts all PNGs that don\'t have transparent pixels to JPEG. This can dramatically reduce the file size, especially if you have camera pictures that are saved in PNG format. <strong>PNGs with transparency will not be converted.</strong> The plugin will also search for references of the image in posts and will replace them.','shortpixel-image-optimiser');?>
1090
  </p>
1373
  }
1374
 
1375
  public function getSuccessText($percent, $bonus, $type, $thumbsOpt = 0, $thumbsTotal = 0, $retinasOpt = 0) {
1376
+ if($percent == 999) return __("Reduced by X%(unknown)");
1377
  return ($percent && $percent > 0 ? __('Reduced by','shortpixel-image-optimiser') . ' <strong>' . $percent . '%</strong> ' : '')
1378
  .(!$bonus ? ' ('.$type.')':'')
1379
  .($bonus && $percent ? '<br>' : '')
class/wp-short-pixel.php CHANGED
@@ -15,10 +15,14 @@ class WPShortPixel {
15
  private $spMetaDao = null;
16
 
17
  private $jsSuffix = '.min.js';
 
 
18
 
19
  public static $PROCESSABLE_EXTENSIONS = array('jpg', 'jpeg', 'gif', 'png', 'pdf');
20
 
21
  public function __construct() {
 
 
22
  if (SHORTPIXEL_DEBUG === true) {
23
  $this->jsSuffix = '.js'; //use unminified versions for easier debugging
24
  }
@@ -179,7 +183,8 @@ class WPShortPixel {
179
  'CheetahO Image Optimizer' => 'cheetaho-image-optimizer/cheetaho.php',
180
  'Zara 4 Image Compression' => 'zara-4/zara-4.php',
181
  'Prizm Image' => 'prizm-image/wp-prizmimage.php',
182
- 'CW Image Optimizer' => 'cw-image-optimizer/cw-image-optimizer.php'
 
183
  );
184
  $found = array();
185
  foreach($conflictPlugins as $name => $path) {
@@ -319,7 +324,7 @@ class WPShortPixel {
319
  //require_once(ABSPATH . 'wp-admin/includes/screen.php');
320
  if(function_exists('get_current_screen')) {
321
  $screen = get_current_screen();
322
- if(is_object($screen) && ($screen->id == 'upload')) {
323
  //output the comparer html
324
  $this->view->outputComparerHTML();
325
  //render a template of the list cell to be used by the JS
@@ -373,7 +378,8 @@ class WPShortPixel {
373
  'pleaseDoNotSetLesserSize' => __( "Please do not set a {0} less than the {1} of the largest thumbnail which is {2}, to be able to still regenerate all your thumbnails in case you'll ever need this.", 'shortpixel-image-optimiser' ),
374
  'pleaseDoNotSetLesser1024' => __( "Please do not set a {0} less than 1024, to be able to still regenerate all your thumbnails in case you'll ever need this.", 'shortpixel-image-optimiser' ),
375
  'confirmBulkRestore' => __( "Are you sure you want to restore from backup all the images in your Media Library optimized with ShortPixel?", 'shortpixel-image-optimiser' ),
376
- 'confirmBulkCleanup' => __( "Are you sure you want to cleanup the ShortPixel metadata info for the images in your Media Library optimized with ShortPixel? This will make ShortPixel 'forget' that it optimized them and will optimize them again if you re-run the Bulk Optimization process.", 'shortpixel-image-optimiser' )
 
377
  );
378
  wp_localize_script( 'short-pixel' . $this->jsSuffix, '_spTr', $jsTranslation );
379
  wp_enqueue_script('short-pixel' . $this->jsSuffix);
@@ -645,6 +651,9 @@ class WPShortPixel {
645
  $startTime = time();
646
  $maxTime = min(30, (is_numeric(SHORTPIXEL_MAX_EXECUTION_TIME) && SHORTPIXEL_MAX_EXECUTION_TIME > 10 ? SHORTPIXEL_MAX_EXECUTION_TIME - 5 : 25));
647
  $maxResults = SHORTPIXEL_MAX_RESULTS_QUERY * 2;
 
 
 
648
  $restored = array();
649
 
650
  //$ind = 0;
@@ -669,7 +678,7 @@ class WPShortPixel {
669
  $res = $this->doRestore($crtStartQueryID); //this is restore, the real
670
  } else {
671
  //this is only meta cleanup, no files are replaced (BACKUP REMAINS IN PLACE TOO)
672
- $item->cleanupMeta();
673
  $res = true;
674
  }
675
  $restored[] = array('id' => $crtStartQueryID, 'status' => $res ? 'success' : 'fail');
@@ -694,7 +703,8 @@ class WPShortPixel {
694
  $idList = array();
695
  $itemList = array();
696
  for ($sanityCheck = 0, $crtStartQueryID = $startQueryID;
697
- ($crtStartQueryID >= $endQueryID) && (count($itemList) < SHORTPIXEL_PRESEND_ITEMS) && ($sanityCheck < 150); $sanityCheck++) {
 
698
 
699
  self::log("GETDB: current StartID: " . $crtStartQueryID);
700
 
@@ -726,11 +736,13 @@ class WPShortPixel {
726
  if($meta->getStatus() != 2) {
727
  $itemList[] = $item;
728
  $idList[] = $crtStartQueryID;
 
729
  }
730
  elseif($meta->getCompressionType() !== null && $meta->getCompressionType() != $this->_settings->compressionType) {//a different type of compression was chosen in settings
731
  if($this->doRestore($crtStartQueryID)) {
732
  $itemList[] = $item = new ShortPixelMetaFacade($crtStartQueryID); //force reload after restore
733
  $idList[] = $crtStartQueryID;
 
734
  } else {
735
  $skippedAlreadyProcessed++;
736
  }
@@ -743,7 +755,8 @@ class WPShortPixel {
743
  $item->updateMeta($meta);//wp_update_attachment_metadata($crtStartQueryID, $meta);
744
  $itemList[] = $item;
745
  $idList[] = $crtStartQueryID;
746
- }
 
747
  elseif($itemMetaData->meta_key == '_wp_attachment_metadata') { //count skipped
748
  $skippedAlreadyProcessed++;
749
  }
@@ -761,7 +774,7 @@ class WPShortPixel {
761
  $crtStartQueryID--;
762
  }
763
  }
764
- return array("items" => $itemList, "skipped" => $skippedAlreadyProcessed, "searching" => ($sanityCheck >= 150));
765
  }
766
 
767
  /**
@@ -823,7 +836,9 @@ class WPShortPixel {
823
 
824
  //handle the bulk restore and cleanup first - these are fast operations taking precedece over optimization
825
  if( $this->prioQ->bulkRunning()
826
- && ($this->prioQ->getBulkType() == ShortPixelQueue::BULK_TYPE_RESTORE || $this->prioQ->getBulkType() == ShortPixelQueue::BULK_TYPE_CLEANUP)) {
 
 
827
  $res = $this->bulkRestore();
828
  if($res === false) {
829
  $this->sendEmptyQueue();
@@ -1610,8 +1625,9 @@ class WPShortPixel {
1610
  $customImageCount = $this->spMetaDao->countAllProcessableFiles();
1611
  foreach($customImageCount as $key => $val) {
1612
  $quotaData[$key] = isset($quotaData[$key])
1613
- ? (is_array($quotaData[$key]) ? array_merge($quotaData[$key], $val) : $quotaData[$key] + $val)
1614
- : $val;
 
1615
  }
1616
  }
1617
  $this->_settings->currentStats = $quotaData;
@@ -1765,7 +1781,13 @@ class WPShortPixel {
1765
  $this->prioQ->startBulk(ShortPixelQueue::BULK_TYPE_CLEANUP);
1766
  $this->_settings->customBulkPaused = 0;
1767
  }//end bulk restore was clicked
1768
-
 
 
 
 
 
 
1769
  if(isset($_POST["bulkProcessResume"]))
1770
  {
1771
  $this->prioQ->resumeBulk();
@@ -1793,7 +1815,8 @@ class WPShortPixel {
1793
 
1794
  $this->view->displayBulkProcessingRunning($this->getPercent($quotaData), $msg, $quotaData['APICallsRemaining'], $this->getAverageCompression(),
1795
  $this->prioQ->getBulkType() == ShortPixelQueue::BULK_TYPE_RESTORE ? 0 :
1796
- ($this->prioQ->getBulkType() == ShortPixelQueue::BULK_TYPE_CLEANUP ? -1 : ($pendingMeta !== null ? ($this->prioQ->bulkRunning() ? 3 : 2) : 1)));
 
1797
 
1798
  } else
1799
  {
15
  private $spMetaDao = null;
16
 
17
  private $jsSuffix = '.min.js';
18
+
19
+ private $timer;
20
 
21
  public static $PROCESSABLE_EXTENSIONS = array('jpg', 'jpeg', 'gif', 'png', 'pdf');
22
 
23
  public function __construct() {
24
+ $this->timer = time();
25
+
26
  if (SHORTPIXEL_DEBUG === true) {
27
  $this->jsSuffix = '.js'; //use unminified versions for easier debugging
28
  }
183
  'CheetahO Image Optimizer' => 'cheetaho-image-optimizer/cheetaho.php',
184
  'Zara 4 Image Compression' => 'zara-4/zara-4.php',
185
  'Prizm Image' => 'prizm-image/wp-prizmimage.php',
186
+ 'CW Image Optimizer' => 'cw-image-optimizer/cw-image-optimizer.php',
187
+ 'Regenerate Thumbnails can cause thumbnails reoptimization' => 'regenerate-thumbnails/regenerate-thumbnails.php'
188
  );
189
  $found = array();
190
  foreach($conflictPlugins as $name => $path) {
324
  //require_once(ABSPATH . 'wp-admin/includes/screen.php');
325
  if(function_exists('get_current_screen')) {
326
  $screen = get_current_screen();
327
+ if(is_object($screen) && in_array($screen->id, array('attachment', 'upload'))) {
328
  //output the comparer html
329
  $this->view->outputComparerHTML();
330
  //render a template of the list cell to be used by the JS
378
  'pleaseDoNotSetLesserSize' => __( "Please do not set a {0} less than the {1} of the largest thumbnail which is {2}, to be able to still regenerate all your thumbnails in case you'll ever need this.", 'shortpixel-image-optimiser' ),
379
  'pleaseDoNotSetLesser1024' => __( "Please do not set a {0} less than 1024, to be able to still regenerate all your thumbnails in case you'll ever need this.", 'shortpixel-image-optimiser' ),
380
  'confirmBulkRestore' => __( "Are you sure you want to restore from backup all the images in your Media Library optimized with ShortPixel?", 'shortpixel-image-optimiser' ),
381
+ 'confirmBulkCleanup' => __( "Are you sure you want to cleanup the ShortPixel metadata info for the images in your Media Library optimized with ShortPixel? This will make ShortPixel 'forget' that it optimized them and will optimize them again if you re-run the Bulk Optimization process.", 'shortpixel-image-optimiser' ),
382
+ 'confirmBulkCleanupPending' => __( "Are you sure you want to cleanup the pending metadata?", 'shortpixel-image-optimiser' )
383
  );
384
  wp_localize_script( 'short-pixel' . $this->jsSuffix, '_spTr', $jsTranslation );
385
  wp_enqueue_script('short-pixel' . $this->jsSuffix);
651
  $startTime = time();
652
  $maxTime = min(30, (is_numeric(SHORTPIXEL_MAX_EXECUTION_TIME) && SHORTPIXEL_MAX_EXECUTION_TIME > 10 ? SHORTPIXEL_MAX_EXECUTION_TIME - 5 : 25));
653
  $maxResults = SHORTPIXEL_MAX_RESULTS_QUERY * 2;
654
+ if(in_array($this->prioQ->getBulkType(), array(ShortPixelQueue::BULK_TYPE_CLEANUP, ShortPixelQueue::BULK_TYPE_CLEANUP_PENDING))) {
655
+ $maxResults *= 20;
656
+ }
657
  $restored = array();
658
 
659
  //$ind = 0;
678
  $res = $this->doRestore($crtStartQueryID); //this is restore, the real
679
  } else {
680
  //this is only meta cleanup, no files are replaced (BACKUP REMAINS IN PLACE TOO)
681
+ $item->cleanupMeta($this->prioQ->getBulkType() == ShortPixelQueue::BULK_TYPE_CLEANUP_PENDING);
682
  $res = true;
683
  }
684
  $restored[] = array('id' => $crtStartQueryID, 'status' => $res ? 'success' : 'fail');
703
  $idList = array();
704
  $itemList = array();
705
  for ($sanityCheck = 0, $crtStartQueryID = $startQueryID;
706
+ ($crtStartQueryID >= $endQueryID) && (count($itemList) < SHORTPIXEL_PRESEND_ITEMS) && ($sanityCheck < 150)
707
+ && (SHORTPIXEL_MAX_EXECUTION_TIME < 10 || time() - $this->timer < SHORTPIXEL_MAX_EXECUTION_TIME - 5); $sanityCheck++) {
708
 
709
  self::log("GETDB: current StartID: " . $crtStartQueryID);
710
 
736
  if($meta->getStatus() != 2) {
737
  $itemList[] = $item;
738
  $idList[] = $crtStartQueryID;
739
+ if(count($itemList) > SHORTPIXEL_PRESEND_ITEMS) break;
740
  }
741
  elseif($meta->getCompressionType() !== null && $meta->getCompressionType() != $this->_settings->compressionType) {//a different type of compression was chosen in settings
742
  if($this->doRestore($crtStartQueryID)) {
743
  $itemList[] = $item = new ShortPixelMetaFacade($crtStartQueryID); //force reload after restore
744
  $idList[] = $crtStartQueryID;
745
+ if(count($itemList) > SHORTPIXEL_PRESEND_ITEMS) break;
746
  } else {
747
  $skippedAlreadyProcessed++;
748
  }
755
  $item->updateMeta($meta);//wp_update_attachment_metadata($crtStartQueryID, $meta);
756
  $itemList[] = $item;
757
  $idList[] = $crtStartQueryID;
758
+ if(count($itemList) > SHORTPIXEL_PRESEND_ITEMS) break;
759
+ }
760
  elseif($itemMetaData->meta_key == '_wp_attachment_metadata') { //count skipped
761
  $skippedAlreadyProcessed++;
762
  }
774
  $crtStartQueryID--;
775
  }
776
  }
777
+ return array("items" => $itemList, "skipped" => $skippedAlreadyProcessed, "searching" => ($sanityCheck >= 150) || (SHORTPIXEL_MAX_EXECUTION_TIME >= 10 && time() - $this->timer >= SHORTPIXEL_MAX_EXECUTION_TIME - 5));
778
  }
779
 
780
  /**
836
 
837
  //handle the bulk restore and cleanup first - these are fast operations taking precedece over optimization
838
  if( $this->prioQ->bulkRunning()
839
+ && ( $this->prioQ->getBulkType() == ShortPixelQueue::BULK_TYPE_RESTORE
840
+ || $this->prioQ->getBulkType() == ShortPixelQueue::BULK_TYPE_CLEANUP
841
+ || $this->prioQ->getBulkType() == ShortPixelQueue::BULK_TYPE_CLEANUP_PENDING)) {
842
  $res = $this->bulkRestore();
843
  if($res === false) {
844
  $this->sendEmptyQueue();
1625
  $customImageCount = $this->spMetaDao->countAllProcessableFiles();
1626
  foreach($customImageCount as $key => $val) {
1627
  $quotaData[$key] = isset($quotaData[$key])
1628
+ ? (is_array($quotaData[$key]) ? array_merge($quotaData[$key], $val) : $quotaData[$key] + $val) //array
1629
+ : (is_numeric($quotaData[$key]) ? $quotaData[$key] + $val //numeric
1630
+ : $quotaData[$key] . ", " . $val); //string
1631
  }
1632
  }
1633
  $this->_settings->currentStats = $quotaData;
1781
  $this->prioQ->startBulk(ShortPixelQueue::BULK_TYPE_CLEANUP);
1782
  $this->_settings->customBulkPaused = 0;
1783
  }//end bulk restore was clicked
1784
+
1785
+ if(isset($_POST["bulkCleanupPending"]))
1786
+ {
1787
+ $this->prioQ->startBulk(ShortPixelQueue::BULK_TYPE_CLEANUP_PENDING);
1788
+ $this->_settings->customBulkPaused = 0;
1789
+ }//end bulk restore was clicked
1790
+
1791
  if(isset($_POST["bulkProcessResume"]))
1792
  {
1793
  $this->prioQ->resumeBulk();
1815
 
1816
  $this->view->displayBulkProcessingRunning($this->getPercent($quotaData), $msg, $quotaData['APICallsRemaining'], $this->getAverageCompression(),
1817
  $this->prioQ->getBulkType() == ShortPixelQueue::BULK_TYPE_RESTORE ? 0 :
1818
+ ( $this->prioQ->getBulkType() == ShortPixelQueue::BULK_TYPE_CLEANUP
1819
+ || $this->prioQ->getBulkType() == ShortPixelQueue::BULK_TYPE_CLEANUP_PENDING ? -1 : ($pendingMeta !== null ? ($this->prioQ->bulkRunning() ? 3 : 2) : 1)));
1820
 
1821
  } else
1822
  {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: compress, image, compression, optimize, image optimizer, image optimiser,
4
  Requires at least: 3.2.0
5
  Tested up to: 4.9
6
  Requires PHP: 5.2
7
- Stable tag: 4.8.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -228,6 +228,17 @@ The ShortPixel team is here to help. <a href="https://shortpixel.com/contact">Co
228
 
229
  == Changelog ==
230
 
 
 
 
 
 
 
 
 
 
 
 
231
  = 4.8.7 =
232
  * fix bug of the resize minimum size alert not dismissing
233
 
4
  Requires at least: 3.2.0
5
  Tested up to: 4.9
6
  Requires PHP: 5.2
7
+ Stable tag: 4.8.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
228
 
229
  == Changelog ==
230
 
231
+ = 4.8.8 =
232
+ * fix for trying to convert .png files that are not png actually
233
+ * fix for installs which don't have PHP GD - deactivate the png 2 jpg conversion
234
+ * fix for unserialize warnings
235
+ * improvements in bulk speed when passing through already optimized images.
236
+ * fix unsupported usage of const by third party punycode.js
237
+ * fix emails with new root domains like user@domain.store
238
+ * fix unsupported flock problem
239
+ * hidden button pending cleanup
240
+ * fix javascript not being able to generate the actions menu upon image being optimized while inside the image edit and displaying false instead
241
+
242
  = 4.8.7 =
243
  * fix bug of the resize minimum size alert not dismissing
244
 
res/css/short-pixel.css CHANGED
@@ -84,7 +84,7 @@ div.fb-like {
84
  li.sp-conflict-plugins-list {
85
  line-height: 28px;
86
  list-style: disc;
87
- margin-left: 20px;
88
  }
89
  li.sp-conflict-plugins-list a.button {
90
  margin-left: 10px;
84
  li.sp-conflict-plugins-list {
85
  line-height: 28px;
86
  list-style: disc;
87
+ margin-left: 80px;
88
  }
89
  li.sp-conflict-plugins-list a.button {
90
  margin-left: 10px;
res/css/short-pixel.min.css CHANGED
@@ -1 +1 @@
1
- .sp-dropbtn.button{padding:1px 24px 20px 5px;font-size:20px;cursor:pointer}.sp-dropdown{position:relative;display:inline-block}.sp-dropdown-content{display:none;right:0;position:absolute;background-color:#f9f9f9;min-width:190px;box-shadow:0 8px 16px 0 rgba(0,0,0,0.2);z-index:1}.sp-dropdown-content a{color:black;padding:12px 16px;text-decoration:none;display:block}.sp-dropdown-content a:hover{background-color:#f1f1f1}.sp-dropdown.sp-show .sp-dropdown-content{display:block}div.fb-like{transform:scale(1.3);-ms-transform:scale(1.3);-webkit-transform:scale(1.3);-o-transform:scale(1.3);-moz-transform:scale(1.3);transform-origin:bottom left;-ms-transform-origin:bottom left;-webkit-transform-origin:bottom left;-moz-transform-origin:bottom left;-webkit-transform-origin:bottom left}.wp-core-ui .button.button-alert,.wp-core-ui .button.button-alert:hover{background:#f79797}.wp-core-ui .button.remove-folder-button{min-width:120px}.sp-notice{background:#fff;border-left:4px solid #fff;-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 1px 0 rgba(0,0,0,.1);padding:1px 12px}@media(max-width:1249px){.sp-notice{margin:5px 15px 2px}}.sp-notice-info{border-left-color:#00a0d2}.sp-notice-success{border-left-color:#46b450}li.sp-conflict-plugins-list{line-height:28px;list-style:disc;margin-left:20px}li.sp-conflict-plugins-list a.button{margin-left:10px}div.short-pixel-bulk-page input.dial{font-size:16px!important}div.short-pixel-bulk-page h1{margin-bottom:20px}div.bulk-progress div.sp-h2{margin-top:0;margin-bottom:10px;font-size:23px;font-weight:400;padding:9px 15px 4px 0;line-height:29px}div.bulk-progress-partners{margin-top:20px}div.bulk-progress.bulk-progress-partners a div{display:inline-block;vertical-align:top;line-height:50px;margin-left:30px;font-size:1.2em}div.bulk-progress .bulk-progress-indicator,div.sp-quota-exceeded-alert .bulk-progress-indicator{display:inline-block;text-align:center;padding:0 10px;margin-left:10px;float:left;height:90px;overflow:hidden;border:1px solid #1caecb}div.wrap.short-pixel-bulk-page .bulk-notice-container{margin-top:15px;position:absolute;width:500px}div.wrap.short-pixel-bulk-page .bulk-notice-container .bulk-notice-msg{text-align:center;margin:10px 0 0 32px;overflow:hidden;border:1px solid #1caecb;background-color:#9ddbe0;border-radius:5px;padding:7px 10px 10px;display:none;max-width:600px;margin-right:20px}div.wrap.short-pixel-bulk-page .bulk-notice-container .bulk-notice-msg.bulk-error{border:1px solid #b5914d;background-color:#ffe996;margin-right:20px}div.wrap.short-pixel-bulk-page .bulk-notice-container .bulk-notice-msg.bulk-error.bulk-error-fatal{border:1px solid #c32525;background-color:#ff969d}div.wrap.short-pixel-bulk-page .bulk-notice-msg img{float:left;margin-top:3px;margin-right:5px}div.sp-bulk-summary{float:right;margin:8px 5px 3px 20px}input.dial{box-shadow:none}.shortpixel-table .column-filename{max-width:32em;width:40%}.shortpixel-table .column-folder{max-width:20em;width:20%}.shortpixel-table .column-media_type{max-width:8em;width:10%}.shortpixel-table .column-status{max-width:16em;width:15%}.shortpixel-table .column-options{max-width:16em;width:15%}.form-table table.shortpixel-folders-list tr{background-color:#eee}.form-table table.shortpixel-folders-list td{padding:5px 10px}div.shortpixel-rate-us{display:inline-block;margin-left:10px;vertical-align:top;font-weight:bold}div.shortpixel-rate-us>a{vertical-align:middle;padding:1px 5px 0;text-align:center;display:inline-block}div.shortpixel-rate-us>a>span{display:inline-block;vertical-align:top;margin-top:5px}div.shortpixel-rate-us>a>img{padding-top:7px}div.shortpixel-rate-us>a:active,div.shortpixel-rate-us>a:hover,div.shortpixel-rate-us>a:focus{outline:0;border-style:none}.sp-loading-small{margin-top:2px;float:left;margin-right:5px}li.shortpixel-toolbar-processing>a.ab-item>div,#wpadminbar li.shortpixel-toolbar-processing>a.ab-item>div{height:33px;margin-top:-1px;padding:0 3px}li.shortpixel-toolbar-processing>a.ab-item>div>img,#wpadminbar li.shortpixel-toolbar-processing>a.ab-item>div>img{margin-right:2px;margin-top:6px}li.shortpixel-toolbar-processing>a.ab-item>div>span.shp-alert,#wpadminbar li.shortpixel-toolbar-processing>a.ab-item>div>span.shp-alert{display:none}li.shortpixel-toolbar-processing.shortpixel-alert>a.ab-item>div>span.shp-alert,#wpadminbar li.shortpixel-toolbar-processing.shortpixel-alert>a.ab-item>div>span.shp-alert{display:inline;font-size:26px;color:red;font-weight:bold;vertical-align:top}li.shortpixel-toolbar-processing.shortpixel-alert>a.ab-item>div,#wpadminbar li.shortpixel-toolbar-processing.shortpixel-alert>a.ab-item>div{background-image:none}.sp-quota-exceeded-alert{background-color:#fff;border-left:4px solid #f00;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);padding:1px 12px}.shortpixel-hide{display:none}.shortpixel-clearfix{width:100%;float:left}div.sp-modal-shade{display:none;position:fixed;z-index:10;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:#000;background-color:rgba(0,0,0,0.4)}div.shortpixel-modal{background-color:#fefefe;margin:8% auto;padding:20px;border:1px solid #888;width:30%;min-width:300px}div.shortpixel-modal .sp-close-button,div.shortpixel-modal .sp-close-upgrade-button{float:right;margin-top:0;background:transparent;border:0;font-size:22px;line-height:10px;cursor:pointer}.twentytwenty-horizontal .twentytwenty-before-label:before,.twentytwenty-horizontal .twentytwenty-after-label:before{font-family:inherit;font-size:16px}div.sp-modal-title{font-size:22px}div.sp-modal-body{margin-top:20px}.short-pixel-bulk-page p{margin:.6em 0}div.shortpixel-modal .sptw-modal-spinner{background-image:url("../img/spinner2.gif");background-repeat:no-repeat;background-position:center}.short-pixel-bulk-page form.start{display:table;content:" ";width:98%;background-color:white;padding:10px 10px 0;position:relative}.bulk-stats-container{display:inline-block;min-width:450px;width:45%;float:left;padding-right:50px;font-size:1.1em;line-height:1.5em}.bulk-text-container{display:inline-block;min-width:440px;width:45%;float:left;padding-right:50px}.bulk-text-container h3{border-bottom:1px solid #a8a8a8;margin-bottom:.5em;padding-bottom:.5em}.bulk-wide{display:inline-block;width:90%;float:left;margin-top:25px}.bulk-stats-container .bulk-label{width:220px;display:inline-block}.bulk-stats-container .bulk-val{width:50px;display:inline-block;text-align:right}.bulk-stats-container .bulk-total{font-weight:bold;margin-top:10px;margin-bottom:10px}.wp-core-ui .bulk-play{display:inline;width:310px;float:left;margin-bottom:20px}.wp-core-ui .bulk-play.bulk-nothing-optimize{font-weight:bold;color:#0080b2;border:1px solid;border-radius:5px;margin-top:60px;padding:5px 12px}.wp-core-ui .bulk-play a.button{height:60px;margin-top:27px;width:290px;overflow:hidden}.wp-core-ui .column-wp-shortPixel .sp-column-actions{max-width:140px;float:right;text-align:right}.wp-core-ui .column-wp-shortPixel .sp-column-actions .button.button-smaller{margin-right:0}.wp-core-ui .column-wp-shortPixel .button.button-smaller{font-size:13px;padding:0 5px;margin-bottom:4px;height:20px;line-height:16px;float:right}.wp-core-ui .bulk-play a.button .bulk-btn-img{float:left;display:inline-block;padding-top:6px}.wp-core-ui .bulk-play a.button .bulk-btn-txt{float:left;display:inline-block;text-align:right;line-height:1.3em;margin:11px 10px}.wp-core-ui .bulk-play a.button .bulk-btn-txt span.label{font-size:1.6em}.wp-core-ui .bulk-play a.button .bulk-btn-txt span.total{font-size:1.4em}.short-pixel-notice-icon{float:left;margin:10px 10px 10px 0}.bulk-progress{padding:20px 32px 17px;background-color:#fff}.bulk-progress.bulk-stats>div{display:inline-block}.bulk-progress.bulk-stats>div.label{width:320px}.bulk-progress.bulk-stats>div.stat-value{width:80px;text-align:right}.progress{background-color:#ecedee;height:30px;position:relative;width:60%;display:inline-block;margin-right:28px}.progress .progress-img{position:absolute;top:-10px;z-index:2;margin-left:-35px;line-height:48px;font-size:22px;font-weight:bold}.progress .progress-img span{vertical-align:top;margin-left:-7px}.progress .progress-left{background-color:#1cbecb;bottom:0;left:0;position:absolute;top:0;z-index:1;font-size:22px;font-weight:bold;line-height:28px;text-align:center;color:#fff}.bulk-estimate{font-size:20px;line-height:30px;vertical-align:top;display:inline-block}.wp-core-ui .button-primary.bulk-cancel{float:right;height:30px}.short-pixel-block-title{font-size:22px;font-weight:bold;margin-bottom:15px;text-align:center;margin-bottom:30px}.sp-floating-block.bulk-slider-container{display:none}.sp-floating-block.sp-notice.bulk-notices-parent{padding:0;margin:0;float:right;margin-right:500px!important}.bulk-slider-container{margin-top:20px;min-height:300px;overflow:hidden}.bulk-slider-container h2{margin-bottom:15px}.bulk-slider-container span.filename{font-weight:normal}.bulk-slider{display:table;margin:0 auto}.bulk-slider .bulk-slide{margin:0 auto;padding-left:120px;display:inline-block;font-weight:bold}.bulk-slider .img-original,.bulk-slider .img-optimized{display:inline-block;margin-right:20px;text-align:center}.bulk-slider .img-original div,.bulk-slider .img-optimized div{max-height:450px;overflow:hidden}.bulk-slider .img-original img,.bulk-slider .img-optimized img{max-width:300px}.bulk-slider .img-info{display:inline-block;vertical-align:top;font-size:48px;max-width:150px;padding:10px 0 0 20px}.bulk-slide-images{display:inline-block;border:1px solid #1caecb;padding:15px 0 0 20px}p.settings-info{padding-top:0;color:#818181;font-size:13px!important}p.settings-info.shortpixel-settings-error{color:#c32525}article.sp-tabs{position:relative;display:block;width:100%;height:1100px;margin:2em auto}article.sp-tabs section{position:absolute;display:block;top:1.8em;left:0;height:1100px;width:94%;padding:10px 20px;background-color:#ddd;box-shadow:0 3px 3px rgba(0,0,0,0.1);z-index:0}article.sp-tabs section:first-child{z-index:1}article.sp-tabs section h2{position:absolute;font-size:1.3em;font-weight:normal;width:180px;height:1.8em;top:-1.8em;left:10px;padding:0;margin:0;color:#999;background-color:#ddd}article.sp-tabs section:nth-child(2) h2{left:192px}article.sp-tabs section:nth-child(3) h2{left:374px}article.sp-tabs section:nth-child(4) h2{left:556px}article.sp-tabs section h2 a{display:block;width:100%;line-height:1.8em;text-align:center;text-decoration:none;color:#23282d;outline:0 none}article.sp-tabs section h2 a:focus,article.sp-tabs section#tab-resources a:focus{box-shadow:none;outline:0}article.sp-tabs section.sel-tab,article.sp-tabs section.sel-tab h2{color:#333;background-color:#fff;z-index:2}.shortpixel-help-link span.dashicons{text-decoration:none;margin-top:-1px}@media(min-width:1000px){section#tab-resources .col-md-6{display:inline-block;width:45%}}@media(max-width:999px){section#tab-resources .col-sm-12{display:inline-block;width:100%}}section#tab-resources .text-center{text-align:center}section#tab-resources p{font-size:16px}.wrap.short-pixel-bulk-page{margin-right:0}.sp-container{overflow:hidden;display:block;width:100%}.sp-floating-block{overflow:hidden;display:inline-block;float:left;margin-right:1.1%!important}.sp-full-width{width:98.8%;box-sizing:border-box}.sp-double-width{width:65.52%;box-sizing:border-box}.sp-single-width{width:32.23%;box-sizing:border-box}@media(max-width:1759px){.sp-floating-block{margin-right:1.3%!important}.sp-double-width,.sp-full-width{width:98.65%}.sp-single-width{width:48.7%}}@media(max-width:1249px){.sp-floating-block{margin-right:2%!important}.sp-double-width,.sp-full-width,.sp-single-width{width:97%}}.sp-tabs h2:before{content:none}#wpadminbar .shortpixel-toolbar-processing .cssload-container{width:100%;height:24px;text-align:center;position:absolute;top:0;left:-1px}#wpadminbar .shortpixel-toolbar-processing.shortpixel-quota-exceeded .cssload-container{display:none}#wpadminbar .shortpixel-toolbar-processing .cssload-speeding-wheel{width:24px;height:24px;opacity:.7;margin:0 auto;border:4px solid #1cbfcb;border-radius:50%;border-left-color:transparent;animation:cssload-spin 2000ms infinite linear;-o-animation:cssload-spin 2000ms infinite linear;-ms-animation:cssload-spin 2000ms infinite linear;-webkit-animation:cssload-spin 2000ms infinite linear;-moz-animation:cssload-spin 2000ms infinite linear}@keyframes cssload-spin{100%{transform:rotate(360deg);transform:rotate(360deg)}}@-o-keyframes cssload-spin{100%{-o-transform:rotate(360deg);transform:rotate(360deg)}}@-ms-keyframes cssload-spin{100%{-ms-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes cssload-spin{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes cssload-spin{100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}
1
+ .sp-dropbtn.button{padding:1px 24px 20px 5px;font-size:20px;cursor:pointer}.sp-dropdown{position:relative;display:inline-block}.sp-dropdown-content{display:none;right:0;position:absolute;background-color:#f9f9f9;min-width:190px;box-shadow:0 8px 16px 0 rgba(0,0,0,0.2);z-index:1}.sp-dropdown-content a{color:black;padding:12px 16px;text-decoration:none;display:block}.sp-dropdown-content a:hover{background-color:#f1f1f1}.sp-dropdown.sp-show .sp-dropdown-content{display:block}div.fb-like{transform:scale(1.3);-ms-transform:scale(1.3);-webkit-transform:scale(1.3);-o-transform:scale(1.3);-moz-transform:scale(1.3);transform-origin:bottom left;-ms-transform-origin:bottom left;-webkit-transform-origin:bottom left;-moz-transform-origin:bottom left;-webkit-transform-origin:bottom left}.wp-core-ui .button.button-alert,.wp-core-ui .button.button-alert:hover{background:#f79797}.wp-core-ui .button.remove-folder-button{min-width:120px}.sp-notice{background:#fff;border-left:4px solid #fff;-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 1px 0 rgba(0,0,0,.1);padding:1px 12px}@media(max-width:1249px){.sp-notice{margin:5px 15px 2px}}.sp-notice-info{border-left-color:#00a0d2}.sp-notice-success{border-left-color:#46b450}li.sp-conflict-plugins-list{line-height:28px;list-style:disc;margin-left:80px}li.sp-conflict-plugins-list a.button{margin-left:10px}div.short-pixel-bulk-page input.dial{font-size:16px!important}div.short-pixel-bulk-page h1{margin-bottom:20px}div.bulk-progress div.sp-h2{margin-top:0;margin-bottom:10px;font-size:23px;font-weight:400;padding:9px 15px 4px 0;line-height:29px}div.bulk-progress-partners{margin-top:20px}div.bulk-progress.bulk-progress-partners a div{display:inline-block;vertical-align:top;line-height:50px;margin-left:30px;font-size:1.2em}div.bulk-progress .bulk-progress-indicator,div.sp-quota-exceeded-alert .bulk-progress-indicator{display:inline-block;text-align:center;padding:0 10px;margin-left:10px;float:left;height:90px;overflow:hidden;border:1px solid #1caecb}div.wrap.short-pixel-bulk-page .bulk-notice-container{margin-top:15px;position:absolute;width:500px}div.wrap.short-pixel-bulk-page .bulk-notice-container .bulk-notice-msg{text-align:center;margin:10px 0 0 32px;overflow:hidden;border:1px solid #1caecb;background-color:#9ddbe0;border-radius:5px;padding:7px 10px 10px;display:none;max-width:600px;margin-right:20px}div.wrap.short-pixel-bulk-page .bulk-notice-container .bulk-notice-msg.bulk-error{border:1px solid #b5914d;background-color:#ffe996;margin-right:20px}div.wrap.short-pixel-bulk-page .bulk-notice-container .bulk-notice-msg.bulk-error.bulk-error-fatal{border:1px solid #c32525;background-color:#ff969d}div.wrap.short-pixel-bulk-page .bulk-notice-msg img{float:left;margin-top:3px;margin-right:5px}div.sp-bulk-summary{float:right;margin:8px 5px 3px 20px}input.dial{box-shadow:none}.shortpixel-table .column-filename{max-width:32em;width:40%}.shortpixel-table .column-folder{max-width:20em;width:20%}.shortpixel-table .column-media_type{max-width:8em;width:10%}.shortpixel-table .column-status{max-width:16em;width:15%}.shortpixel-table .column-options{max-width:16em;width:15%}.form-table table.shortpixel-folders-list tr{background-color:#eee}.form-table table.shortpixel-folders-list td{padding:5px 10px}div.shortpixel-rate-us{display:inline-block;margin-left:10px;vertical-align:top;font-weight:bold}div.shortpixel-rate-us>a{vertical-align:middle;padding:1px 5px 0;text-align:center;display:inline-block}div.shortpixel-rate-us>a>span{display:inline-block;vertical-align:top;margin-top:5px}div.shortpixel-rate-us>a>img{padding-top:7px}div.shortpixel-rate-us>a:active,div.shortpixel-rate-us>a:hover,div.shortpixel-rate-us>a:focus{outline:0;border-style:none}.sp-loading-small{margin-top:2px;float:left;margin-right:5px}li.shortpixel-toolbar-processing>a.ab-item>div,#wpadminbar li.shortpixel-toolbar-processing>a.ab-item>div{height:33px;margin-top:-1px;padding:0 3px}li.shortpixel-toolbar-processing>a.ab-item>div>img,#wpadminbar li.shortpixel-toolbar-processing>a.ab-item>div>img{margin-right:2px;margin-top:6px}li.shortpixel-toolbar-processing>a.ab-item>div>span.shp-alert,#wpadminbar li.shortpixel-toolbar-processing>a.ab-item>div>span.shp-alert{display:none}li.shortpixel-toolbar-processing.shortpixel-alert>a.ab-item>div>span.shp-alert,#wpadminbar li.shortpixel-toolbar-processing.shortpixel-alert>a.ab-item>div>span.shp-alert{display:inline;font-size:26px;color:red;font-weight:bold;vertical-align:top}li.shortpixel-toolbar-processing.shortpixel-alert>a.ab-item>div,#wpadminbar li.shortpixel-toolbar-processing.shortpixel-alert>a.ab-item>div{background-image:none}.sp-quota-exceeded-alert{background-color:#fff;border-left:4px solid #f00;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);padding:1px 12px}.shortpixel-hide{display:none}.shortpixel-clearfix{width:100%;float:left}div.sp-modal-shade{display:none;position:fixed;z-index:10;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:#000;background-color:rgba(0,0,0,0.4)}div.shortpixel-modal{background-color:#fefefe;margin:8% auto;padding:20px;border:1px solid #888;width:30%;min-width:300px}div.shortpixel-modal .sp-close-button,div.shortpixel-modal .sp-close-upgrade-button{float:right;margin-top:0;background:transparent;border:0;font-size:22px;line-height:10px;cursor:pointer}.twentytwenty-horizontal .twentytwenty-before-label:before,.twentytwenty-horizontal .twentytwenty-after-label:before{font-family:inherit;font-size:16px}div.sp-modal-title{font-size:22px}div.sp-modal-body{margin-top:20px}.short-pixel-bulk-page p{margin:.6em 0}div.shortpixel-modal .sptw-modal-spinner{background-image:url("../img/spinner2.gif");background-repeat:no-repeat;background-position:center}.short-pixel-bulk-page form.start{display:table;content:" ";width:98%;background-color:white;padding:10px 10px 0;position:relative}.bulk-stats-container{display:inline-block;min-width:450px;width:45%;float:left;padding-right:50px;font-size:1.1em;line-height:1.5em}.bulk-text-container{display:inline-block;min-width:440px;width:45%;float:left;padding-right:50px}.bulk-text-container h3{border-bottom:1px solid #a8a8a8;margin-bottom:.5em;padding-bottom:.5em}.bulk-wide{display:inline-block;width:90%;float:left;margin-top:25px}.bulk-stats-container .bulk-label{width:220px;display:inline-block}.bulk-stats-container .bulk-val{width:50px;display:inline-block;text-align:right}.bulk-stats-container .bulk-total{font-weight:bold;margin-top:10px;margin-bottom:10px}.wp-core-ui .bulk-play{display:inline;width:310px;float:left;margin-bottom:20px}.wp-core-ui .bulk-play.bulk-nothing-optimize{font-weight:bold;color:#0080b2;border:1px solid;border-radius:5px;margin-top:60px;padding:5px 12px}.wp-core-ui .bulk-play a.button{height:60px;margin-top:27px;width:290px;overflow:hidden}.wp-core-ui .column-wp-shortPixel .sp-column-actions{max-width:140px;float:right;text-align:right}.wp-core-ui .column-wp-shortPixel .sp-column-actions .button.button-smaller{margin-right:0}.wp-core-ui .column-wp-shortPixel .button.button-smaller{font-size:13px;padding:0 5px;margin-bottom:4px;height:20px;line-height:16px;float:right}.wp-core-ui .bulk-play a.button .bulk-btn-img{float:left;display:inline-block;padding-top:6px}.wp-core-ui .bulk-play a.button .bulk-btn-txt{float:left;display:inline-block;text-align:right;line-height:1.3em;margin:11px 10px}.wp-core-ui .bulk-play a.button .bulk-btn-txt span.label{font-size:1.6em}.wp-core-ui .bulk-play a.button .bulk-btn-txt span.total{font-size:1.4em}.short-pixel-notice-icon{float:left;margin:10px 10px 10px 0}.bulk-progress{padding:20px 32px 17px;background-color:#fff}.bulk-progress.bulk-stats>div{display:inline-block}.bulk-progress.bulk-stats>div.label{width:320px}.bulk-progress.bulk-stats>div.stat-value{width:80px;text-align:right}.progress{background-color:#ecedee;height:30px;position:relative;width:60%;display:inline-block;margin-right:28px}.progress .progress-img{position:absolute;top:-10px;z-index:2;margin-left:-35px;line-height:48px;font-size:22px;font-weight:bold}.progress .progress-img span{vertical-align:top;margin-left:-7px}.progress .progress-left{background-color:#1cbecb;bottom:0;left:0;position:absolute;top:0;z-index:1;font-size:22px;font-weight:bold;line-height:28px;text-align:center;color:#fff}.bulk-estimate{font-size:20px;line-height:30px;vertical-align:top;display:inline-block}.wp-core-ui .button-primary.bulk-cancel{float:right;height:30px}.short-pixel-block-title{font-size:22px;font-weight:bold;margin-bottom:15px;text-align:center;margin-bottom:30px}.sp-floating-block.bulk-slider-container{display:none}.sp-floating-block.sp-notice.bulk-notices-parent{padding:0;margin:0;float:right;margin-right:500px!important}.bulk-slider-container{margin-top:20px;min-height:300px;overflow:hidden}.bulk-slider-container h2{margin-bottom:15px}.bulk-slider-container span.filename{font-weight:normal}.bulk-slider{display:table;margin:0 auto}.bulk-slider .bulk-slide{margin:0 auto;padding-left:120px;display:inline-block;font-weight:bold}.bulk-slider .img-original,.bulk-slider .img-optimized{display:inline-block;margin-right:20px;text-align:center}.bulk-slider .img-original div,.bulk-slider .img-optimized div{max-height:450px;overflow:hidden}.bulk-slider .img-original img,.bulk-slider .img-optimized img{max-width:300px}.bulk-slider .img-info{display:inline-block;vertical-align:top;font-size:48px;max-width:150px;padding:10px 0 0 20px}.bulk-slide-images{display:inline-block;border:1px solid #1caecb;padding:15px 0 0 20px}p.settings-info{padding-top:0;color:#818181;font-size:13px!important}p.settings-info.shortpixel-settings-error{color:#c32525}article.sp-tabs{position:relative;display:block;width:100%;height:1100px;margin:2em auto}article.sp-tabs section{position:absolute;display:block;top:1.8em;left:0;height:1100px;width:94%;padding:10px 20px;background-color:#ddd;box-shadow:0 3px 3px rgba(0,0,0,0.1);z-index:0}article.sp-tabs section:first-child{z-index:1}article.sp-tabs section h2{position:absolute;font-size:1.3em;font-weight:normal;width:180px;height:1.8em;top:-1.8em;left:10px;padding:0;margin:0;color:#999;background-color:#ddd}article.sp-tabs section:nth-child(2) h2{left:192px}article.sp-tabs section:nth-child(3) h2{left:374px}article.sp-tabs section:nth-child(4) h2{left:556px}article.sp-tabs section h2 a{display:block;width:100%;line-height:1.8em;text-align:center;text-decoration:none;color:#23282d;outline:0 none}article.sp-tabs section h2 a:focus,article.sp-tabs section#tab-resources a:focus{box-shadow:none;outline:0}article.sp-tabs section.sel-tab,article.sp-tabs section.sel-tab h2{color:#333;background-color:#fff;z-index:2}.shortpixel-help-link span.dashicons{text-decoration:none;margin-top:-1px}@media(min-width:1000px){section#tab-resources .col-md-6{display:inline-block;width:45%}}@media(max-width:999px){section#tab-resources .col-sm-12{display:inline-block;width:100%}}section#tab-resources .text-center{text-align:center}section#tab-resources p{font-size:16px}.wrap.short-pixel-bulk-page{margin-right:0}.sp-container{overflow:hidden;display:block;width:100%}.sp-floating-block{overflow:hidden;display:inline-block;float:left;margin-right:1.1%!important}.sp-full-width{width:98.8%;box-sizing:border-box}.sp-double-width{width:65.52%;box-sizing:border-box}.sp-single-width{width:32.23%;box-sizing:border-box}@media(max-width:1759px){.sp-floating-block{margin-right:1.3%!important}.sp-double-width,.sp-full-width{width:98.65%}.sp-single-width{width:48.7%}}@media(max-width:1249px){.sp-floating-block{margin-right:2%!important}.sp-double-width,.sp-full-width,.sp-single-width{width:97%}}.sp-tabs h2:before{content:none}#wpadminbar .shortpixel-toolbar-processing .cssload-container{width:100%;height:24px;text-align:center;position:absolute;top:0;left:-1px}#wpadminbar .shortpixel-toolbar-processing.shortpixel-quota-exceeded .cssload-container{display:none}#wpadminbar .shortpixel-toolbar-processing .cssload-speeding-wheel{width:24px;height:24px;opacity:.7;margin:0 auto;border:4px solid #1cbfcb;border-radius:50%;border-left-color:transparent;animation:cssload-spin 2000ms infinite linear;-o-animation:cssload-spin 2000ms infinite linear;-ms-animation:cssload-spin 2000ms infinite linear;-webkit-animation:cssload-spin 2000ms infinite linear;-moz-animation:cssload-spin 2000ms infinite linear}@keyframes cssload-spin{100%{transform:rotate(360deg);transform:rotate(360deg)}}@-o-keyframes cssload-spin{100%{-o-transform:rotate(360deg);transform:rotate(360deg)}}@-ms-keyframes cssload-spin{100%{-ms-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes cssload-spin{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes cssload-spin{100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}
res/js/punycode.js CHANGED
@@ -291,7 +291,7 @@ var sp_punycode = function(){
291
  * @param {String} input The string of Unicode symbols.
292
  * @returns {String} The resulting Punycode string of ASCII-only symbols.
293
  */
294
- const encode = function(input) {
295
  var output = [];
296
 
297
  // Convert the input in UCS-2 to an array of Unicode code points.
291
  * @param {String} input The string of Unicode symbols.
292
  * @returns {String} The resulting Punycode string of ASCII-only symbols.
293
  */
294
+ var encode = function(input) {
295
  var output = [];
296
 
297
  // Convert the input in UCS-2 to an array of Unicode code points.
res/js/punycode.min.js CHANGED
@@ -1 +1 @@
1
- 'use strict';var sp_punycode=function(){function a(K){throw new RangeError(y[K])}function b(K,L){for(var M=[],N=K.length;N--;)M[N]=L(K[N]);return M}function c(K,L){var M=K.split('@'),N='';1<M.length&&(N=M[0]+'@',K=M[1]),K=K.replace(x,'.');var O=K.split('.'),P=b(O,L).join('.');return N+P}function d(K){for(var O,L=[],M=0,N=K.length;M<N;)if(O=K.charCodeAt(M++),55296<=O&&56319>=O&&M<N){var P=K.charCodeAt(M++);56320==(64512&P)?L.push(((1023&O)<<10)+(1023&P)+65536):(L.push(O),M--)}else L.push(O);return L}var e=2147483647,f=36,g=1,h=26,p=72,r=128,s='-',u=/^xn--/,v=/[^\0-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:'Overflow: input needs wider integers to process','not-basic':'Illegal input >= 0x80 (not a basic code point)','invalid-input':'Invalid input'},z=f-g,A=Math.floor,B=String.fromCharCode,D=function(K){return 10>K-48?K-22:26>K-65?K-65:26>K-97?K-97:f},E=function(K,L){return K+22+75*(26>K)-((0!=L)<<5)},F=function(K,L,M){var N=0;for(K=M?A(K/700):K>>1,K+=A(K/L);K>z*h>>1;N+=f)K=A(K/z);return A(N+(z+1)*K/(K+38))},G=function(K){var L=[],M=K.length,N=0,O=r,P=p,Q=K.lastIndexOf(s);0>Q&&(Q=0);for(var R=0;R<Q;++R)128<=K.charCodeAt(R)&&a('not-basic'),L.push(K.charCodeAt(R));for(var T,S=0<Q?Q+1:0;S<M;){T=N;for(var U=1,V=f;;V+=f){S>=M&&a('invalid-input');var W=D(K.charCodeAt(S++));(W>=f||W>A((e-N)/U))&&a('overflow'),N+=W*U;var X=V<=P?g:V>=P+h?h:V-P;if(W<X)break;var Y=f-X;U>A(e/Y)&&a('overflow'),U*=Y}var Z=L.length+1;P=F(N-T,Z,0==T),A(N/Z)>e-O&&a('overflow'),O+=A(N/Z),N%=Z,L.splice(N++,0,O)}return String.fromCodePoint.prototype.apply(null,L)};const H=function(K){var L=[];K=d(K);var M=K.length,N=r,O=0,P=p;for(var Q of K)128>Q&&L.push(B(Q));var R=L.length,S=R;for(R&&L.push(s);S<M;){var T=e;for(var Q of K)Q>=N&&Q<T&&(T=Q);var U=S+1;T-N>A((e-O)/U)&&a('overflow'),O+=(T-N)*U,N=T;for(var Q of K)if(Q<N&&++O>e&&a('overflow'),Q==N){for(var X,V=O,W=f;;W+=f){if(X=W<=P?g:W>=P+h?h:W-P,V<X)break;var Y=V-X,Z=f-X;L.push(B(E(X+Y%Z,0))),V=A(Y/Z)}L.push(B(E(V,0))),P=F(O,U,S==R),O=0,++S}++O,++N}return L.join('')};return{version:'2.1.0',ucs2:{decode:d,encode:K=>String.fromCodePoint.prototype.apply(null,K)},decode:G,encode:H,toASCII:function(K){return c(K,function(L){return v.test(L)?'xn--'+H(L):L})},toUnicode:function(K){return c(K,function(L){return u.test(L)?G(L.slice(4).toLowerCase()):L})}}}();
1
+ 'use strict';var sp_punycode=function(){function a(K){throw new RangeError(y[K])}function b(K,L){for(var M=[],N=K.length;N--;)M[N]=L(K[N]);return M}function c(K,L){var M=K.split('@'),N='';1<M.length&&(N=M[0]+'@',K=M[1]),K=K.replace(x,'.');var O=K.split('.'),P=b(O,L).join('.');return N+P}function d(K){for(var O,L=[],M=0,N=K.length;M<N;)if(O=K.charCodeAt(M++),55296<=O&&56319>=O&&M<N){var P=K.charCodeAt(M++);56320==(64512&P)?L.push(((1023&O)<<10)+(1023&P)+65536):(L.push(O),M--)}else L.push(O);return L}var e=2147483647,f=36,g=1,h=26,p=72,r=128,s='-',u=/^xn--/,v=/[^\0-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:'Overflow: input needs wider integers to process','not-basic':'Illegal input >= 0x80 (not a basic code point)','invalid-input':'Invalid input'},z=f-g,A=Math.floor,B=String.fromCharCode,D=function(K){return 10>K-48?K-22:26>K-65?K-65:26>K-97?K-97:f},E=function(K,L){return K+22+75*(26>K)-((0!=L)<<5)},F=function(K,L,M){var N=0;for(K=M?A(K/700):K>>1,K+=A(K/L);K>z*h>>1;N+=f)K=A(K/z);return A(N+(z+1)*K/(K+38))},G=function(K){var L=[],M=K.length,N=0,O=r,P=p,Q=K.lastIndexOf(s);0>Q&&(Q=0);for(var R=0;R<Q;++R)128<=K.charCodeAt(R)&&a('not-basic'),L.push(K.charCodeAt(R));for(var T,S=0<Q?Q+1:0;S<M;){T=N;for(var U=1,V=f;;V+=f){S>=M&&a('invalid-input');var W=D(K.charCodeAt(S++));(W>=f||W>A((e-N)/U))&&a('overflow'),N+=W*U;var X=V<=P?g:V>=P+h?h:V-P;if(W<X)break;var Y=f-X;U>A(e/Y)&&a('overflow'),U*=Y}var Z=L.length+1;P=F(N-T,Z,0==T),A(N/Z)>e-O&&a('overflow'),O+=A(N/Z),N%=Z,L.splice(N++,0,O)}return String.fromCodePoint.prototype.apply(null,L)};var H=function(K){var L=[];K=d(K);var M=K.length,N=r,O=0,P=p;for(var Q of K)128>Q&&L.push(B(Q));var R=L.length,S=R;for(R&&L.push(s);S<M;){var T=e;for(var Q of K)Q>=N&&Q<T&&(T=Q);var U=S+1;T-N>A((e-O)/U)&&a('overflow'),O+=(T-N)*U,N=T;for(var Q of K)if(Q<N&&++O>e&&a('overflow'),Q==N){for(var X,V=O,W=f;;W+=f){if(X=W<=P?g:W>=P+h?h:W-P,V<X)break;var Y=V-X,Z=f-X;L.push(B(E(X+Y%Z,0))),V=A(Y/Z)}L.push(B(E(V,0))),P=F(O,U,S==R),O=0,++S}++O,++N}return L.join('')};return{version:'2.1.0',ucs2:{decode:d,encode:K=>String.fromCodePoint.prototype.apply(null,K)},decode:G,encode:H,toASCII:function(K){return c(K,function(L){return v.test(L)?'xn--'+H(L):L})},toUnicode:function(K){return c(K,function(L){return u.test(L)?G(L.slice(4).toLowerCase()):L})}}}();
res/js/short-pixel.js CHANGED
@@ -43,7 +43,7 @@ var ShortPixel = function() {
43
  }
44
 
45
  function isEmailValid(email) {
46
- return /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email);
47
  }
48
 
49
  function updateSignupEmail() {
43
  }
44
 
45
  function isEmailValid(email) {
46
+ return /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{1,63})+$/.test(email);
47
  }
48
 
49
  function updateSignupEmail() {
res/js/short-pixel.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(a){if(jQuery("table.wp-list-table.media").length>0){jQuery('select[name^="action"] option:last-child').before('<option value="short-pixel-bulk">'+_spTr.optimizeWithSP+"</option>")}ShortPixel.setOptions(ShortPixelConstants);if(jQuery("#backup-folder-size").length){jQuery("#backup-folder-size").html(ShortPixel.getBackupSize())}if(ShortPixel.MEDIA_ALERT=="todo"&&jQuery("div.media-frame.mode-grid").length>0){jQuery("div.media-frame.mode-grid").before('<div id="short-pixel-media-alert" class="notice notice-warning"><p>'+_spTr.changeMLToListMode.format('<a href="upload.php?mode=list" class="view-list"><span class="screen-reader-text">'," </span>",'</a><a class="alignright" href="javascript:ShortPixel.dismissMediaAlert();">',"</a>")+"</p></div>")}jQuery(window).on("beforeunload",function(){if(ShortPixel.bulkProcessor==true){clearBulkProcessor()}});checkQuotaExceededAlert();checkBulkProgress()});var ShortPixel=function(){function l(M){for(var N in M){ShortPixel[N]=M[N]}}function s(M){return/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(M)}function m(){var M=jQuery("#pluginemail").val();if(ShortPixel.isEmailValid(M)){jQuery("#request_key").removeClass("disabled")}jQuery("#request_key").attr("href",jQuery("#request_key").attr("href").split("?")[0]+"?pluginemail="+M)}function a(){jQuery("#valid").val("validate");jQuery("#wp_shortpixel_options").submit()}jQuery("#key").keypress(function(M){if(M.which==13){jQuery("#valid").val("validate")}});function H(M){if(jQuery(M).is(":checked")){jQuery("#width,#height").removeAttr("disabled")}else{jQuery("#width,#height").attr("disabled","disabled")}}function e(M,O,Q){for(var N=0,P=null;N<M.length;N++){M[N].onclick=function(){if(this!==P){P=this}alert(_spTr.alertOnlyAppliesToNewImages)}}ShortPixel.enableResize("#resize");jQuery("#resize").change(function(){H(this)});jQuery(".resize-sizes").blur(function(S){var T=jQuery(this);if(ShortPixel.resizeSizesAlert==T.val()){return}ShortPixel.resizeSizesAlert=T.val();var R=jQuery("#min-"+T.attr("name")).val();if(T.val()<Math.min(R,1024)){if(R>1024){alert(_spTr.pleaseDoNotSetLesser1024.format(T.attr("name")))}else{alert(_spTr.pleaseDoNotSetLesserSize.format(T.attr("name"),T.attr("name"),R))}S.preventDefault();T.focus()}else{this.defaultValue=T.val()}})}function t(){jQuery("input.remove-folder-button").click(function(){var N=jQuery(this).data("value");var M=confirm(_spTr.areYouSureStopOptimizing.format(N));if(M==true){jQuery("#removeFolder").val(N);jQuery("#wp_shortpixel_options").submit()}});jQuery("input.recheck-folder-button").click(function(){var N=jQuery(this).data("value");var M=confirm(_spTr.areYouSureStopOptimizing.format(N));if(M==true){jQuery("#recheckFolder").val(N);jQuery("#wp_shortpixel_options").submit()}})}function G(M){var N=jQuery("#"+(M.checked?"total":"main")+"ToProcess").val();jQuery("div.bulk-play span.total").text(N);jQuery("#displayTotal").text(N)}function w(N){var M=jQuery("section#"+N);if(M.length>0){jQuery("section").removeClass("sel-tab");jQuery("section#"+N).addClass("sel-tab")}}function x(){var M=jQuery("section#tab-settings .wp-shortpixel-options").height()+90;M=Math.max(M,jQuery("section#tab-adv-settings .wp-shortpixel-options").height()+20);M=Math.max(M,jQuery("section#tab-resources .area1").height()+60);jQuery("#shortpixel-settings-tabs").css("height",M);jQuery("#shortpixel-settings-tabs section").css("height",M)}function I(){var M={action:"shortpixel_dismiss_media_alert"};jQuery.get(ShortPixel.AJAX_URL,M,function(N){M=JSON.parse(N);if(M.Status=="success"){jQuery("#short-pixel-media-alert").hide();console.log("dismissed")}})}function j(){var M={action:"shortpixel_check_quota"};jQuery.get(ShortPixel.AJAX_URL,M,function(){console.log("quota refreshed")})}function z(M){if(M.checked){jQuery("#with-thumbs").css("display","inherit");jQuery("#without-thumbs").css("display","none")}else{jQuery("#without-thumbs").css("display","inherit");jQuery("#with-thumbs").css("display","none")}}function b(Q,O,N,P,M){return(O>0?"<div class='sp-column-info'>"+_spTr.reducedBy+" <strong><span class='percent'>"+O+"%</span></strong> ":"")+(O>0&&O<5?"<br>":"")+(O<5?_spTr.bonusProcessing:"")+(N.length>0?" ("+N+")":"")+(0+P>0?"<br>"+_spTr.plusXthumbsOpt.format(P):"")+(0+M>0?"<br>"+_spTr.plusXretinasOpt.format(M):"")+"</div>"}function o(N,M){jQuery(N).knob({readOnly:true,width:M,height:M,fgColor:"#1CAECB",format:function(O){return O+"%"}})}function c(T,O,R,Q,N,S){if(N==1){var P=jQuery(".sp-column-actions-template").clone();if(!P.length){return false}var M;if(O.length==0){M=["lossy","lossless"]}else{M=["lossy","glossy","lossless"].filter(function(U){return !(U==O)})}P.html(P.html().replace(/__SP_ID__/g,T));if(S.substr(S.lastIndexOf(".")+1).toLowerCase()=="pdf"){jQuery(".sp-action-compare",P).remove()}if(R==0&&Q>0){P.html(P.html().replace("__SP_THUMBS_TOTAL__",Q))}else{jQuery(".sp-action-optimize-thumbs",P).remove();jQuery(".sp-dropbtn",P).removeClass("button-primary")}P.html(P.html().replace(/__SP_FIRST_TYPE__/g,M[0]));P.html(P.html().replace(/__SP_SECOND_TYPE__/g,M[1]));return P.html()}return""}function h(Q,P){Q=Q.substring(2);if(jQuery(".shortpixel-other-media").length){var O=["optimize","retry","restore","redo","quota","view"];for(var N=0,M=O.length;N<M;N++){jQuery("#"+O[N]+"_"+Q).css("display","none")}for(var N=0,M=P.length;N<M;N++){jQuery("#"+P[N]+"_"+Q).css("display","")}}}function i(M){ShortPixel.retries++;if(isNaN(ShortPixel.retries)){ShortPixel.retries=1}if(ShortPixel.retries<6){console.log("Invalid response from server (Error: "+M+"). Retrying pass "+(ShortPixel.retries+1)+"...");setTimeout(checkBulkProgress,5000)}else{ShortPixel.bulkShowError(-1,"Invalid response from server received 6 times. Please retry later by reloading this page, or <a href='https://shortpixel.com/contact' target='_blank'>contact support</a>. (Error: "+M+")","");console.log("Invalid response from server 6 times. Giving up.")}}function k(M){M.action="shortpixel_browse_content";var N="";jQuery.ajax({type:"POST",url:ShortPixel.AJAX_URL,data:M,success:function(O){N=O},async:false});return N}function d(){var M={action:"shortpixel_get_backup_size"};var N="";jQuery.ajax({type:"POST",url:ShortPixel.AJAX_URL,data:M,success:function(O){N=O},async:false});return N}function f(N){jQuery("#request_key").addClass("disabled");jQuery("#pluginemail_spinner").addClass("is-active");ShortPixel.updateSignupEmail();if(ShortPixel.isEmailValid(jQuery("#pluginemail").val())){jQuery("#pluginemail-error").css("display","none");var M={action:"shortpixel_new_api_key",email:jQuery("#pluginemail").val()};jQuery.ajax({type:"POST",async:false,url:ShortPixel.AJAX_URL,data:M,success:function(O){data=JSON.parse(O);if(data.Status=="success"){N.preventDefault();window.location.reload()}else{if(data.Status=="invalid"){jQuery("#pluginemail-error").html("<b>"+data.Details+"</b>");jQuery("#pluginemail-error").css("display","");jQuery("#pluginemail-info").css("display","none");N.preventDefault()}else{}}}});jQuery("#request_key").removeAttr("onclick")}else{jQuery("#pluginemail-error").css("display","");jQuery("#pluginemail-info").css("display","none");N.preventDefault()}jQuery("#request_key").removeClass("disabled");jQuery("#pluginemail_spinner").removeClass("is-active")}function J(){jQuery("#shortPixelProposeUpgrade .sp-modal-body").addClass("sptw-modal-spinner");jQuery("#shortPixelProposeUpgrade .sp-modal-body").html("");jQuery("#shortPixelProposeUpgradeShade").css("display","block");jQuery("#shortPixelProposeUpgrade").removeClass("shortpixel-hide");var M={action:"shortpixel_propose_upgrade"};jQuery.ajax({type:"POST",url:ShortPixel.AJAX_URL,data:M,success:function(N){jQuery("#shortPixelProposeUpgrade .sp-modal-body").removeClass("sptw-modal-spinner");jQuery("#shortPixelProposeUpgrade .sp-modal-body").html(N)}})}function D(){jQuery("#shortPixelProposeUpgradeShade").css("display","none");jQuery("#shortPixelProposeUpgrade").addClass("shortpixel-hide");if(ShortPixel.toRefresh){ShortPixel.recheckQuota()}}function u(){jQuery("#short-pixel-notice-unlisted").hide();jQuery("#optimizeUnlisted").prop("checked",true);var M={action:"shortpixel_dismiss_notice",notice_id:"unlisted",notice_data:"true"};jQuery.get(ShortPixel.AJAX_URL,M,function(N){M=JSON.parse(N);if(M.Status==ShortPixel.STATUS_SUCCESS){console.log("dismissed")}})}function n(){jQuery(".select-folder-button").click(function(){jQuery(".sp-folder-picker-shade").css("display","block");jQuery(".sp-folder-picker").fileTree({script:ShortPixel.browseContent,multiFolder:false})});jQuery(".shortpixel-modal input.select-folder-cancel").click(function(){jQuery(".sp-folder-picker-shade").css("display","none")});jQuery(".shortpixel-modal input.select-folder").click(function(){var M=jQuery("UL.jqueryFileTree LI.directory.selected A").attr("rel").trim();if(M){var N=jQuery("#customFolderBase").val()+M;if(N.slice(-1)=="/"){N=N.slice(0,-1)}jQuery("#addCustomFolder").val(N);jQuery("#addCustomFolderView").val(N);jQuery(".sp-folder-picker-shade").css("display","none")}else{alert("Please select a folder from the list.")}})}function C(Q,P,O){var N=jQuery(".bulk-notice-msg.bulk-lengthy");if(N.length==0){return}var M=jQuery("a",N);M.text(P);if(O){M.attr("href",O)}else{M.attr("href",M.data("href").replace("__ID__",Q))}N.css("display","block")}function y(){jQuery(".bulk-notice-msg.bulk-lengthy").css("display","none")}function v(M){var N=jQuery(".bulk-notice-msg.bulk-"+M);if(N.length==0){return}N.css("display","block")}function K(M){jQuery(".bulk-notice-msg.bulk-"+M).css("display","none")}function r(S,Q,R,P){var M=jQuery("#bulk-error-template");if(M.length==0){return}var O=M.clone();O.attr("id","bulk-error-"+S);if(S==-1){jQuery("span.sp-err-title",O).remove();O.addClass("bulk-error-fatal")}else{jQuery("img",O).remove();jQuery("#bulk-error-".id).remove()}jQuery("span.sp-err-content",O).html(Q);var N=jQuery("a.sp-post-link",O);if(P){N.attr("href",P)}else{N.attr("href",N.attr("href").replace("__ID__",S))}N.text(R);M.after(O);O.css("display","block")}function A(M,N){if(!confirm(_spTr["confirmBulk"+M])){N.stopPropagation();N.preventDefault();return false}return true}function q(M){jQuery(M).parent().parent().remove()}function E(M){return M.substring(0,2)=="C-"}function F(){window.location.href=window.location.href+(window.location.href.indexOf("?")>0?"&":"?")+"checkquota=1"}function g(N){N.preventDefault();if(!this.menuCloseEvent){jQuery(window).click(function(O){if(!O.target.matches(".sp-dropbtn")){jQuery(".sp-dropdown.sp-show").removeClass("sp-show")}});this.menuCloseEvent=true}var M=N.target.parentElement.classList.contains("sp-show");jQuery(".sp-dropdown.sp-show").removeClass("sp-show");if(!M){N.target.parentElement.classList.add("sp-show")}}function L(M){this.comparerData.origUrl=false;if(this.comparerData.cssLoaded===false){jQuery("<link>").appendTo("head").attr({type:"text/css",rel:"stylesheet",href:this.WP_PLUGIN_URL+"/res/css/twentytwenty.min.css"});this.comparerData.cssLoaded=2}if(this.comparerData.jsLoaded===false){jQuery.getScript(this.WP_PLUGIN_URL+"/res/js/jquery.twentytwenty.min.js",function(){ShortPixel.comparerData.jsLoaded=2;if(ShortPixel.comparerData.origUrl.length>0){ShortPixel.displayComparerPopup(ShortPixel.comparerData.width,ShortPixel.comparerData.height,ShortPixel.comparerData.origUrl,ShortPixel.comparerData.optUrl)}});this.comparerData.jsLoaded=1;jQuery(".sp-close-button").click(ShortPixel.closeComparerPopup)}if(this.comparerData.origUrl===false){jQuery.ajax({type:"POST",url:ShortPixel.AJAX_URL,data:{action:"shortpixel_get_comparer_data",id:M},success:function(N){data=JSON.parse(N);jQuery.extend(ShortPixel.comparerData,data);if(ShortPixel.comparerData.jsLoaded==2){ShortPixel.displayComparerPopup(ShortPixel.comparerData.width,ShortPixel.comparerData.height,ShortPixel.comparerData.origUrl,ShortPixel.comparerData.optUrl)}}});this.comparerData.origUrl=""}}function B(Q,O,N,P){var T=Q;var S=(O<150||Q<350);var R=jQuery(S?"#spUploadCompareSideBySide":"#spUploadCompare");if(!S){jQuery("#spCompareSlider").html('<img class="spUploadCompareOriginal"/><img class="spUploadCompareOptimized"/>')}Q=Math.max(350,Math.min(800,(Q<350?(Q+25)*2:(O<150?Q+25:Q))));O=Math.max(150,(S?(T>350?2*(O+45):O+45):O*Q/T));jQuery(".sp-modal-body",R).css("width",Q);jQuery(".shortpixel-slider",R).css("width",Q);R.css("width",Q);jQuery(".sp-modal-body",R).css("height",O);R.css("display","block");R.parent().css("display","block");if(!S){jQuery("#spCompareSlider").twentytwenty({slider_move:"mousemove"})}jQuery(document).on("keyup.sp_modal_active",ShortPixel.closeComparerPopup);var M=jQuery(".spUploadCompareOptimized",R);jQuery(".spUploadCompareOriginal",R).attr("src",N);setTimeout(function(){jQuery(window).trigger("resize")},1000);M.load(function(){jQuery(window).trigger("resize")});M.attr("src",P)}function p(M){jQuery("#spUploadCompareSideBySide").parent().css("display","none");jQuery("#spUploadCompareSideBySide").css("display","none");jQuery("#spUploadCompare").css("display","none");jQuery(document).unbind("keyup.sp_modal_active")}return{setOptions:l,isEmailValid:s,updateSignupEmail:m,validateKey:a,enableResize:H,setupGeneralTab:e,setupAdvancedTab:t,checkThumbsUpdTotal:G,switchSettingsTab:w,adjustSettingsTabs:x,onBulkThumbsCheck:z,dismissMediaAlert:I,checkQuota:j,percentDial:o,successMsg:b,successActions:c,otherMediaUpdateActions:h,retry:i,initFolderSelector:n,browseContent:k,getBackupSize:d,newApiKey:f,proposeUpgrade:J,closeProposeUpgrade:D,includeUnlisted:u,bulkShowLengthyMsg:C,bulkHideLengthyMsg:y,bulkShowMaintenanceMsg:v,bulkHideMaintenanceMsg:K,bulkShowError:r,confirmBulkAction:A,removeBulkMsg:q,isCustomImageId:E,recheckQuota:F,openImageMenu:g,menuCloseEvent:false,loadComparer:L,displayComparerPopup:B,closeComparerPopup:p,comparerData:{cssLoaded:false,jsLoaded:false,origUrl:false,optUrl:false,width:0,height:0},toRefresh:false,resizeSizesAlert:false}}();function showToolBarAlert(c,b){var a=jQuery("li.shortpixel-toolbar-processing");switch(c){case ShortPixel.STATUS_QUOTA_EXCEEDED:if(window.location.href.search("wp-short-pixel-bulk")>0&&jQuery(".sp-quota-exceeded-alert").length==0){location.reload();return}a.addClass("shortpixel-alert");a.addClass("shortpixel-quota-exceeded");jQuery("a",a).attr("href","options-general.php?page=wp-shortpixel");jQuery("a div",a).attr("title","ShortPixel quota exceeded. Click for details.");break;case ShortPixel.STATUS_SKIP:a.addClass("shortpixel-alert shortpixel-processing");jQuery("a div",a).attr("title",b);break;case ShortPixel.STATUS_FAIL:a.addClass("shortpixel-alert shortpixel-processing");jQuery("a div",a).attr("title",b);break;case ShortPixel.STATUS_NO_KEY:a.addClass("shortpixel-alert");a.addClass("shortpixel-quota-exceeded");jQuery("a",a).attr("href","options-general.php?page=wp-shortpixel");jQuery("a div",a).attr("title","Get API Key");break;case ShortPixel.STATUS_SUCCESS:case ShortPixel.STATUS_RETRY:a.addClass("shortpixel-processing");a.removeClass("shortpixel-alert");jQuery("a",a).removeAttr("target");jQuery("a",a).attr("href",jQuery("a img",a).attr("success-url"))}a.removeClass("shortpixel-hide")}function hideToolBarAlert(){jQuery("li.shortpixel-toolbar-processing.shortpixel-processing").addClass("shortpixel-hide")}function hideQuotaExceededToolBarAlert(){jQuery("li.shortpixel-toolbar-processing.shortpixel-quota-exceeded").addClass("shortpixel-hide")}function checkQuotaExceededAlert(){if(typeof shortPixelQuotaExceeded!="undefined"){if(shortPixelQuotaExceeded==1){showToolBarAlert(ShortPixel.STATUS_QUOTA_EXCEEDED)}else{hideQuotaExceededToolBarAlert()}}}function checkBulkProgress(){var b=function(f){if(!d){d=true;return f}return"/"};var d=false;var a=window.location.href.toLowerCase().replace(/\/\//g,b);d=false;var c=ShortPixel.WP_ADMIN_URL.toLowerCase().replace(/\/\//g,b);if(a.search(c)<0){var e=document.createElement("a");e.href=a;a=a.replace(e.protocol+"//"+e.hostname,e.protocol+"//"+e.hostname.split(".").map(function(f){return sp_punycode.toASCII(f)}).join("."))}if(a.search(c+"upload.php")<0&&a.search(c+"edit.php")<0&&a.search(c+"edit-tags.php")<0&&a.search(c+"post-new.php")<0&&a.search(c+"post.php")<0&&a.search("page=nggallery-manage-gallery")<0&&(ShortPixel.FRONT_BOOTSTRAP==0||a.search(c)==0)){hideToolBarAlert();return}if(ShortPixel.bulkProcessor==true&&window.location.href.search("wp-short-pixel-bulk")<0&&typeof localStorage.bulkPage!=="undefined"&&localStorage.bulkPage>0){ShortPixel.bulkProcessor=false}if(window.location.href.search("wp-short-pixel-bulk")>=0){ShortPixel.bulkProcessor=true;localStorage.bulkTime=Math.floor(Date.now()/1000);localStorage.bulkPage=1}if(ShortPixel.bulkProcessor==true||typeof localStorage.bulkTime=="undefined"||Math.floor(Date.now()/1000)-localStorage.bulkTime>90){ShortPixel.bulkProcessor=true;localStorage.bulkPage=(window.location.href.search("wp-short-pixel-bulk")>=0?1:0);localStorage.bulkTime=Math.floor(Date.now()/1000);console.log(localStorage.bulkTime);checkBulkProcessingCallApi()}else{setTimeout(checkBulkProgress,5000)}}function checkBulkProcessingCallApi(){var a={action:"shortpixel_image_processing"};jQuery.ajax({type:"POST",url:ShortPixel.AJAX_URL,data:a,success:function(g){if(g.length>0){var i=null;try{var i=JSON.parse(g)}catch(k){ShortPixel.retry(k.message);return}ShortPixel.retries=0;var d=i.ImageID;var j=(jQuery("div.short-pixel-bulk-page").length>0);switch(i.Status){case ShortPixel.STATUS_NO_KEY:setCellMessage(d,i.Message,'<a class=\'button button-smaller button-primary\' href="https://shortpixel.com/wp-apikey" target="_blank">'+_spTr.getApiKey+"</a>");showToolBarAlert(ShortPixel.STATUS_NO_KEY);break;case ShortPixel.STATUS_QUOTA_EXCEEDED:setCellMessage(d,i.Message,"<a class='button button-smaller button-primary' href=\"https://shortpixel.com/login/"+ShortPixel.API_KEY+'" target="_blank">'+_spTr.extendQuota+"</a><a class='button button-smaller' href='admin.php?action=shortpixel_check_quota'>"+_spTr.check__Quota+"</a>");showToolBarAlert(ShortPixel.STATUS_QUOTA_EXCEEDED);if(i.Stop==false){setTimeout(checkBulkProgress,5000)}ShortPixel.otherMediaUpdateActions(d,["quota","view"]);break;case ShortPixel.STATUS_FAIL:setCellMessage(d,i.Message,"<a class='button button-smaller button-primary' href=\"javascript:manualOptimization('"+d+"', false)\">"+_spTr.retry+"</a>");if(j){ShortPixel.bulkShowError(d,i.Message,i.Filename,i.CustomImageLink);showToolBarAlert(ShortPixel.STATUS_FAIL,i.Message);if(i.BulkPercent){progressUpdate(i.BulkPercent,i.BulkMsg)}ShortPixel.otherMediaUpdateActions(d,["retry","view"])}console.log(i.Message);setTimeout(checkBulkProgress,5000);break;case ShortPixel.STATUS_EMPTY_QUEUE:console.log(i.Message);clearBulkProcessor();hideToolBarAlert();var c=jQuery("#bulk-progress");if(j&&c.length&&i.BulkStatus!="2"){progressUpdate(100,"Bulk finished!");jQuery("a.bulk-cancel").attr("disabled","disabled");hideSlider();setTimeout(function(){window.location.reload()},3000)}break;case ShortPixel.STATUS_SUCCESS:if(j){ShortPixel.bulkHideLengthyMsg();ShortPixel.bulkHideMaintenanceMsg()}var l=i.PercentImprovement;showToolBarAlert(ShortPixel.STATUS_SUCCESS,"");var b=ShortPixel.isCustomImageId(d)?"":ShortPixel.successActions(d,i.Type,i.ThumbsCount,i.ThumbsTotal,i.BackupEnabled,i.Filename);setCellMessage(d,ShortPixel.successMsg(d,l,i.Type,i.ThumbsCount,i.RetinasCount),b);var h=jQuery(["restore","view","redolossy","redoglossy","redolossless"]).not(["redo"+i.Type]).get();ShortPixel.otherMediaUpdateActions(d,h);var f=new PercentageAnimator("#sp-msg-"+d+" span.percent",l);f.animate(l);if(j&&typeof i.Thumb!=="undefined"){if(i.BulkPercent){progressUpdate(i.BulkPercent,i.BulkMsg)}if(i.Thumb.length>0){sliderUpdate(d,i.Thumb,i.BkThumb,i.PercentImprovement,i.Filename);if(typeof i.AverageCompression!=="undefined"&&0+i.AverageCompression>0){jQuery("#sp-avg-optimization").html('<input type="text" class="dial" value="'+Math.round(i.AverageCompression)+'"/>');ShortPixel.percentDial("#sp-avg-optimization .dial",60)}}}console.log("Server response: "+g);if(j&&typeof i.BulkPercent!=="undefined"){progressUpdate(i.BulkPercent,i.BulkMsg)}setTimeout(checkBulkProgress,5000);break;case ShortPixel.STATUS_SKIP:if(i.Silent!==1){ShortPixel.bulkShowError(d,i.Message,i.Filename,i.CustomImageLink)}case ShortPixel.STATUS_ERROR:if(typeof i.Message!=="undefined"){showToolBarAlert(ShortPixel.STATUS_SKIP,i.Message+" Image ID: "+d);setCellMessage(d,i.Message,"")}ShortPixel.otherMediaUpdateActions(d,["retry","view"]);case ShortPixel.STATUS_RETRY:console.log("Server response: "+g);showToolBarAlert(ShortPixel.STATUS_RETRY,"");if(j&&typeof i.BulkPercent!=="undefined"){progressUpdate(i.BulkPercent,i.BulkMsg)}if(j&&i.Count>3){ShortPixel.bulkShowLengthyMsg(d,i.Filename,i.CustomImageLink)}setTimeout(checkBulkProgress,5000);break;case ShortPixel.STATUS_MAINTENANCE:ShortPixel.bulkShowMaintenanceMsg("maintenance");setTimeout(checkBulkProgress,60000);break;case ShortPixel.STATUS_QUEUE_FULL:ShortPixel.bulkShowMaintenanceMsg("queue-full");setTimeout(checkBulkProgress,60000);break;default:ShortPixel.retry("Unknown status "+i.Status+". Retrying...");break}}},error:function(b){ShortPixel.retry(b.statusText)}})}function clearBulkProcessor(){ShortPixel.bulkProcessor=false;localStorage.bulkTime=0;if(window.location.href.search("wp-short-pixel-bulk")>=0){localStorage.bulkPage=0}}function setCellMessage(d,a,c){var b=jQuery("#sp-msg-"+d);if(b.length>0){b.html("<div class='sp-column-actions'>"+c+"</div><div class='sp-column-info'>"+a+"</div>");b.css("color","")}b=jQuery("#sp-cust-msg-"+d);if(b.length>0){b.html("<div class='sp-column-info'>"+a+"</div>")}}function manualOptimization(c,a){setCellMessage(c,"<img src='"+ShortPixel.WP_PLUGIN_URL+"/res/img/loading.gif' class='sp-loading-small'>Image waiting to be processed","");jQuery("li.shortpixel-toolbar-processing").removeClass("shortpixel-hide");jQuery("li.shortpixel-toolbar-processing").addClass("shortpixel-processing");var b={action:"shortpixel_manual_optimization",image_id:c,cleanup:a};jQuery.get(ShortPixel.AJAX_URL,b,function(d){b=JSON.parse(d);if(b.Status==ShortPixel.STATUS_SUCCESS){setTimeout(checkBulkProgress,2000)}else{setCellMessage(c,typeof b.Message!=="undefined"?b.Message:_spTr.thisContentNotProcessable,"")}})}function reoptimize(c,a){setCellMessage(c,"<img src='"+ShortPixel.WP_PLUGIN_URL+"/res/img/loading.gif' class='sp-loading-small'>Image waiting to be reprocessed","");jQuery("li.shortpixel-toolbar-processing").removeClass("shortpixel-hide");jQuery("li.shortpixel-toolbar-processing").addClass("shortpixel-processing");var b={action:"shortpixel_redo",attachment_ID:c,type:a};jQuery.get(ShortPixel.AJAX_URL,b,function(d){b=JSON.parse(d);if(b.Status==ShortPixel.STATUS_SUCCESS){setTimeout(checkBulkProgress,2000)}else{$msg=typeof b.Message!=="undefined"?b.Message:_spTr.thisContentNotProcessable;setCellMessage(c,$msg,"");showToolBarAlert(ShortPixel.STATUS_FAIL,$msg)}})}function optimizeThumbs(b){setCellMessage(b,"<img src='"+ShortPixel.WP_PLUGIN_URL+"/res/img/loading.gif' class='sp-loading-small'>"+_spTr.imageWaitOptThumbs,"");jQuery("li.shortpixel-toolbar-processing").removeClass("shortpixel-hide");jQuery("li.shortpixel-toolbar-processing").addClass("shortpixel-processing");var a={action:"shortpixel_optimize_thumbs",attachment_ID:b};jQuery.get(ShortPixel.AJAX_URL,a,function(c){a=JSON.parse(c);if(a.Status==ShortPixel.STATUS_SUCCESS){setTimeout(checkBulkProgress,2000)}else{setCellMessage(b,typeof a.Message!=="undefined"?a.Message:_spTr.thisContentNotProcessable,"")}})}function dismissShortPixelNoticeExceed(b){jQuery("#wp-admin-bar-shortpixel_processing").hide();var a={action:"shortpixel_dismiss_notice",notice_id:"exceed"};jQuery.get(ShortPixel.AJAX_URL,a,function(c){a=JSON.parse(c);if(a.Status==ShortPixel.STATUS_SUCCESS){console.log("dismissed")}});b.preventDefault()}function dismissShortPixelNotice(b){jQuery("#short-pixel-notice-"+b).hide();var a={action:"shortpixel_dismiss_notice",notice_id:b};jQuery.get(ShortPixel.AJAX_URL,a,function(c){a=JSON.parse(c);if(a.Status==ShortPixel.STATUS_SUCCESS){console.log("dismissed")}})}function PercentageAnimator(b,a){this.animationSpeed=10;this.increment=2;this.curPercentage=0;this.targetPercentage=a;this.outputSelector=b;this.animate=function(c){this.targetPercentage=c;setTimeout(PercentageTimer.bind(null,this),this.animationSpeed)}}function PercentageTimer(a){if(a.curPercentage-a.targetPercentage<-a.increment){a.curPercentage+=a.increment}else{if(a.curPercentage-a.targetPercentage>a.increment){a.curPercentage-=a.increment}else{a.curPercentage=a.targetPercentage}}jQuery(a.outputSelector).text(a.curPercentage+"%");if(a.curPercentage!=a.targetPercentage){setTimeout(PercentageTimer.bind(null,a),a.animationSpeed)}}function progressUpdate(c,b){var a=jQuery("#bulk-progress");if(a.length){jQuery(".progress-left",a).css("width",c+"%");jQuery(".progress-img",a).css("left",c+"%");if(c>24){jQuery(".progress-img span",a).html("");jQuery(".progress-left",a).html(c+"%")}else{jQuery(".progress-img span",a).html(c+"%");jQuery(".progress-left",a).html("")}jQuery(".bulk-estimate").html(b)}}function sliderUpdate(g,c,d,e,b){var f=jQuery(".bulk-slider div.bulk-slide:first-child");if(f.length===0){return}if(f.attr("id")!="empty-slide"){f.hide()}f.css("z-index",1000);jQuery(".bulk-img-opt",f).attr("src","");if(typeof d==="undefined"){d=""}if(d.length>0){jQuery(".bulk-img-orig",f).attr("src","")}var a=f.clone();a.attr("id","slide-"+g);jQuery(".bulk-img-opt",a).attr("src",c);if(d.length>0){jQuery(".img-original",a).css("display","inline-block");jQuery(".bulk-img-orig",a).attr("src",d)}else{jQuery(".img-original",a).css("display","none")}jQuery(".bulk-opt-percent",a).html('<input type="text" class="dial" value="'+e+'"/>');jQuery(".bulk-slider").append(a);ShortPixel.percentDial("#"+a.attr("id")+" .dial",100);jQuery(".bulk-slider-container span.filename").html("&nbsp;&nbsp;"+b);if(f.attr("id")=="empty-slide"){f.remove();jQuery(".bulk-slider-container").css("display","block")}else{f.animate({left:f.width()+f.position().left},"slow","swing",function(){f.remove();a.fadeIn("slow")})}}function hideSlider(){jQuery(".bulk-slider-container").css("display","none")}function showStats(){var a=jQuery(".bulk-stats");if(a.length>0){}}if(!(typeof String.prototype.format=="function")){String.prototype.format=function(){var b=this,a=arguments.length;while(a--){b=b.replace(new RegExp("\\{"+a+"\\}","gm"),arguments[a])}return b}};
1
+ jQuery(document).ready(function(a){if(jQuery("table.wp-list-table.media").length>0){jQuery('select[name^="action"] option:last-child').before('<option value="short-pixel-bulk">'+_spTr.optimizeWithSP+"</option>")}ShortPixel.setOptions(ShortPixelConstants);if(jQuery("#backup-folder-size").length){jQuery("#backup-folder-size").html(ShortPixel.getBackupSize())}if(ShortPixel.MEDIA_ALERT=="todo"&&jQuery("div.media-frame.mode-grid").length>0){jQuery("div.media-frame.mode-grid").before('<div id="short-pixel-media-alert" class="notice notice-warning"><p>'+_spTr.changeMLToListMode.format('<a href="upload.php?mode=list" class="view-list"><span class="screen-reader-text">'," </span>",'</a><a class="alignright" href="javascript:ShortPixel.dismissMediaAlert();">',"</a>")+"</p></div>")}jQuery(window).on("beforeunload",function(){if(ShortPixel.bulkProcessor==true){clearBulkProcessor()}});checkQuotaExceededAlert();checkBulkProgress()});var ShortPixel=function(){function l(M){for(var N in M){ShortPixel[N]=M[N]}}function s(M){return/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{1,63})+$/.test(M)}function m(){var M=jQuery("#pluginemail").val();if(ShortPixel.isEmailValid(M)){jQuery("#request_key").removeClass("disabled")}jQuery("#request_key").attr("href",jQuery("#request_key").attr("href").split("?")[0]+"?pluginemail="+M)}function a(){jQuery("#valid").val("validate");jQuery("#wp_shortpixel_options").submit()}jQuery("#key").keypress(function(M){if(M.which==13){jQuery("#valid").val("validate")}});function H(M){if(jQuery(M).is(":checked")){jQuery("#width,#height").removeAttr("disabled")}else{jQuery("#width,#height").attr("disabled","disabled")}}function e(M,O,Q){for(var N=0,P=null;N<M.length;N++){M[N].onclick=function(){if(this!==P){P=this}alert(_spTr.alertOnlyAppliesToNewImages)}}ShortPixel.enableResize("#resize");jQuery("#resize").change(function(){H(this)});jQuery(".resize-sizes").blur(function(S){var T=jQuery(this);if(ShortPixel.resizeSizesAlert==T.val()){return}ShortPixel.resizeSizesAlert=T.val();var R=jQuery("#min-"+T.attr("name")).val();if(T.val()<Math.min(R,1024)){if(R>1024){alert(_spTr.pleaseDoNotSetLesser1024.format(T.attr("name")))}else{alert(_spTr.pleaseDoNotSetLesserSize.format(T.attr("name"),T.attr("name"),R))}S.preventDefault();T.focus()}else{this.defaultValue=T.val()}})}function t(){jQuery("input.remove-folder-button").click(function(){var N=jQuery(this).data("value");var M=confirm(_spTr.areYouSureStopOptimizing.format(N));if(M==true){jQuery("#removeFolder").val(N);jQuery("#wp_shortpixel_options").submit()}});jQuery("input.recheck-folder-button").click(function(){var N=jQuery(this).data("value");var M=confirm(_spTr.areYouSureStopOptimizing.format(N));if(M==true){jQuery("#recheckFolder").val(N);jQuery("#wp_shortpixel_options").submit()}})}function G(M){var N=jQuery("#"+(M.checked?"total":"main")+"ToProcess").val();jQuery("div.bulk-play span.total").text(N);jQuery("#displayTotal").text(N)}function w(N){var M=jQuery("section#"+N);if(M.length>0){jQuery("section").removeClass("sel-tab");jQuery("section#"+N).addClass("sel-tab")}}function x(){var M=jQuery("section#tab-settings .wp-shortpixel-options").height()+90;M=Math.max(M,jQuery("section#tab-adv-settings .wp-shortpixel-options").height()+20);M=Math.max(M,jQuery("section#tab-resources .area1").height()+60);jQuery("#shortpixel-settings-tabs").css("height",M);jQuery("#shortpixel-settings-tabs section").css("height",M)}function I(){var M={action:"shortpixel_dismiss_media_alert"};jQuery.get(ShortPixel.AJAX_URL,M,function(N){M=JSON.parse(N);if(M.Status=="success"){jQuery("#short-pixel-media-alert").hide();console.log("dismissed")}})}function j(){var M={action:"shortpixel_check_quota"};jQuery.get(ShortPixel.AJAX_URL,M,function(){console.log("quota refreshed")})}function z(M){if(M.checked){jQuery("#with-thumbs").css("display","inherit");jQuery("#without-thumbs").css("display","none")}else{jQuery("#without-thumbs").css("display","inherit");jQuery("#with-thumbs").css("display","none")}}function b(Q,O,N,P,M){return(O>0?"<div class='sp-column-info'>"+_spTr.reducedBy+" <strong><span class='percent'>"+O+"%</span></strong> ":"")+(O>0&&O<5?"<br>":"")+(O<5?_spTr.bonusProcessing:"")+(N.length>0?" ("+N+")":"")+(0+P>0?"<br>"+_spTr.plusXthumbsOpt.format(P):"")+(0+M>0?"<br>"+_spTr.plusXretinasOpt.format(M):"")+"</div>"}function o(N,M){jQuery(N).knob({readOnly:true,width:M,height:M,fgColor:"#1CAECB",format:function(O){return O+"%"}})}function c(T,O,R,Q,N,S){if(N==1){var P=jQuery(".sp-column-actions-template").clone();if(!P.length){return false}var M;if(O.length==0){M=["lossy","lossless"]}else{M=["lossy","glossy","lossless"].filter(function(U){return !(U==O)})}P.html(P.html().replace(/__SP_ID__/g,T));if(S.substr(S.lastIndexOf(".")+1).toLowerCase()=="pdf"){jQuery(".sp-action-compare",P).remove()}if(R==0&&Q>0){P.html(P.html().replace("__SP_THUMBS_TOTAL__",Q))}else{jQuery(".sp-action-optimize-thumbs",P).remove();jQuery(".sp-dropbtn",P).removeClass("button-primary")}P.html(P.html().replace(/__SP_FIRST_TYPE__/g,M[0]));P.html(P.html().replace(/__SP_SECOND_TYPE__/g,M[1]));return P.html()}return""}function h(Q,P){Q=Q.substring(2);if(jQuery(".shortpixel-other-media").length){var O=["optimize","retry","restore","redo","quota","view"];for(var N=0,M=O.length;N<M;N++){jQuery("#"+O[N]+"_"+Q).css("display","none")}for(var N=0,M=P.length;N<M;N++){jQuery("#"+P[N]+"_"+Q).css("display","")}}}function i(M){ShortPixel.retries++;if(isNaN(ShortPixel.retries)){ShortPixel.retries=1}if(ShortPixel.retries<6){console.log("Invalid response from server (Error: "+M+"). Retrying pass "+(ShortPixel.retries+1)+"...");setTimeout(checkBulkProgress,5000)}else{ShortPixel.bulkShowError(-1,"Invalid response from server received 6 times. Please retry later by reloading this page, or <a href='https://shortpixel.com/contact' target='_blank'>contact support</a>. (Error: "+M+")","");console.log("Invalid response from server 6 times. Giving up.")}}function k(M){M.action="shortpixel_browse_content";var N="";jQuery.ajax({type:"POST",url:ShortPixel.AJAX_URL,data:M,success:function(O){N=O},async:false});return N}function d(){var M={action:"shortpixel_get_backup_size"};var N="";jQuery.ajax({type:"POST",url:ShortPixel.AJAX_URL,data:M,success:function(O){N=O},async:false});return N}function f(N){jQuery("#request_key").addClass("disabled");jQuery("#pluginemail_spinner").addClass("is-active");ShortPixel.updateSignupEmail();if(ShortPixel.isEmailValid(jQuery("#pluginemail").val())){jQuery("#pluginemail-error").css("display","none");var M={action:"shortpixel_new_api_key",email:jQuery("#pluginemail").val()};jQuery.ajax({type:"POST",async:false,url:ShortPixel.AJAX_URL,data:M,success:function(O){data=JSON.parse(O);if(data.Status=="success"){N.preventDefault();window.location.reload()}else{if(data.Status=="invalid"){jQuery("#pluginemail-error").html("<b>"+data.Details+"</b>");jQuery("#pluginemail-error").css("display","");jQuery("#pluginemail-info").css("display","none");N.preventDefault()}else{}}}});jQuery("#request_key").removeAttr("onclick")}else{jQuery("#pluginemail-error").css("display","");jQuery("#pluginemail-info").css("display","none");N.preventDefault()}jQuery("#request_key").removeClass("disabled");jQuery("#pluginemail_spinner").removeClass("is-active")}function J(){jQuery("#shortPixelProposeUpgrade .sp-modal-body").addClass("sptw-modal-spinner");jQuery("#shortPixelProposeUpgrade .sp-modal-body").html("");jQuery("#shortPixelProposeUpgradeShade").css("display","block");jQuery("#shortPixelProposeUpgrade").removeClass("shortpixel-hide");var M={action:"shortpixel_propose_upgrade"};jQuery.ajax({type:"POST",url:ShortPixel.AJAX_URL,data:M,success:function(N){jQuery("#shortPixelProposeUpgrade .sp-modal-body").removeClass("sptw-modal-spinner");jQuery("#shortPixelProposeUpgrade .sp-modal-body").html(N)}})}function D(){jQuery("#shortPixelProposeUpgradeShade").css("display","none");jQuery("#shortPixelProposeUpgrade").addClass("shortpixel-hide");if(ShortPixel.toRefresh){ShortPixel.recheckQuota()}}function u(){jQuery("#short-pixel-notice-unlisted").hide();jQuery("#optimizeUnlisted").prop("checked",true);var M={action:"shortpixel_dismiss_notice",notice_id:"unlisted",notice_data:"true"};jQuery.get(ShortPixel.AJAX_URL,M,function(N){M=JSON.parse(N);if(M.Status==ShortPixel.STATUS_SUCCESS){console.log("dismissed")}})}function n(){jQuery(".select-folder-button").click(function(){jQuery(".sp-folder-picker-shade").css("display","block");jQuery(".sp-folder-picker").fileTree({script:ShortPixel.browseContent,multiFolder:false})});jQuery(".shortpixel-modal input.select-folder-cancel").click(function(){jQuery(".sp-folder-picker-shade").css("display","none")});jQuery(".shortpixel-modal input.select-folder").click(function(){var M=jQuery("UL.jqueryFileTree LI.directory.selected A").attr("rel").trim();if(M){var N=jQuery("#customFolderBase").val()+M;if(N.slice(-1)=="/"){N=N.slice(0,-1)}jQuery("#addCustomFolder").val(N);jQuery("#addCustomFolderView").val(N);jQuery(".sp-folder-picker-shade").css("display","none")}else{alert("Please select a folder from the list.")}})}function C(Q,P,O){var N=jQuery(".bulk-notice-msg.bulk-lengthy");if(N.length==0){return}var M=jQuery("a",N);M.text(P);if(O){M.attr("href",O)}else{M.attr("href",M.data("href").replace("__ID__",Q))}N.css("display","block")}function y(){jQuery(".bulk-notice-msg.bulk-lengthy").css("display","none")}function v(M){var N=jQuery(".bulk-notice-msg.bulk-"+M);if(N.length==0){return}N.css("display","block")}function K(M){jQuery(".bulk-notice-msg.bulk-"+M).css("display","none")}function r(S,Q,R,P){var M=jQuery("#bulk-error-template");if(M.length==0){return}var O=M.clone();O.attr("id","bulk-error-"+S);if(S==-1){jQuery("span.sp-err-title",O).remove();O.addClass("bulk-error-fatal")}else{jQuery("img",O).remove();jQuery("#bulk-error-".id).remove()}jQuery("span.sp-err-content",O).html(Q);var N=jQuery("a.sp-post-link",O);if(P){N.attr("href",P)}else{N.attr("href",N.attr("href").replace("__ID__",S))}N.text(R);M.after(O);O.css("display","block")}function A(M,N){if(!confirm(_spTr["confirmBulk"+M])){N.stopPropagation();N.preventDefault();return false}return true}function q(M){jQuery(M).parent().parent().remove()}function E(M){return M.substring(0,2)=="C-"}function F(){window.location.href=window.location.href+(window.location.href.indexOf("?")>0?"&":"?")+"checkquota=1"}function g(N){N.preventDefault();if(!this.menuCloseEvent){jQuery(window).click(function(O){if(!O.target.matches(".sp-dropbtn")){jQuery(".sp-dropdown.sp-show").removeClass("sp-show")}});this.menuCloseEvent=true}var M=N.target.parentElement.classList.contains("sp-show");jQuery(".sp-dropdown.sp-show").removeClass("sp-show");if(!M){N.target.parentElement.classList.add("sp-show")}}function L(M){this.comparerData.origUrl=false;if(this.comparerData.cssLoaded===false){jQuery("<link>").appendTo("head").attr({type:"text/css",rel:"stylesheet",href:this.WP_PLUGIN_URL+"/res/css/twentytwenty.min.css"});this.comparerData.cssLoaded=2}if(this.comparerData.jsLoaded===false){jQuery.getScript(this.WP_PLUGIN_URL+"/res/js/jquery.twentytwenty.min.js",function(){ShortPixel.comparerData.jsLoaded=2;if(ShortPixel.comparerData.origUrl.length>0){ShortPixel.displayComparerPopup(ShortPixel.comparerData.width,ShortPixel.comparerData.height,ShortPixel.comparerData.origUrl,ShortPixel.comparerData.optUrl)}});this.comparerData.jsLoaded=1;jQuery(".sp-close-button").click(ShortPixel.closeComparerPopup)}if(this.comparerData.origUrl===false){jQuery.ajax({type:"POST",url:ShortPixel.AJAX_URL,data:{action:"shortpixel_get_comparer_data",id:M},success:function(N){data=JSON.parse(N);jQuery.extend(ShortPixel.comparerData,data);if(ShortPixel.comparerData.jsLoaded==2){ShortPixel.displayComparerPopup(ShortPixel.comparerData.width,ShortPixel.comparerData.height,ShortPixel.comparerData.origUrl,ShortPixel.comparerData.optUrl)}}});this.comparerData.origUrl=""}}function B(Q,O,N,P){var T=Q;var S=(O<150||Q<350);var R=jQuery(S?"#spUploadCompareSideBySide":"#spUploadCompare");if(!S){jQuery("#spCompareSlider").html('<img class="spUploadCompareOriginal"/><img class="spUploadCompareOptimized"/>')}Q=Math.max(350,Math.min(800,(Q<350?(Q+25)*2:(O<150?Q+25:Q))));O=Math.max(150,(S?(T>350?2*(O+45):O+45):O*Q/T));jQuery(".sp-modal-body",R).css("width",Q);jQuery(".shortpixel-slider",R).css("width",Q);R.css("width",Q);jQuery(".sp-modal-body",R).css("height",O);R.css("display","block");R.parent().css("display","block");if(!S){jQuery("#spCompareSlider").twentytwenty({slider_move:"mousemove"})}jQuery(document).on("keyup.sp_modal_active",ShortPixel.closeComparerPopup);var M=jQuery(".spUploadCompareOptimized",R);jQuery(".spUploadCompareOriginal",R).attr("src",N);setTimeout(function(){jQuery(window).trigger("resize")},1000);M.load(function(){jQuery(window).trigger("resize")});M.attr("src",P)}function p(M){jQuery("#spUploadCompareSideBySide").parent().css("display","none");jQuery("#spUploadCompareSideBySide").css("display","none");jQuery("#spUploadCompare").css("display","none");jQuery(document).unbind("keyup.sp_modal_active")}return{setOptions:l,isEmailValid:s,updateSignupEmail:m,validateKey:a,enableResize:H,setupGeneralTab:e,setupAdvancedTab:t,checkThumbsUpdTotal:G,switchSettingsTab:w,adjustSettingsTabs:x,onBulkThumbsCheck:z,dismissMediaAlert:I,checkQuota:j,percentDial:o,successMsg:b,successActions:c,otherMediaUpdateActions:h,retry:i,initFolderSelector:n,browseContent:k,getBackupSize:d,newApiKey:f,proposeUpgrade:J,closeProposeUpgrade:D,includeUnlisted:u,bulkShowLengthyMsg:C,bulkHideLengthyMsg:y,bulkShowMaintenanceMsg:v,bulkHideMaintenanceMsg:K,bulkShowError:r,confirmBulkAction:A,removeBulkMsg:q,isCustomImageId:E,recheckQuota:F,openImageMenu:g,menuCloseEvent:false,loadComparer:L,displayComparerPopup:B,closeComparerPopup:p,comparerData:{cssLoaded:false,jsLoaded:false,origUrl:false,optUrl:false,width:0,height:0},toRefresh:false,resizeSizesAlert:false}}();function showToolBarAlert(c,b){var a=jQuery("li.shortpixel-toolbar-processing");switch(c){case ShortPixel.STATUS_QUOTA_EXCEEDED:if(window.location.href.search("wp-short-pixel-bulk")>0&&jQuery(".sp-quota-exceeded-alert").length==0){location.reload();return}a.addClass("shortpixel-alert");a.addClass("shortpixel-quota-exceeded");jQuery("a",a).attr("href","options-general.php?page=wp-shortpixel");jQuery("a div",a).attr("title","ShortPixel quota exceeded. Click for details.");break;case ShortPixel.STATUS_SKIP:a.addClass("shortpixel-alert shortpixel-processing");jQuery("a div",a).attr("title",b);break;case ShortPixel.STATUS_FAIL:a.addClass("shortpixel-alert shortpixel-processing");jQuery("a div",a).attr("title",b);break;case ShortPixel.STATUS_NO_KEY:a.addClass("shortpixel-alert");a.addClass("shortpixel-quota-exceeded");jQuery("a",a).attr("href","options-general.php?page=wp-shortpixel");jQuery("a div",a).attr("title","Get API Key");break;case ShortPixel.STATUS_SUCCESS:case ShortPixel.STATUS_RETRY:a.addClass("shortpixel-processing");a.removeClass("shortpixel-alert");jQuery("a",a).removeAttr("target");jQuery("a",a).attr("href",jQuery("a img",a).attr("success-url"))}a.removeClass("shortpixel-hide")}function hideToolBarAlert(){jQuery("li.shortpixel-toolbar-processing.shortpixel-processing").addClass("shortpixel-hide")}function hideQuotaExceededToolBarAlert(){jQuery("li.shortpixel-toolbar-processing.shortpixel-quota-exceeded").addClass("shortpixel-hide")}function checkQuotaExceededAlert(){if(typeof shortPixelQuotaExceeded!="undefined"){if(shortPixelQuotaExceeded==1){showToolBarAlert(ShortPixel.STATUS_QUOTA_EXCEEDED)}else{hideQuotaExceededToolBarAlert()}}}function checkBulkProgress(){var b=function(f){if(!d){d=true;return f}return"/"};var d=false;var a=window.location.href.toLowerCase().replace(/\/\//g,b);d=false;var c=ShortPixel.WP_ADMIN_URL.toLowerCase().replace(/\/\//g,b);if(a.search(c)<0){var e=document.createElement("a");e.href=a;a=a.replace(e.protocol+"//"+e.hostname,e.protocol+"//"+e.hostname.split(".").map(function(f){return sp_punycode.toASCII(f)}).join("."))}if(a.search(c+"upload.php")<0&&a.search(c+"edit.php")<0&&a.search(c+"edit-tags.php")<0&&a.search(c+"post-new.php")<0&&a.search(c+"post.php")<0&&a.search("page=nggallery-manage-gallery")<0&&(ShortPixel.FRONT_BOOTSTRAP==0||a.search(c)==0)){hideToolBarAlert();return}if(ShortPixel.bulkProcessor==true&&window.location.href.search("wp-short-pixel-bulk")<0&&typeof localStorage.bulkPage!=="undefined"&&localStorage.bulkPage>0){ShortPixel.bulkProcessor=false}if(window.location.href.search("wp-short-pixel-bulk")>=0){ShortPixel.bulkProcessor=true;localStorage.bulkTime=Math.floor(Date.now()/1000);localStorage.bulkPage=1}if(ShortPixel.bulkProcessor==true||typeof localStorage.bulkTime=="undefined"||Math.floor(Date.now()/1000)-localStorage.bulkTime>90){ShortPixel.bulkProcessor=true;localStorage.bulkPage=(window.location.href.search("wp-short-pixel-bulk")>=0?1:0);localStorage.bulkTime=Math.floor(Date.now()/1000);console.log(localStorage.bulkTime);checkBulkProcessingCallApi()}else{setTimeout(checkBulkProgress,5000)}}function checkBulkProcessingCallApi(){var a={action:"shortpixel_image_processing"};jQuery.ajax({type:"POST",url:ShortPixel.AJAX_URL,data:a,success:function(g){if(g.length>0){var i=null;try{var i=JSON.parse(g)}catch(k){ShortPixel.retry(k.message);return}ShortPixel.retries=0;var d=i.ImageID;var j=(jQuery("div.short-pixel-bulk-page").length>0);switch(i.Status){case ShortPixel.STATUS_NO_KEY:setCellMessage(d,i.Message,'<a class=\'button button-smaller button-primary\' href="https://shortpixel.com/wp-apikey" target="_blank">'+_spTr.getApiKey+"</a>");showToolBarAlert(ShortPixel.STATUS_NO_KEY);break;case ShortPixel.STATUS_QUOTA_EXCEEDED:setCellMessage(d,i.Message,"<a class='button button-smaller button-primary' href=\"https://shortpixel.com/login/"+ShortPixel.API_KEY+'" target="_blank">'+_spTr.extendQuota+"</a><a class='button button-smaller' href='admin.php?action=shortpixel_check_quota'>"+_spTr.check__Quota+"</a>");showToolBarAlert(ShortPixel.STATUS_QUOTA_EXCEEDED);if(i.Stop==false){setTimeout(checkBulkProgress,5000)}ShortPixel.otherMediaUpdateActions(d,["quota","view"]);break;case ShortPixel.STATUS_FAIL:setCellMessage(d,i.Message,"<a class='button button-smaller button-primary' href=\"javascript:manualOptimization('"+d+"', false)\">"+_spTr.retry+"</a>");if(j){ShortPixel.bulkShowError(d,i.Message,i.Filename,i.CustomImageLink);showToolBarAlert(ShortPixel.STATUS_FAIL,i.Message);if(i.BulkPercent){progressUpdate(i.BulkPercent,i.BulkMsg)}ShortPixel.otherMediaUpdateActions(d,["retry","view"])}console.log(i.Message);setTimeout(checkBulkProgress,5000);break;case ShortPixel.STATUS_EMPTY_QUEUE:console.log(i.Message);clearBulkProcessor();hideToolBarAlert();var c=jQuery("#bulk-progress");if(j&&c.length&&i.BulkStatus!="2"){progressUpdate(100,"Bulk finished!");jQuery("a.bulk-cancel").attr("disabled","disabled");hideSlider();setTimeout(function(){window.location.reload()},3000)}break;case ShortPixel.STATUS_SUCCESS:if(j){ShortPixel.bulkHideLengthyMsg();ShortPixel.bulkHideMaintenanceMsg()}var l=i.PercentImprovement;showToolBarAlert(ShortPixel.STATUS_SUCCESS,"");var b=ShortPixel.isCustomImageId(d)?"":ShortPixel.successActions(d,i.Type,i.ThumbsCount,i.ThumbsTotal,i.BackupEnabled,i.Filename);setCellMessage(d,ShortPixel.successMsg(d,l,i.Type,i.ThumbsCount,i.RetinasCount),b);var h=jQuery(["restore","view","redolossy","redoglossy","redolossless"]).not(["redo"+i.Type]).get();ShortPixel.otherMediaUpdateActions(d,h);var f=new PercentageAnimator("#sp-msg-"+d+" span.percent",l);f.animate(l);if(j&&typeof i.Thumb!=="undefined"){if(i.BulkPercent){progressUpdate(i.BulkPercent,i.BulkMsg)}if(i.Thumb.length>0){sliderUpdate(d,i.Thumb,i.BkThumb,i.PercentImprovement,i.Filename);if(typeof i.AverageCompression!=="undefined"&&0+i.AverageCompression>0){jQuery("#sp-avg-optimization").html('<input type="text" class="dial" value="'+Math.round(i.AverageCompression)+'"/>');ShortPixel.percentDial("#sp-avg-optimization .dial",60)}}}console.log("Server response: "+g);if(j&&typeof i.BulkPercent!=="undefined"){progressUpdate(i.BulkPercent,i.BulkMsg)}setTimeout(checkBulkProgress,5000);break;case ShortPixel.STATUS_SKIP:if(i.Silent!==1){ShortPixel.bulkShowError(d,i.Message,i.Filename,i.CustomImageLink)}case ShortPixel.STATUS_ERROR:if(typeof i.Message!=="undefined"){showToolBarAlert(ShortPixel.STATUS_SKIP,i.Message+" Image ID: "+d);setCellMessage(d,i.Message,"")}ShortPixel.otherMediaUpdateActions(d,["retry","view"]);case ShortPixel.STATUS_RETRY:console.log("Server response: "+g);showToolBarAlert(ShortPixel.STATUS_RETRY,"");if(j&&typeof i.BulkPercent!=="undefined"){progressUpdate(i.BulkPercent,i.BulkMsg)}if(j&&i.Count>3){ShortPixel.bulkShowLengthyMsg(d,i.Filename,i.CustomImageLink)}setTimeout(checkBulkProgress,5000);break;case ShortPixel.STATUS_MAINTENANCE:ShortPixel.bulkShowMaintenanceMsg("maintenance");setTimeout(checkBulkProgress,60000);break;case ShortPixel.STATUS_QUEUE_FULL:ShortPixel.bulkShowMaintenanceMsg("queue-full");setTimeout(checkBulkProgress,60000);break;default:ShortPixel.retry("Unknown status "+i.Status+". Retrying...");break}}},error:function(b){ShortPixel.retry(b.statusText)}})}function clearBulkProcessor(){ShortPixel.bulkProcessor=false;localStorage.bulkTime=0;if(window.location.href.search("wp-short-pixel-bulk")>=0){localStorage.bulkPage=0}}function setCellMessage(d,a,c){var b=jQuery("#sp-msg-"+d);if(b.length>0){b.html("<div class='sp-column-actions'>"+c+"</div><div class='sp-column-info'>"+a+"</div>");b.css("color","")}b=jQuery("#sp-cust-msg-"+d);if(b.length>0){b.html("<div class='sp-column-info'>"+a+"</div>")}}function manualOptimization(c,a){setCellMessage(c,"<img src='"+ShortPixel.WP_PLUGIN_URL+"/res/img/loading.gif' class='sp-loading-small'>Image waiting to be processed","");jQuery("li.shortpixel-toolbar-processing").removeClass("shortpixel-hide");jQuery("li.shortpixel-toolbar-processing").addClass("shortpixel-processing");var b={action:"shortpixel_manual_optimization",image_id:c,cleanup:a};jQuery.get(ShortPixel.AJAX_URL,b,function(d){b=JSON.parse(d);if(b.Status==ShortPixel.STATUS_SUCCESS){setTimeout(checkBulkProgress,2000)}else{setCellMessage(c,typeof b.Message!=="undefined"?b.Message:_spTr.thisContentNotProcessable,"")}})}function reoptimize(c,a){setCellMessage(c,"<img src='"+ShortPixel.WP_PLUGIN_URL+"/res/img/loading.gif' class='sp-loading-small'>Image waiting to be reprocessed","");jQuery("li.shortpixel-toolbar-processing").removeClass("shortpixel-hide");jQuery("li.shortpixel-toolbar-processing").addClass("shortpixel-processing");var b={action:"shortpixel_redo",attachment_ID:c,type:a};jQuery.get(ShortPixel.AJAX_URL,b,function(d){b=JSON.parse(d);if(b.Status==ShortPixel.STATUS_SUCCESS){setTimeout(checkBulkProgress,2000)}else{$msg=typeof b.Message!=="undefined"?b.Message:_spTr.thisContentNotProcessable;setCellMessage(c,$msg,"");showToolBarAlert(ShortPixel.STATUS_FAIL,$msg)}})}function optimizeThumbs(b){setCellMessage(b,"<img src='"+ShortPixel.WP_PLUGIN_URL+"/res/img/loading.gif' class='sp-loading-small'>"+_spTr.imageWaitOptThumbs,"");jQuery("li.shortpixel-toolbar-processing").removeClass("shortpixel-hide");jQuery("li.shortpixel-toolbar-processing").addClass("shortpixel-processing");var a={action:"shortpixel_optimize_thumbs",attachment_ID:b};jQuery.get(ShortPixel.AJAX_URL,a,function(c){a=JSON.parse(c);if(a.Status==ShortPixel.STATUS_SUCCESS){setTimeout(checkBulkProgress,2000)}else{setCellMessage(b,typeof a.Message!=="undefined"?a.Message:_spTr.thisContentNotProcessable,"")}})}function dismissShortPixelNoticeExceed(b){jQuery("#wp-admin-bar-shortpixel_processing").hide();var a={action:"shortpixel_dismiss_notice",notice_id:"exceed"};jQuery.get(ShortPixel.AJAX_URL,a,function(c){a=JSON.parse(c);if(a.Status==ShortPixel.STATUS_SUCCESS){console.log("dismissed")}});b.preventDefault()}function dismissShortPixelNotice(b){jQuery("#short-pixel-notice-"+b).hide();var a={action:"shortpixel_dismiss_notice",notice_id:b};jQuery.get(ShortPixel.AJAX_URL,a,function(c){a=JSON.parse(c);if(a.Status==ShortPixel.STATUS_SUCCESS){console.log("dismissed")}})}function PercentageAnimator(b,a){this.animationSpeed=10;this.increment=2;this.curPercentage=0;this.targetPercentage=a;this.outputSelector=b;this.animate=function(c){this.targetPercentage=c;setTimeout(PercentageTimer.bind(null,this),this.animationSpeed)}}function PercentageTimer(a){if(a.curPercentage-a.targetPercentage<-a.increment){a.curPercentage+=a.increment}else{if(a.curPercentage-a.targetPercentage>a.increment){a.curPercentage-=a.increment}else{a.curPercentage=a.targetPercentage}}jQuery(a.outputSelector).text(a.curPercentage+"%");if(a.curPercentage!=a.targetPercentage){setTimeout(PercentageTimer.bind(null,a),a.animationSpeed)}}function progressUpdate(c,b){var a=jQuery("#bulk-progress");if(a.length){jQuery(".progress-left",a).css("width",c+"%");jQuery(".progress-img",a).css("left",c+"%");if(c>24){jQuery(".progress-img span",a).html("");jQuery(".progress-left",a).html(c+"%")}else{jQuery(".progress-img span",a).html(c+"%");jQuery(".progress-left",a).html("")}jQuery(".bulk-estimate").html(b)}}function sliderUpdate(g,c,d,e,b){var f=jQuery(".bulk-slider div.bulk-slide:first-child");if(f.length===0){return}if(f.attr("id")!="empty-slide"){f.hide()}f.css("z-index",1000);jQuery(".bulk-img-opt",f).attr("src","");if(typeof d==="undefined"){d=""}if(d.length>0){jQuery(".bulk-img-orig",f).attr("src","")}var a=f.clone();a.attr("id","slide-"+g);jQuery(".bulk-img-opt",a).attr("src",c);if(d.length>0){jQuery(".img-original",a).css("display","inline-block");jQuery(".bulk-img-orig",a).attr("src",d)}else{jQuery(".img-original",a).css("display","none")}jQuery(".bulk-opt-percent",a).html('<input type="text" class="dial" value="'+e+'"/>');jQuery(".bulk-slider").append(a);ShortPixel.percentDial("#"+a.attr("id")+" .dial",100);jQuery(".bulk-slider-container span.filename").html("&nbsp;&nbsp;"+b);if(f.attr("id")=="empty-slide"){f.remove();jQuery(".bulk-slider-container").css("display","block")}else{f.animate({left:f.width()+f.position().left},"slow","swing",function(){f.remove();a.fadeIn("slow")})}}function hideSlider(){jQuery(".bulk-slider-container").css("display","none")}function showStats(){var a=jQuery(".bulk-stats");if(a.length>0){}}if(!(typeof String.prototype.format=="function")){String.prototype.format=function(){var b=this,a=arguments.length;while(a--){b=b.replace(new RegExp("\\{"+a+"\\}","gm"),arguments[a])}return b}};
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: 4.8.7
7
  * Author: ShortPixel
8
  * Author URI: https://shortpixel.com
9
  * Text Domain: shortpixel-image-optimiser
@@ -18,7 +18,7 @@ define('SHORTPIXEL_PLUGIN_FILE', __FILE__);
18
 
19
  define('SHORTPIXEL_AFFILIATE_CODE', '');
20
 
21
- define('SHORTPIXEL_IMAGE_OPTIMISER_VERSION', "4.8.7");
22
  define('SHORTPIXEL_MAX_TIMEOUT', 10);
23
  define('SHORTPIXEL_VALIDATE_MAX_TIMEOUT', 15);
24
  define('SHORTPIXEL_BACKUP', 'ShortpixelBackups');
@@ -50,7 +50,7 @@ else
50
  */
51
 
52
  define('SHORTPIXEL_MAX_EXECUTION_TIME2', 2 );
53
- define("SHORTPIXEL_MAX_RESULTS_QUERY", 6);
54
 
55
  function shortpixelInit() {
56
  global $pluginInstance;
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: 4.8.8
7
  * Author: ShortPixel
8
  * Author URI: https://shortpixel.com
9
  * Text Domain: shortpixel-image-optimiser
18
 
19
  define('SHORTPIXEL_AFFILIATE_CODE', '');
20
 
21
+ define('SHORTPIXEL_IMAGE_OPTIMISER_VERSION', "4.8.8");
22
  define('SHORTPIXEL_MAX_TIMEOUT', 10);
23
  define('SHORTPIXEL_VALIDATE_MAX_TIMEOUT', 15);
24
  define('SHORTPIXEL_BACKUP', 'ShortpixelBackups');
50
  */
51
 
52
  define('SHORTPIXEL_MAX_EXECUTION_TIME2', 2 );
53
+ define("SHORTPIXEL_MAX_RESULTS_QUERY", 30);
54
 
55
  function shortpixelInit() {
56
  global $pluginInstance;