ShortPixel Image Optimizer - Version 4.21.0

Version Description

Release date October 20th 2020 * New: Plugin update notification system for future major versions; * Tweak: the plugin will not log manually when not logged in as administrator; * Fix: the plugin was incorrectly assuming the scheme for offloaded media files/backups; * Fix: in some situations the WebP file links weren't correct on some specific multisite installs; * Fix: WebP to Picture function also removes invalid lazy load tag (WordPress 5.5+); * Fix: there were a few dead links on settings page; * Language: 0 new strings added, 0 updated, 0 fuzzied, and 0 obsoleted.

Download this release

Release Info

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

Code changes from version 4.20.2 to 4.21.0

build/shortpixel/log/src/ShortPixelLogger.php CHANGED
@@ -62,6 +62,7 @@ namespace ShortPixel\ShortPixelLogger;
62
  $this->logLevel = intval($_REQUEST['SHORTPIXEL_DEBUG']);
63
  }
64
 
 
65
  }
66
  else if ( (defined('SHORTPIXEL_DEBUG') && SHORTPIXEL_DEBUG > 0) )
67
  {
@@ -138,6 +139,17 @@ namespace ShortPixel\ShortPixelLogger;
138
  return;
139
  }
140
 
 
 
 
 
 
 
 
 
 
 
 
141
  // Check where to log to.
142
  if ($this->logPath === false)
143
  {
@@ -321,6 +333,7 @@ namespace ShortPixel\ShortPixelLogger;
321
  $controller = $this;
322
 
323
  $template_path = __DIR__ . '/' . $this->template . '.php';
 
324
  if (file_exists($template_path))
325
  {
326
 
62
  $this->logLevel = intval($_REQUEST['SHORTPIXEL_DEBUG']);
63
  }
64
 
65
+
66
  }
67
  else if ( (defined('SHORTPIXEL_DEBUG') && SHORTPIXEL_DEBUG > 0) )
68
  {
139
  return;
140
  }
141
 
142
+ // Force administrator on manuals.
143
+ if ( $this->is_manual_request )
144
+ {
145
+ if (! function_exists('wp_get_current_user')) // not loaded yet
146
+ return false;
147
+
148
+ $user_is_administrator = (current_user_can('manage_options')) ? true : false;
149
+ if (! $user_is_administrator)
150
+ return false;
151
+ }
152
+
153
  // Check where to log to.
154
  if ($this->logPath === false)
155
  {
333
  $controller = $this;
334
 
335
  $template_path = __DIR__ . '/' . $this->template . '.php';
336
+
337
  if (file_exists($template_path))
338
  {
339
 
class/.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
1
+ #make sure the plugin.json file is loaded for auto-loading the classes, in case json files are excluded via gitignore
2
+ !plugin.json
class/Controller/AdminNoticesController.php CHANGED
@@ -34,12 +34,15 @@ class AdminNoticesController extends \ShortPixel\Controller
34
  add_action('admin_notices', array($this, 'displayNotices'), 50); // notices occured before page load
35
  add_action('admin_footer', array($this, 'displayNotices')); // called in views.
36
 
 
 
37
  // no persistent notifications with this flag set.
38
  if (defined('SHORTPIXEL_SILENT_MODE') && SHORTPIXEL_SILENT_MODE === true)
39
  return;
40
 
41
  add_action('admin_notices', array($this, 'check_admin_notices'), 5); // run before the plugin admin notices
42
 
 
43
  }
44
 
45
  public static function getInstance()
@@ -367,6 +370,21 @@ class AdminNoticesController extends \ShortPixel\Controller
367
  return false;
368
  }
369
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
370
  protected function getActivationNotice()
371
  {
372
  $message = "<p>" . __('In order to start the optimization process, you need to validate your API Key in the '
@@ -560,6 +578,182 @@ class AdminNoticesController extends \ShortPixel\Controller
560
  }
561
 
562
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
563
 
564
 
565
  } // class
34
  add_action('admin_notices', array($this, 'displayNotices'), 50); // notices occured before page load
35
  add_action('admin_footer', array($this, 'displayNotices')); // called in views.
36
 
37
+ add_action('in_plugin_update_message-' . plugin_basename(SHORTPIXEL_PLUGIN_FILE), array($this, 'pluginUpdateMessage') , 50, 2 );
38
+
39
  // no persistent notifications with this flag set.
40
  if (defined('SHORTPIXEL_SILENT_MODE') && SHORTPIXEL_SILENT_MODE === true)
41
  return;
42
 
43
  add_action('admin_notices', array($this, 'check_admin_notices'), 5); // run before the plugin admin notices
44
 
45
+
46
  }
47
 
48
  public static function getInstance()
370
  return false;
371
  }
372
 
373
+ /* protected function getPluginUpdateMessage($new_version)
374
+ {
375
+ $message = false;
376
+ if (version_compare(SHORTPIXEL_IMAGE_OPTIMISER_VERSION, $new_version, '>=') ) // already installed 'new version'
377
+ {
378
+ return false;
379
+ }
380
+ elseif (version_compare($new_version, '5.0', '>=') && version_compare(SHORTPIXEL_IMAGE_OPTIMISER_VERSION, '5.0','<'))
381
+ {
382
+ $message = __('<h4>Version 5.0</h4> Warning, Version 5 is a major update. It\'s strongly recommend to backup your site and proceed with caution. Please report issues via our support channels', 'shortpixel-image-optimiser');
383
+ }
384
+
385
+ return $message;
386
+ } */
387
+
388
  protected function getActivationNotice()
389
  {
390
  $message = "<p>" . __('In order to start the optimization process, you need to validate your API Key in the '
578
  }
579
 
580
 
581
+ public function pluginUpdateMessage($data, $response)
582
+ {
583
+ // $message = $this->getPluginUpdateMessage($plugin['new_version']);
584
+
585
+ $message = $this->get_update_notice($data, $response);
586
+
587
+ if( $message !== false && strlen(trim($message)) > 0) {
588
+ $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
589
+ printf(
590
+ '<tr class="plugin-update-tr active"><td colspan="%s" class="plugin-update colspanchange"><div class="notice inline notice-warning notice-alt">%s</div></td></tr>',
591
+ $wp_list_table->get_column_count(),
592
+ wpautop( $message )
593
+ );
594
+ }
595
+
596
+ }
597
+
598
+ /**
599
+ * Stolen from SPAI, Thanks.
600
+ */
601
+ private function get_update_notice($data, $response) {
602
+ $transient_name = 'shortpixel_update_notice_' . $response->new_version;
603
+ $update_notice = get_transient( $transient_name );
604
+ $url = 'https://plugins.svn.wordpress.org/shortpixel-image-optimiser/trunk/readme.txt';
605
+
606
+ if ( $update_notice === false || strlen( $update_notice ) == 0 ) {
607
+ $readme_response = wp_safe_remote_request( $url );
608
+ $content = false;
609
+ if (! is_wp_error( $readme_response ) )
610
+ {
611
+ $content = $readme_response['body'];
612
+ }
613
+
614
+
615
+ if ( !empty( $readme_response ) ) {
616
+ $update_notice = $this->parse_update_notice( $content, $response );
617
+ set_transient( $transient_name, $update_notice, DAY_IN_SECONDS );
618
+ }
619
+ }
620
+
621
+ return $update_notice;
622
+ }
623
+
624
+
625
+
626
+ /**
627
+ * Parse update notice from readme file.
628
+ *
629
+ * @param string $content ShortPixel AI readme file content
630
+ * @param object $response WordPress response
631
+ *
632
+ * @return string
633
+ */
634
+ private function parse_update_notice( $content, $response ) {
635
+ //$version_parts = explode( '.', $response->new_version );
636
+ // var_dump($version_parts);
637
+ // echo "<PRE>"; var_dump($content); echo "</PRE>";
638
+
639
+ /* $check_for_notices = [
640
+ $version_parts[ 0 ] . '.' . $version_parts[ 1 ] . '.' . $version_parts[ 2 ] . '.' . $version_parts[ 3 ], // build
641
+ $version_parts[ 0 ] . '.' . $version_parts[ 1 ] . '.' . $version_parts[ 2 ], // patch (micro)
642
+ $version_parts[ 0 ] . '.' . $version_parts[ 1 ] . '.0', // minor
643
+ $version_parts[ 0 ] . '.' . $version_parts[ 1 ], // minor
644
+ $version_parts[ 0 ] . '.0.0', // major
645
+ $version_parts[ 0 ] . '.0', // major
646
+ ]; */
647
+ $new_version = $response->new_version;
648
+
649
+ $update_notice = '';
650
+
651
+ // foreach ( $check_for_notices as $id => $check_version ) {
652
+ if ( version_compare( SHORTPIXEL_IMAGE_OPTIMISER_VERSION, $new_version, '>' ) ) {
653
+ return '';
654
+ }
655
+
656
+ $result = $this->parse_readme_content( $content, $new_version, $response );
657
+
658
+ if ( !empty( $result ) ) {
659
+ $update_notice = $result;
660
+ }
661
+ // }
662
+
663
+ return wp_kses_post( $update_notice );
664
+ }
665
+
666
+
667
+ /*
668
+ *
669
+ * Parses readme file's content to find notice related to passed version
670
+ *
671
+ * @param string $content Readme file content
672
+ * @param string $version Checked version
673
+ * @param object $response WordPress response
674
+ *
675
+ * @return string
676
+ */
677
+
678
+ private function parse_readme_content( $content, $new_version, $response ) {
679
+
680
+ $notices_pattern = '/==.*Upgrade Notice.*==(.*)$|==/Uis';
681
+
682
+ $notice = '';
683
+ $matches = null;
684
+
685
+ if ( preg_match( $notices_pattern, $content, $matches ) ) {
686
+
687
+ if (! isset($matches[1]))
688
+ return ''; // no update texts.
689
+ $lines = str_split(trim($matches[1]));
690
+ $versions = array();
691
+ $inv = false;
692
+ foreach($lines as $char)
693
+ {
694
+ //if (count($versions) == 0)
695
+ if ($char == '=' && ! $inv) // = and not recording version, start one.
696
+ {
697
+ $curver = '';
698
+ $inv = true;
699
+ }
700
+ elseif ($char == ' ' && $inv) // don't record spaces in version
701
+ continue;
702
+ elseif ($char == '=' && $inv) // end of version line
703
+ { $versions[trim($curver)] = '';
704
+ $inv = false;
705
+ }
706
+ elseif($inv) // record the version string
707
+ {
708
+ $curver .= $char;
709
+ }
710
+ elseif(! $inv) // record the message
711
+ {
712
+ $versions[trim($curver)] .= $char;
713
+ }
714
+
715
+
716
+ }
717
+
718
+ foreach($versions as $version => $line)
719
+ {
720
+ if (version_compare(SHORTPIXEL_IMAGE_OPTIMISER_VERSION, $version, '<') && version_compare($version, $new_version, '<='))
721
+ {
722
+ $notice .= '<span>';
723
+ $notice .= $this->markdown2html( $line );
724
+ $notice .= '</span>';
725
+ }
726
+ }
727
+
728
+ }
729
+
730
+ return $notice;
731
+ }
732
+
733
+ /*private function replace_readme_constants( $content, $response ) {
734
+ $constants = [ '{{ NEW VERSION }}', '{{ CURRENT VERSION }}', '{{ PHP VERSION }}', '{{ REQUIRED PHP VERSION }}' ];
735
+ $replacements = [ $response->new_version, SHORTPIXEL_IMAGE_OPTIMISER_VERSION, PHP_VERSION, $response->requires_php ];
736
+
737
+ return str_replace( $constants, $replacements, $content );
738
+ } */
739
+
740
+ private function markdown2html( $content ) {
741
+ $patterns = [
742
+ '/\*\*(.+)\*\*/U', // bold
743
+ '/__(.+)__/U', // italic
744
+ '/\[([^\]]*)\]\(([^\)]*)\)/U', // link
745
+ ];
746
+
747
+ $replacements = [
748
+ '<strong>${1}</strong>',
749
+ '<em>${1}</em>',
750
+ '<a href="${2}" target="_blank">${1}</a>',
751
+ ];
752
+
753
+ $prepared_content = preg_replace( $patterns, $replacements, $content );
754
+
755
+ return isset( $prepared_content ) ? $prepared_content : $content;
756
+ }
757
 
758
 
759
  } // class
class/Controller/FileSystemController.php CHANGED
@@ -176,7 +176,9 @@ Class FileSystemController extends \ShortPixel\Controller
176
  // This happens when file is outside of wp_uploads_dir
177
  if (strpos($url, $wp_home_path) !== false)
178
  {
179
- $home_url = trailingslashit(get_home_url());
 
 
180
  $url = str_replace($wp_home_path, $home_url, $filepath);
181
  }
182
 
176
  // This happens when file is outside of wp_uploads_dir
177
  if (strpos($url, $wp_home_path) !== false)
178
  {
179
+ // This is SITE URL, for the same reason it should be home_url in FILEMODEL. The difference is when the site is running on a subdirectory
180
+ // ** This is a fix for a real-life issue, do not change if this causes issues, another fix is needed then.
181
+ $home_url = trailingslashit(get_site_url());
182
  $url = str_replace($wp_home_path, $home_url, $filepath);
183
  }
184
 
class/Model/FileModel.php CHANGED
@@ -82,7 +82,7 @@ class FileModel extends \ShortPixel\Model
82
  public function exists()
83
  {
84
  if (is_null($this->exists))
85
- $this->exists = file_exists($this->fullpath);
86
 
87
  return $this->exists;
88
  }
@@ -90,7 +90,7 @@ class FileModel extends \ShortPixel\Model
90
  public function is_writable()
91
  {
92
  if (is_null($this->is_writable))
93
- $this->is_writable = is_writable($this->fullpath);
94
 
95
  return $this->is_writable;
96
  }
@@ -98,7 +98,7 @@ class FileModel extends \ShortPixel\Model
98
  public function is_readable()
99
  {
100
  if (is_null($this->is_readable))
101
- $this->is_readable = is_readable($this->fullpath);
102
 
103
  return $this->is_readable;
104
  }
@@ -295,7 +295,7 @@ class FileModel extends \ShortPixel\Model
295
  $this->mime = wp_get_image_mime($this->fullpath);
296
  }
297
  else
298
- $this->mime = false;
299
 
300
  return $this->mime;
301
  }
@@ -385,7 +385,7 @@ class FileModel extends \ShortPixel\Model
385
  {
386
  //$uploadDir = wp_upload_dir();
387
 
388
- $site_url = str_replace('http:', '', get_site_url(null, '', 'http'));
389
  $url = str_replace(array('http:', 'https:'), '', $url);
390
 
391
  if (strpos($url, $site_url) !== false)
82
  public function exists()
83
  {
84
  if (is_null($this->exists))
85
+ $this->exists = @file_exists($this->fullpath);
86
 
87
  return $this->exists;
88
  }
90
  public function is_writable()
91
  {
92
  if (is_null($this->is_writable))
93
+ $this->is_writable = @is_writable($this->fullpath);
94
 
95
  return $this->is_writable;
96
  }
98
  public function is_readable()
99
  {
100
  if (is_null($this->is_readable))
101
+ $this->is_readable = @is_readable($this->fullpath);
102
 
103
  return $this->is_readable;
104
  }
295
  $this->mime = wp_get_image_mime($this->fullpath);
296
  }
297
  else
298
+ $this->mime = false;
299
 
300
  return $this->mime;
301
  }
385
  {
386
  //$uploadDir = wp_upload_dir();
387
 
388
+ $site_url = str_replace('http:', '', home_url('', 'http'));
389
  $url = str_replace(array('http:', 'https:'), '', $url);
390
 
391
  if (strpos($url, $site_url) !== false)
class/Tools.php CHANGED
@@ -214,6 +214,16 @@ static public function formatBytes($bytes, $precision = 2) {
214
  'action' => 'Deactivate',
215
  'data' => 'regenerate-thumbnails-and-delete-unused/regenerate_wpregenerate.php',
216
  ),
 
 
 
 
 
 
 
 
 
 
217
  //DEACTIVATED TEMPORARILY - it seems that the customers get scared.
218
  /* 'Jetpack by WordPress.com - The Speed up image load times Option'
219
  => array(
214
  'action' => 'Deactivate',
215
  'data' => 'regenerate-thumbnails-and-delete-unused/regenerate_wpregenerate.php',
216
  ),
217
+ 'Swift Performance'
218
+ => array(
219
+ 'action' => 'Deactivate',
220
+ 'data' => 'swift-performance/performance.php',
221
+ ),
222
+ 'Swift Performance Lite'
223
+ => array(
224
+ 'action' => 'Deactivate',
225
+ 'data' => 'swift-performance-lite/performance.php',
226
+ ),
227
  //DEACTIVATED TEMPORARILY - it seems that the customers get scared.
228
  /* 'Jetpack by WordPress.com - The Speed up image load times Option'
229
  => array(
class/external/wp-offload-media.php CHANGED
@@ -33,6 +33,7 @@ class wpOffload
33
  $this->as3cf = $as3cf;
34
  $this->active = true;
35
 
 
36
  // if setting to upload to bucket is off, don't hook or do anything really.
37
  if (! $this->as3cf->get_setting( 'copy-to-s3' ))
38
  {
@@ -45,6 +46,11 @@ class wpOffload
45
  $this->cname = $this->as3cf->get_setting( 'cloudfront' );
46
  }
47
 
 
 
 
 
 
48
  add_action('shortpixel_image_optimised', array($this, 'image_upload'));
49
  add_action('shortpixel_after_restore_image', array($this, 'image_restore')); // hit this when restoring.
50
  add_action('shortpixel/image/convertpng2jpg_after', array($this, 'image_converted'));
@@ -68,10 +74,21 @@ class wpOffload
68
  public function get_raw_attached_file($file, $id)
69
  {
70
  $scheme = parse_url($file, PHP_URL_SCHEME);
 
 
 
 
 
 
 
71
  if ($scheme !== false && strpos($scheme, 's3') !== false)
72
  {
73
  return get_attached_file($id, true);
74
  }
 
 
 
 
75
  return $file;
76
  }
77
 
@@ -80,7 +97,9 @@ class wpOffload
80
  {
81
 
82
  $scheme = parse_url($file, PHP_URL_SCHEME);
83
- if ($scheme !== false && strpos($scheme, 's3') !== false)
 
 
84
  {
85
  $image_meta = wp_get_attachment_metadata( $id );
86
  $image_file = get_attached_file( $id, true );
33
  $this->as3cf = $as3cf;
34
  $this->active = true;
35
 
36
+
37
  // if setting to upload to bucket is off, don't hook or do anything really.
38
  if (! $this->as3cf->get_setting( 'copy-to-s3' ))
39
  {
46
  $this->cname = $this->as3cf->get_setting( 'cloudfront' );
47
  }
48
 
49
+ $provider = $this->as3cf->get_provider();
50
+ // $domain = $provider->get_bucket_location();
51
+
52
+ // var_dump($domain);
53
+
54
  add_action('shortpixel_image_optimised', array($this, 'image_upload'));
55
  add_action('shortpixel_after_restore_image', array($this, 'image_restore')); // hit this when restoring.
56
  add_action('shortpixel/image/convertpng2jpg_after', array($this, 'image_converted'));
74
  public function get_raw_attached_file($file, $id)
75
  {
76
  $scheme = parse_url($file, PHP_URL_SCHEME);
77
+
78
+ $item = $this->getItemById($id);
79
+ if ($item !== false) // this is a offloaded thingie
80
+ {
81
+ return get_attached_file($id, true);
82
+ }
83
+ /*
84
  if ($scheme !== false && strpos($scheme, 's3') !== false)
85
  {
86
  return get_attached_file($id, true);
87
  }
88
+ else
89
+ {
90
+
91
+ } */
92
  return $file;
93
  }
94
 
97
  {
98
 
99
  $scheme = parse_url($file, PHP_URL_SCHEME);
100
+ $item = $this->getItemById($id);
101
+
102
+ if ($item !== false)
103
  {
104
  $image_meta = wp_get_attachment_metadata( $id );
105
  $image_file = get_attached_file( $id, true );
class/front/img-to-picture-webp.php CHANGED
@@ -166,11 +166,13 @@ class ShortPixelImgToPictureWebp
166
  $heightAttr = isset($img['height']) && strlen($img['height']) ? ' height="' . $img['height'] . '"' : '';
167
  $widthAttr = isset($img['width']) && strlen($img['width']) ? ' width="' . $img['width'] . '"' : '';
168
 
 
169
  // We don't wanna have src-ish attributes on the <picture>
170
  unset($img['src']);
171
  unset($img['data-src']);
172
  unset($img['data-lazy-src']);
173
  unset($img['srcset']);
 
174
  // unset($img['data-srcset']); // lazyload - don't know if this solves anything.
175
  unset($img['sizes']);
176
 
166
  $heightAttr = isset($img['height']) && strlen($img['height']) ? ' height="' . $img['height'] . '"' : '';
167
  $widthAttr = isset($img['width']) && strlen($img['width']) ? ' width="' . $img['width'] . '"' : '';
168
 
169
+
170
  // We don't wanna have src-ish attributes on the <picture>
171
  unset($img['src']);
172
  unset($img['data-src']);
173
  unset($img['data-lazy-src']);
174
  unset($img['srcset']);
175
+ unset($img['loading']);
176
  // unset($img['data-srcset']); // lazyload - don't know if this solves anything.
177
  unset($img['sizes']);
178
 
class/view/settings/part-advanced.php CHANGED
@@ -14,13 +14,13 @@ namespace ShortPixel;
14
  if( $this->is_nginx ){
15
  $deliverWebpUnaltered = ''; // Uncheck
16
  $deliverWebpUnalteredDisabled = 'disabled'; // Disable
17
- $deliverWebpUnalteredLabel = __('It looks like you\'re running your site on an NginX server. This means that you can only achieve this functionality by directly configuring the server config files. Please follow this link for instructions on how to achieve this:','shortpixel-image-optimiser')." <a href=\"javascript:void(0)\" data-beacon-article=\"5bfeb9de2c7d3a31944e78ee\">Open article</a>";
18
  } else {
19
  if( !$this->is_htaccess_writable ){
20
  $deliverWebpUnalteredDisabled = 'disabled'; // Disable
21
  if( $view->data->deliverWebp == 3 ){
22
  $deliverWebpAlteredDisabled = 'disabled'; // Disable
23
- $deliverWebpUnalteredLabel = __('It looks like you recently moved from an Apache server to an NGINX server, while the option to use .htacces was in use. Please follow this tutorial to see how you could implement by yourself this functionality, outside of the WP plugin: ','shortpixel-image-optimiser') . '<a href="javascript:void(0)" data-beacon-article="5bfeb9de2c7d3a31944e78ee">Open article</a>';
24
  } else {
25
  $deliverWebpUnalteredLabel = __('It looks like your .htaccess file cannot be written. Please fix this and then return to refresh this page to enable this option.','shortpixel-image-optimiser');
26
  }
@@ -28,7 +28,7 @@ namespace ShortPixel;
28
  // Show a message about the risks and caveats of serving WEBP images via .htaccess
29
  $deliverWebpUnalteredLabel = '<span style="color: initial;">'.__('Based on testing your particular hosting configuration, we determined that your server','shortpixel-image-optimiser').
30
  '&nbsp;<img alt="can or can not" src="'. plugins_url( 'res/img/test.jpg' , SHORTPIXEL_PLUGIN_FILE) .'">&nbsp;'.
31
- __('serve the WEBP versions of the JPEG files seamlessly, via .htaccess.','shortpixel-image-optimiser').' <a href="javascript:void(0)" data-beacon-article="5c1d050e04286304a71d9ce4">Open article to read more about this.</a></span>';
32
  }
33
  }
34
 
14
  if( $this->is_nginx ){
15
  $deliverWebpUnaltered = ''; // Uncheck
16
  $deliverWebpUnalteredDisabled = 'disabled'; // Disable
17
+ $deliverWebpUnalteredLabel = __('It looks like you\'re running your site on an NginX server. This means that you can only achieve this functionality by directly configuring the server config files. Please follow this link for instructions on how to achieve this:','shortpixel-image-optimiser')." <a href=\"https://help.shortpixel.com/article/111-configure-nginx-to-transparently-serve-webp-files-when-supported\" target=\"_blank\" data-beacon-article=\"5bfeb9de2c7d3a31944e78ee\">Open article</a>";
18
  } else {
19
  if( !$this->is_htaccess_writable ){
20
  $deliverWebpUnalteredDisabled = 'disabled'; // Disable
21
  if( $view->data->deliverWebp == 3 ){
22
  $deliverWebpAlteredDisabled = 'disabled'; // Disable
23
+ $deliverWebpUnalteredLabel = __('It looks like you recently moved from an Apache server to an NGINX server, while the option to use .htacces was in use. Please follow this tutorial to see how you could implement by yourself this functionality, outside of the WP plugin: ','shortpixel-image-optimiser') . '<a href="https://help.shortpixel.com/article/111-configure-nginx-to-transparently-serve-webp-files-when-supported" target="_blank" data-beacon-article="5bfeb9de2c7d3a31944e78ee">Open article</a>';
24
  } else {
25
  $deliverWebpUnalteredLabel = __('It looks like your .htaccess file cannot be written. Please fix this and then return to refresh this page to enable this option.','shortpixel-image-optimiser');
26
  }
28
  // Show a message about the risks and caveats of serving WEBP images via .htaccess
29
  $deliverWebpUnalteredLabel = '<span style="color: initial;">'.__('Based on testing your particular hosting configuration, we determined that your server','shortpixel-image-optimiser').
30
  '&nbsp;<img alt="can or can not" src="'. plugins_url( 'res/img/test.jpg' , SHORTPIXEL_PLUGIN_FILE) .'">&nbsp;'.
31
+ __('serve the WEBP versions of the JPEG files seamlessly, via .htaccess.','shortpixel-image-optimiser').' <a href="https://help.shortpixel.com/article/127-delivering-webp-images-via-htaccess" target="_blank" data-beacon-article="5c1d050e04286304a71d9ce4">Open article to read more about this.</a></span>';
32
  }
33
  }
34
 
class/wp-short-pixel.php CHANGED
@@ -161,7 +161,7 @@ class WPShortPixel {
161
  //This adds the constants used in PHP to be available also in JS
162
  add_action( 'admin_enqueue_scripts', array( $this, 'shortPixelJS') );
163
  add_action( 'admin_footer', array($this, 'admin_footer_js') );
164
- add_action( 'admin_head', array( $this, 'headCSS') );
165
 
166
  //register a method to display admin notices if necessary
167
  add_action('admin_notices', array( &$this, 'displayAdminNotices'));
@@ -285,9 +285,9 @@ class WPShortPixel {
285
  Log::addInfo($message);
286
  }
287
 
288
- function headCSS() {
289
  echo('<style>.shortpixel-hide {display:none;}</style>');
290
- }
291
 
292
  /** @todo Plugin init class. Try to get rid of inline JS. Also still loads on all WP pages, prevent that. */
293
  function shortPixelJS() {
@@ -1784,7 +1784,8 @@ class WPShortPixel {
1784
  * Note - $regeneratedSizes expects part of the metadata array called [sizes], with filename, not just the resized data.
1785
  */
1786
  public function thumbnailsRegeneratedHook($postId, $originalMeta, $regeneratedSizes = array(), $bulk = false) {
1787
-
 
1788
 
1789
  if(isset($originalMeta["ShortPixelImprovement"]) && is_numeric($originalMeta["ShortPixelImprovement"])) {
1790
  $shortPixelMeta = $originalMeta["ShortPixel"];
@@ -1795,9 +1796,25 @@ class WPShortPixel {
1795
  $shortPixelMeta["retinasOpt"] = 0;
1796
  } else {
1797
  $regeneratedThumbs = array();
 
1798
  foreach($regeneratedSizes as $size) {
1799
  if(isset($size['file']) && in_array($size['file'], $shortPixelMeta["thumbsOptList"] )) {
1800
  $regeneratedThumbs[] = $size['file'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1801
  $shortPixelMeta["thumbsOpt"] = max(0, $shortPixelMeta["thumbsOpt"] - 1); // this is a complicated count of number of thumbnails
1802
  $shortPixelMeta["retinasOpt"] = max(0, $shortPixelMeta["retinasOpt"] - 1);
1803
  }
@@ -1889,6 +1906,8 @@ class WPShortPixel {
1889
  private function getBackupFolderInternal(FileModel $file) {
1890
  // $fileExtension = strtolower(substr($file,strrpos($file,".")+1));
1891
  $fs = \wpSPIO()->filesystem();
 
 
1892
  $SubDir = ShortPixelMetaFacade::returnSubDir($file);
1893
  $SubDirOld = ShortPixelMetaFacade::returnSubDirOld($file);
1894
  //$basename = ShortPixelAPI::MB_basename($file);
@@ -1904,6 +1923,10 @@ class WPShortPixel {
1904
  return $backupFolder;
1905
  }
1906
 
 
 
 
 
1907
  // Try to unholy old solutions
1908
  $backupFile = $fs->getFile(SHORTPIXEL_BACKUP_FOLDER . '/'. $SubDir . '/' . $basename);
1909
  if ($backupFile->exists())
161
  //This adds the constants used in PHP to be available also in JS
162
  add_action( 'admin_enqueue_scripts', array( $this, 'shortPixelJS') );
163
  add_action( 'admin_footer', array($this, 'admin_footer_js') );
164
+ //add_action( 'admin_head', array( $this, 'headCSS') );
165
 
166
  //register a method to display admin notices if necessary
167
  add_action('admin_notices', array( &$this, 'displayAdminNotices'));
285
  Log::addInfo($message);
286
  }
287
 
288
+ /*function headCSS() {
289
  echo('<style>.shortpixel-hide {display:none;}</style>');
290
+ } */
291
 
292
  /** @todo Plugin init class. Try to get rid of inline JS. Also still loads on all WP pages, prevent that. */
293
  function shortPixelJS() {
1784
  * Note - $regeneratedSizes expects part of the metadata array called [sizes], with filename, not just the resized data.
1785
  */
1786
  public function thumbnailsRegeneratedHook($postId, $originalMeta, $regeneratedSizes = array(), $bulk = false) {
1787
+ $fs = \wpSPIO()->filesystem();
1788
+ $settings = \wpSPIO()->settings();
1789
 
1790
  if(isset($originalMeta["ShortPixelImprovement"]) && is_numeric($originalMeta["ShortPixelImprovement"])) {
1791
  $shortPixelMeta = $originalMeta["ShortPixel"];
1796
  $shortPixelMeta["retinasOpt"] = 0;
1797
  } else {
1798
  $regeneratedThumbs = array();
1799
+ $mainFile = $fs->getAttachedFile($postId);
1800
  foreach($regeneratedSizes as $size) {
1801
  if(isset($size['file']) && in_array($size['file'], $shortPixelMeta["thumbsOptList"] )) {
1802
  $regeneratedThumbs[] = $size['file'];
1803
+ $fileObj = $fs->getFile( (string) $mainFile->getFileDir() . $size['file']);
1804
+
1805
+ // if we are creating Webp, remove it.
1806
+ if ($settings->createWebp)
1807
+ {
1808
+ if (SHORTPIXEL_USE_DOUBLE_WEBP_EXTENSION)
1809
+ $webpObj = $fs->getFile( (string) $fileObj->getFileDir() . $fileObj->getFileName() . '.webp');
1810
+ else
1811
+ $webpObj = $fs->getFile( (string) $fileObj->getFileDir() . $fileObj->getFileBase() . '.webp');
1812
+
1813
+ if ($webpObj->exists())
1814
+ $webpObj->delete();
1815
+
1816
+ }
1817
+
1818
  $shortPixelMeta["thumbsOpt"] = max(0, $shortPixelMeta["thumbsOpt"] - 1); // this is a complicated count of number of thumbnails
1819
  $shortPixelMeta["retinasOpt"] = max(0, $shortPixelMeta["retinasOpt"] - 1);
1820
  }
1906
  private function getBackupFolderInternal(FileModel $file) {
1907
  // $fileExtension = strtolower(substr($file,strrpos($file,".")+1));
1908
  $fs = \wpSPIO()->filesystem();
1909
+ $settings = \wpSPIO()->settings();
1910
+
1911
  $SubDir = ShortPixelMetaFacade::returnSubDir($file);
1912
  $SubDirOld = ShortPixelMetaFacade::returnSubDirOld($file);
1913
  //$basename = ShortPixelAPI::MB_basename($file);
1923
  return $backupFolder;
1924
  }
1925
 
1926
+ // If backup is off, just don't return it.
1927
+ // if (! $settings->backupImages)
1928
+ // return false;
1929
+
1930
  // Try to unholy old solutions
1931
  $backupFile = $fs->getFile(SHORTPIXEL_BACKUP_FOLDER . '/'. $SubDir . '/' . $basename);
1932
  if ($backupFile->exists())
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: ShortPixel
3
  Tags: convert webp, optimize images, image optimization, resize, compressor, image, compression, optimize, image optimiser, image compression, compress pdf, compress jpg, compress png, performance, photography, smush, scale, pictures
4
  Requires at least: 3.2.0
5
- Tested up to: 5.5
6
  Requires PHP: 5.3
7
- Stable tag: 4.20.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -80,7 +80,7 @@ Help us spread the word by recommending ShortPixel to your friends and collect *
80
 
81
  **Other plugins by ShortPixel**
82
 
83
- * Image optimization & CDN on the fly - <a href="https://wordpress.org/plugins/shortpixel-adaptive-images/" target="_blank">ShortPixel Adaptive Images</a>
84
  * Easily replace images or files in Media Library - <a href="https://wordpress.org/plugins/enable-media-replace/" target="_blank">Enable Media Replace</a>
85
  * Regenerate thumbnails plugin compatible with the other ShortPixel plugins - <a href="https://wordpress.org/plugins/regenerate-thumbnails-advanced/" target="_blank">reGenerate Thumbnails Advanced</a>
86
  * Make sure you don't have huge images in your Media Library - <a href="https://wordpress.org/plugins/resize-image-after-upload/" target="_blank">Resize Image After Upload</a>
@@ -299,6 +299,18 @@ Hide the Cloudflare settings by defining these constants in wp-config.php:
299
  9. Check other optimized images status - themes or other plugins' images. (Media>Other Media)
300
 
301
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
302
  = 4.20.2 =
303
 
304
  Release date August 26th 2020
2
  Contributors: ShortPixel
3
  Tags: convert webp, optimize images, image optimization, resize, compressor, image, compression, optimize, image optimiser, image compression, compress pdf, compress jpg, compress png, performance, photography, smush, scale, pictures
4
  Requires at least: 3.2.0
5
+ Tested up to: 5.5.1
6
  Requires PHP: 5.3
7
+ Stable tag: 4.21.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
80
 
81
  **Other plugins by ShortPixel**
82
 
83
+ * Image optimization & CDN on the fly - <a href="https://wordpress.org/plugins/shortpixel-adaptive-images/" target="_blank">ShortPixel Adaptive Images</a>
84
  * Easily replace images or files in Media Library - <a href="https://wordpress.org/plugins/enable-media-replace/" target="_blank">Enable Media Replace</a>
85
  * Regenerate thumbnails plugin compatible with the other ShortPixel plugins - <a href="https://wordpress.org/plugins/regenerate-thumbnails-advanced/" target="_blank">reGenerate Thumbnails Advanced</a>
86
  * Make sure you don't have huge images in your Media Library - <a href="https://wordpress.org/plugins/resize-image-after-upload/" target="_blank">Resize Image After Upload</a>
299
  9. Check other optimized images status - themes or other plugins' images. (Media>Other Media)
300
 
301
  == Changelog ==
302
+
303
+ = 4.21.0 =
304
+
305
+ Release date October 20th 2020
306
+ * New: Plugin update notification system for future major versions;
307
+ * Tweak: the plugin will not log manually when not logged in as administrator;
308
+ * Fix: the plugin was incorrectly assuming the scheme for offloaded media files/backups;
309
+ * Fix: in some situations the WebP file links weren't correct on some specific multisite installs;
310
+ * Fix: WebP to Picture function also removes invalid lazy load tag (WordPress 5.5+);
311
+ * Fix: there were a few dead links on settings page;
312
+ * Language: 0 new strings added, 0 updated, 0 fuzzied, and 0 obsoleted.
313
+
314
  = 4.20.2 =
315
 
316
  Release date August 26th 2020
res/css/short-pixel.css CHANGED
@@ -3,6 +3,8 @@
3
  font-style: normal;
4
  }
5
 
 
 
6
  .clearfix:before, .clearfix:after { content: " "; /* 1 */ display: table; /* 2 */}
7
  .clearfix:after { clear: both; }
8
  .clearfix { zoom: 1; }
3
  font-style: normal;
4
  }
5
 
6
+ .shortpixel-hide { display: none; }
7
+
8
  .clearfix:before, .clearfix:after { content: " "; /* 1 */ display: table; /* 2 */}
9
  .clearfix:after { clear: both; }
10
  .clearfix { zoom: 1; }
res/css/short-pixel.min.css CHANGED
@@ -1 +1 @@
1
- .reset{font-weight:400;font-style:normal}.clearfix:after,.clearfix:before{content:" ";display:table}.clearfix:after{clear:both}.clearfix{zoom:1}.resumeLabel{float:right;line-height:30px;margin-right:20px;font-size:16px}.sp-dropbtn.button{box-sizing:content-box;padding:0 5px;font-size:20px;line-height: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,.2);z-index:1}.rtl .sp-dropdown-content{right:auto;left:0}.sp-dropdown-content a{color:#000;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}.sp-notice img{vertical-align:bottom}@media(max-width:1249px){.sp-notice{margin:5px 15px 2px}}.sp-notice-info{border-left-color:#00a0d2}.sp-notice-success{border-left-color:#46b450}.sp-notice-warning{border-left-color:#f1e02a}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;position:relative;z-index:10}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}.sp-notice .bulk-error-show{cursor:pointer}.sp-notice div.bulk-error-list{background-color:#f1f1f1;padding:0 10px;display:none;max-height:200px;overflow-y:scroll}.sp-notice div.bulk-error-list ul{padding:3px 0 0;margin-top:5px}.sp-notice div.bulk-error-list ul>li:not(:last-child){border-bottom:1px solid #fff;padding-bottom:4px}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 th{width:220px}.form-table td{position:relative}div.shortpixel-rate-us{display:inline-block;margin-left:10px;vertical-align:top;font-weight:700}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:focus,div.shortpixel-rate-us>a:hover{outline:0;border-style:none}.sp-loading-small{margin-top:2px;float:left;margin-right:5px}.twentytwenty-horizontal .twentytwenty-after-label:before,.twentytwenty-horizontal .twentytwenty-before-label:before{font-family:inherit;font-size:16px}.short-pixel-bulk-page p{margin:.6em 0}.short-pixel-bulk-page form.start{display:table;content:" ";width:98%;background-color:#fff;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:700;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:700;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;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;min-height:30px;float:right}.wp-core-ui.rtl .column-wp-shortPixel .button.button-smaller,.wp-core-ui.rtl .column-wp-shortPixel .sp-column-actions{float:left}th.sortable.column-wp-shortPixel a,th.sorted.column-wp-shortPixel a{display:inline-block}.column-wp-shortPixel .sorting-indicator{display:inline-block}.wp-core-ui .bulk-play a.button .bulk-btn-img{display:inline-block;padding-top:6px}.wp-core-ui .bulk-play a.button .bulk-btn-txt{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}.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}.short-pixel-bulk-page .progress{background-color:#ecedee;height:30px;position:relative;width:60%;display:inline-block;margin-right:28px;overflow:visible}.progress .progress-img{position:absolute;top:-10px;z-index:2;margin-left:-35px;line-height:48px;font-size:22px;font-weight:700}.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:700;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:700;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:400}.bulk-slider{display:table;margin:0 auto}.bulk-slider .bulk-slide{margin:0 auto;padding-left:120px;display:inline-block;font-weight:700}.bulk-slider .img-optimized,.bulk-slider .img-original{display:inline-block;margin-right:20px;text-align:center}.bulk-slider .img-optimized div,.bulk-slider .img-original div{max-height:450px;overflow:hidden}.bulk-slider .img-optimized img,.bulk-slider .img-original 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}.shortpixel-key-valid{font-weight:700}.shortpixel-key-valid .dashicons-yes:before{font-size:2em;line-height:25px;color:#3485ba;margin-left:-20px}.shortpixel-compression .shortpixel-compression-options{color:#999}.shortpixel-compression strong{line-height:22px}.shortpixel-compression .shortpixel-compression-options{display:inline-block}.shortpixel-compression label{width:158px;margin:0 -2px;background-color:#e2faff;font-weight:700;display:inline-block}.shortpixel-compression label span{text-align:center;font-size:18px;padding:8px 0;display:block}.shortpixel-compression label input{display:none}.shortpixel-compression input:checked+span{background-color:#0085ba;color:#f7f7f7}.shortpixel-compression .shortpixel-radio-info{min-height:60px}article.sp-tabs{position:relative;display:block;width:100%;margin:2em auto}article.sp-tabs section{position:absolute;display:block;top:1.8em;left:0;width:100%;max-width:100%;box-sizing:border-box;padding:10px 20px;z-index:0}article.sp-tabs section.sel-tab{box-shadow:0 3px 3px rgba(0,0,0,.1)}article.sp-tabs section .wp-shortpixel-tab-content{visibility:hidden}article.sp-tabs section.sel-tab .wp-shortpixel-tab-content{visibility:visible!important}article.sp-tabs section:first-child{z-index:1}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}#tab-stats .sp-bulk-summary{position:absolute;right:0;top:0;z-index:100}.deliverWebpAlteringTypes,.deliverWebpSettings,.deliverWebpTypes{display:none}.deliverWebpTypes .sp-notice{color:red}.deliverWebpSettings{margin:16px 0}.deliverWebpSettings input:disabled+label{color:#818181}.deliverWebpAlteringTypes,.deliverWebpTypes{margin:16px 0 16px 16px}#png2jpg:not(:checked)~#png2jpgForce,#png2jpg:not(:checked)~label[for=png2jpgForce]{display:none}article.sp-tabs section #createWebp:checked~.deliverWebpSettings,article.sp-tabs section #deliverWebp:checked~.deliverWebpTypes,article.sp-tabs section #deliverWebpAltered:checked~.deliverWebpAlteringTypes{display:block}.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}.sp-column-actions-template+.sp-column-info{display:none}
1
+ .reset{font-weight:400;font-style:normal}.shortpixel-hide{display:none}.clearfix:after,.clearfix:before{content:" ";display:table}.clearfix:after{clear:both}.clearfix{zoom:1}.resumeLabel{float:right;line-height:30px;margin-right:20px;font-size:16px}.sp-dropbtn.button{box-sizing:content-box;padding:0 5px;font-size:20px;line-height: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,.2);z-index:1}.rtl .sp-dropdown-content{right:auto;left:0}.sp-dropdown-content a{color:#000;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}.sp-notice img{vertical-align:bottom}@media(max-width:1249px){.sp-notice{margin:5px 15px 2px}}.sp-notice-info{border-left-color:#00a0d2}.sp-notice-success{border-left-color:#46b450}.sp-notice-warning{border-left-color:#f1e02a}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;position:relative;z-index:10}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}.sp-notice .bulk-error-show{cursor:pointer}.sp-notice div.bulk-error-list{background-color:#f1f1f1;padding:0 10px;display:none;max-height:200px;overflow-y:scroll}.sp-notice div.bulk-error-list ul{padding:3px 0 0;margin-top:5px}.sp-notice div.bulk-error-list ul>li:not(:last-child){border-bottom:1px solid #fff;padding-bottom:4px}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 th{width:220px}.form-table td{position:relative}div.shortpixel-rate-us{display:inline-block;margin-left:10px;vertical-align:top;font-weight:700}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:focus,div.shortpixel-rate-us>a:hover{outline:0;border-style:none}.sp-loading-small{margin-top:2px;float:left;margin-right:5px}.twentytwenty-horizontal .twentytwenty-after-label:before,.twentytwenty-horizontal .twentytwenty-before-label:before{font-family:inherit;font-size:16px}.short-pixel-bulk-page p{margin:.6em 0}.short-pixel-bulk-page form.start{display:table;content:" ";width:98%;background-color:#fff;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:700;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:700;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;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;min-height:30px;float:right}.wp-core-ui.rtl .column-wp-shortPixel .button.button-smaller,.wp-core-ui.rtl .column-wp-shortPixel .sp-column-actions{float:left}th.sortable.column-wp-shortPixel a,th.sorted.column-wp-shortPixel a{display:inline-block}.column-wp-shortPixel .sorting-indicator{display:inline-block}.wp-core-ui .bulk-play a.button .bulk-btn-img{display:inline-block;padding-top:6px}.wp-core-ui .bulk-play a.button .bulk-btn-txt{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}.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}.short-pixel-bulk-page .progress{background-color:#ecedee;height:30px;position:relative;width:60%;display:inline-block;margin-right:28px;overflow:visible}.progress .progress-img{position:absolute;top:-10px;z-index:2;margin-left:-35px;line-height:48px;font-size:22px;font-weight:700}.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:700;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:700;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:400}.bulk-slider{display:table;margin:0 auto}.bulk-slider .bulk-slide{margin:0 auto;padding-left:120px;display:inline-block;font-weight:700}.bulk-slider .img-optimized,.bulk-slider .img-original{display:inline-block;margin-right:20px;text-align:center}.bulk-slider .img-optimized div,.bulk-slider .img-original div{max-height:450px;overflow:hidden}.bulk-slider .img-optimized img,.bulk-slider .img-original 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}.shortpixel-key-valid{font-weight:700}.shortpixel-key-valid .dashicons-yes:before{font-size:2em;line-height:25px;color:#3485ba;margin-left:-20px}.shortpixel-compression .shortpixel-compression-options{color:#999}.shortpixel-compression strong{line-height:22px}.shortpixel-compression .shortpixel-compression-options{display:inline-block}.shortpixel-compression label{width:158px;margin:0 -2px;background-color:#e2faff;font-weight:700;display:inline-block}.shortpixel-compression label span{text-align:center;font-size:18px;padding:8px 0;display:block}.shortpixel-compression label input{display:none}.shortpixel-compression input:checked+span{background-color:#0085ba;color:#f7f7f7}.shortpixel-compression .shortpixel-radio-info{min-height:60px}article.sp-tabs{position:relative;display:block;width:100%;margin:2em auto}article.sp-tabs section{position:absolute;display:block;top:1.8em;left:0;width:100%;max-width:100%;box-sizing:border-box;padding:10px 20px;z-index:0}article.sp-tabs section.sel-tab{box-shadow:0 3px 3px rgba(0,0,0,.1)}article.sp-tabs section .wp-shortpixel-tab-content{visibility:hidden}article.sp-tabs section.sel-tab .wp-shortpixel-tab-content{visibility:visible!important}article.sp-tabs section:first-child{z-index:1}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}#tab-stats .sp-bulk-summary{position:absolute;right:0;top:0;z-index:100}.deliverWebpAlteringTypes,.deliverWebpSettings,.deliverWebpTypes{display:none}.deliverWebpTypes .sp-notice{color:red}.deliverWebpSettings{margin:16px 0}.deliverWebpSettings input:disabled+label{color:#818181}.deliverWebpAlteringTypes,.deliverWebpTypes{margin:16px 0 16px 16px}#png2jpg:not(:checked)~#png2jpgForce,#png2jpg:not(:checked)~label[for=png2jpgForce]{display:none}article.sp-tabs section #createWebp:checked~.deliverWebpSettings,article.sp-tabs section #deliverWebp:checked~.deliverWebpTypes,article.sp-tabs section #deliverWebpAltered:checked~.deliverWebpAlteringTypes{display:block}.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}.sp-column-actions-template+.sp-column-info{display:none}
wp-shortpixel.php CHANGED
@@ -3,9 +3,10 @@
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-settings" target="_blank">Settings &gt; ShortPixel</a> page on how to start optimizing your image library and make your website load faster.
6
- * Version: 4.20.2
7
  * Author: ShortPixel
8
  * Author URI: https://shortpixel.com
 
9
  * Text Domain: shortpixel-image-optimiser
10
  * Domain Path: /lang
11
  */
@@ -32,7 +33,7 @@ define('SHORTPIXEL_PLUGIN_DIR', __DIR__);
32
 
33
  //define('SHORTPIXEL_AFFILIATE_CODE', '');
34
 
35
- define('SHORTPIXEL_IMAGE_OPTIMISER_VERSION', "4.20.2");
36
  define('SHORTPIXEL_MAX_TIMEOUT', 10);
37
  define('SHORTPIXEL_VALIDATE_MAX_TIMEOUT', 15);
38
  define('SHORTPIXEL_BACKUP', 'ShortpixelBackups');
@@ -84,10 +85,13 @@ if (! defined('SHORTPIXEL_DEBUG'))
84
  {
85
  define('SHORTPIXEL_DEBUG', false);
86
  }
 
 
87
  $log = \ShortPixel\ShortPixelLogger\ShortPixelLogger::getInstance();
88
  if (\ShortPixel\ShortPixelLogger\ShortPixelLogger::debugIsActive())
89
  $log->setLogPath(SHORTPIXEL_BACKUP_FOLDER . "/shortpixel_log");
90
 
 
91
  /* Function to reach core function of ShortPixel
92
  * Use to get plugin url, plugin path, or certain core controllers
93
  */
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-settings" target="_blank">Settings &gt; ShortPixel</a> page on how to start optimizing your image library and make your website load faster.
6
+ * Version: 4.21.0
7
  * Author: ShortPixel
8
  * Author URI: https://shortpixel.com
9
+ * GitHub Plugin URI: https://github.com/short-pixel-optimizer/shortpixel-image-optimiser
10
  * Text Domain: shortpixel-image-optimiser
11
  * Domain Path: /lang
12
  */
33
 
34
  //define('SHORTPIXEL_AFFILIATE_CODE', '');
35
 
36
+ define('SHORTPIXEL_IMAGE_OPTIMISER_VERSION', "4.21.0");
37
  define('SHORTPIXEL_MAX_TIMEOUT', 10);
38
  define('SHORTPIXEL_VALIDATE_MAX_TIMEOUT', 15);
39
  define('SHORTPIXEL_BACKUP', 'ShortpixelBackups');
85
  {
86
  define('SHORTPIXEL_DEBUG', false);
87
  }
88
+
89
+
90
  $log = \ShortPixel\ShortPixelLogger\ShortPixelLogger::getInstance();
91
  if (\ShortPixel\ShortPixelLogger\ShortPixelLogger::debugIsActive())
92
  $log->setLogPath(SHORTPIXEL_BACKUP_FOLDER . "/shortpixel_log");
93
 
94
+
95
  /* Function to reach core function of ShortPixel
96
  * Use to get plugin url, plugin path, or certain core controllers
97
  */