ShortPixel Image Optimizer - Version 4.22.2

Version Description

Release date May 12th, 2021 * Fix: the Bulk screen reflects better the extra credits used for WebP and/or AVIF creation; * Language: 1 new string added, 0 updated, 0 fuzzed, and 0 obsoleted.

Download this release

Release Info

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

Code changes from version 4.22.1 to 4.22.2

class/view/shortpixel_view.php CHANGED
@@ -77,15 +77,22 @@ class ShortPixelView {
77
  $averageCompression, $filesOptimized, $savedSpace, $percent, $customCount) {
78
  $settings = $this->ctrl->getSettings();
79
  //$this->ctrl->outputHSBeacon();
80
- \ShortPixel\HelpScout::outputBeacon();
81
 
82
  $this->bulkType = $this->ctrl->getPrioQ()->getBulkTypeForDisplay(); // adding to the mess
83
  $hider = ($this->bulkType == ShortPixelQueue::BULK_TYPE_RESTORE) ? 'sp-hidden' : '';
 
 
 
 
 
 
 
84
  ?>
85
  <div class="wrap short-pixel-bulk-page">
86
  <h1><?php _e('Bulk Image Optimization by ShortPixel','shortpixel-image-optimiser');?></h1>
87
  <?php
88
- if ( !$bulkRan ) {
89
  ?>
90
  <div class="sp-notice sp-notice-info sp-floating-block sp-full-width">
91
  <form class='start' action='' method='POST' id='startBulk'>
@@ -108,6 +115,7 @@ class ShortPixelView {
108
  <input name="createWebp" type="checkbox" id="createWebp" value="1" <?php checked( $settings->createWebp, "1" );?> >
109
  <label for="createWebp">
110
  <?php _e('Also create <a href="https://blog.shortpixel.com/how-webp-images-can-speed-up-your-site/" target="_blank">WebP versions</a> of the images, with the additional cost of 1 credit = 1 image or thumbnail..','shortpixel-image-optimiser');?>
 
111
  </label>
112
 
113
  </div><br>
@@ -117,6 +125,7 @@ class ShortPixelView {
117
  <input name="createAvif" type="checkbox" id="createAvif" value="1" <?php checked( $settings->createAvif, "1" );?> >
118
  <label for="createAvif">
119
  <?php _e('Also create <a href="https://blog.shortpixel.com/what-is-avif-and-why-is-it-good/" target="_blank">AVIF versions</a> of the images, with the additional cost of 1 credit = 1 image or thumbnail.','shortpixel-image-optimiser');?>
 
120
  </label>
121
 
122
  </div><br>
@@ -336,6 +345,8 @@ class ShortPixelView {
336
  $todo = true;
337
  $mainNotProcessed = max(0, $quotaData['mainFiles'] - $quotaData['mainProcessedFiles']);
338
  $thumbsNotProcessed = max(0, ($quotaData['totalFiles'] - $quotaData['mainFiles']) - ($quotaData['totalProcessedFiles'] - $quotaData['mainProcessedFiles']));
 
 
339
  ?>
340
  <p>
341
  <?php
@@ -449,6 +460,7 @@ class ShortPixelView {
449
  <input name="createWebp" type="checkbox" id="createWebp" value="1" <?php checked( $settings->createWebp, "1" );?> >
450
  <label for="createWebp">
451
  <?php _e('Also create <a href="https://blog.shortpixel.com/how-webp-images-can-speed-up-your-site/" target="_blank">WebP versions</a> of the images, with the additional cost of 1 credit = 1 image or thumbnail..','shortpixel-image-optimiser');?>
 
452
  </label>
453
 
454
  </div><br>
@@ -458,6 +470,7 @@ class ShortPixelView {
458
  <input name="createAvif" type="checkbox" id="createAvif" value="1" <?php checked( $settings->createAvif, "1" );?> >
459
  <label for="createAvif">
460
  <?php _e('Also create <a href="https://blog.shortpixel.com/what-is-avif-and-why-is-it-good/" target="_blank">AVIF versions</a> of the images, with the additional cost of 1 credit = 1 image or thumbnail.','shortpixel-image-optimiser');?>
 
461
  </label>
462
 
463
  </div><br>
77
  $averageCompression, $filesOptimized, $savedSpace, $percent, $customCount) {
78
  $settings = $this->ctrl->getSettings();
79
  //$this->ctrl->outputHSBeacon();
80
+ //\ShortPixel\HelpScout::outputBeacon();
81
 
82
  $this->bulkType = $this->ctrl->getPrioQ()->getBulkTypeForDisplay(); // adding to the mess
83
  $hider = ($this->bulkType == ShortPixelQueue::BULK_TYPE_RESTORE) ? 'sp-hidden' : '';
84
+
85
+ $mainNotProcessed = max(0, $quotaData['mainFiles'] - $quotaData['mainProcessedFiles']);
86
+ $thumbsNotProcessed = max(0, ($quotaData['totalFiles'] - $quotaData['mainFiles']) - ($quotaData['totalProcessedFiles'] - $quotaData['mainProcessedFiles']));
87
+
88
+
89
+ $creditsForImageTypes = $quotaData['totalFiles'] - $quotaData['totalProcessedFiles']; //
90
+ $extraCost = "&nbsp;<strong>" . sprintf(__('An additional %s credits will be used when active', 'shortpixel-image-optimiser'),$creditsForImageTypes) . "</strong>";
91
  ?>
92
  <div class="wrap short-pixel-bulk-page">
93
  <h1><?php _e('Bulk Image Optimization by ShortPixel','shortpixel-image-optimiser');?></h1>
94
  <?php
95
+ if ( ! $bulkRan ) {
96
  ?>
97
  <div class="sp-notice sp-notice-info sp-floating-block sp-full-width">
98
  <form class='start' action='' method='POST' id='startBulk'>
115
  <input name="createWebp" type="checkbox" id="createWebp" value="1" <?php checked( $settings->createWebp, "1" );?> >
116
  <label for="createWebp">
117
  <?php _e('Also create <a href="https://blog.shortpixel.com/how-webp-images-can-speed-up-your-site/" target="_blank">WebP versions</a> of the images, with the additional cost of 1 credit = 1 image or thumbnail..','shortpixel-image-optimiser');?>
118
+ <?php echo $extraCost ?>
119
  </label>
120
 
121
  </div><br>
125
  <input name="createAvif" type="checkbox" id="createAvif" value="1" <?php checked( $settings->createAvif, "1" );?> >
126
  <label for="createAvif">
127
  <?php _e('Also create <a href="https://blog.shortpixel.com/what-is-avif-and-why-is-it-good/" target="_blank">AVIF versions</a> of the images, with the additional cost of 1 credit = 1 image or thumbnail.','shortpixel-image-optimiser');?>
128
+ <?php echo $extraCost ?>
129
  </label>
130
 
131
  </div><br>
345
  $todo = true;
346
  $mainNotProcessed = max(0, $quotaData['mainFiles'] - $quotaData['mainProcessedFiles']);
347
  $thumbsNotProcessed = max(0, ($quotaData['totalFiles'] - $quotaData['mainFiles']) - ($quotaData['totalProcessedFiles'] - $quotaData['mainProcessedFiles']));
348
+
349
+
350
  ?>
351
  <p>
352
  <?php
460
  <input name="createWebp" type="checkbox" id="createWebp" value="1" <?php checked( $settings->createWebp, "1" );?> >
461
  <label for="createWebp">
462
  <?php _e('Also create <a href="https://blog.shortpixel.com/how-webp-images-can-speed-up-your-site/" target="_blank">WebP versions</a> of the images, with the additional cost of 1 credit = 1 image or thumbnail..','shortpixel-image-optimiser');?>
463
+ <?php echo $extraCost ?>
464
  </label>
465
 
466
  </div><br>
470
  <input name="createAvif" type="checkbox" id="createAvif" value="1" <?php checked( $settings->createAvif, "1" );?> >
471
  <label for="createAvif">
472
  <?php _e('Also create <a href="https://blog.shortpixel.com/what-is-avif-and-why-is-it-good/" target="_blank">AVIF versions</a> of the images, with the additional cost of 1 credit = 1 image or thumbnail.','shortpixel-image-optimiser');?>
473
+ <?php echo $extraCost ?>
474
  </label>
475
 
476
  </div><br>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: convert webp, optimize images, image optimization, resize, compressor, ima
4
  Requires at least: 4.2.0
5
  Tested up to: 5.7
6
  Requires PHP: 5.3
7
- Stable tag: 4.22.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -314,6 +314,11 @@ Alternatively, you can use this filter in your theme's functions.php file:
314
 
315
  == Changelog ==
316
 
 
 
 
 
 
317
  = 4.22.1 =
318
  Release date May 5th, 2021
319
  * Fix: undefined variable notice;
4
  Requires at least: 4.2.0
5
  Tested up to: 5.7
6
  Requires PHP: 5.3
7
+ Stable tag: 4.22.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
314
 
315
  == Changelog ==
316
 
317
+ = 4.22.2 =
318
+ Release date May 12th, 2021
319
+ * Fix: the Bulk screen reflects better the extra credits used for WebP and/or AVIF creation;
320
+ * Language: 1 new string added, 0 updated, 0 fuzzed, and 0 obsoleted.
321
+
322
  = 4.22.1 =
323
  Release date May 5th, 2021
324
  * Fix: undefined variable notice;
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-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.22.1
7
  * Author: ShortPixel
8
  * Author URI: https://shortpixel.com
9
  * GitHub Plugin URI: https://github.com/short-pixel-optimizer/shortpixel-image-optimiser
@@ -33,7 +33,7 @@ define('SHORTPIXEL_PLUGIN_DIR', __DIR__);
33
 
34
  //define('SHORTPIXEL_AFFILIATE_CODE', '');
35
 
36
- define('SHORTPIXEL_IMAGE_OPTIMISER_VERSION', "4.22.1");
37
  define('SHORTPIXEL_MAX_TIMEOUT', 10);
38
  define('SHORTPIXEL_VALIDATE_MAX_TIMEOUT', 15);
39
  define('SHORTPIXEL_BACKUP', 'ShortpixelBackups');
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.22.2
7
  * Author: ShortPixel
8
  * Author URI: https://shortpixel.com
9
  * GitHub Plugin URI: https://github.com/short-pixel-optimizer/shortpixel-image-optimiser
33
 
34
  //define('SHORTPIXEL_AFFILIATE_CODE', '');
35
 
36
+ define('SHORTPIXEL_IMAGE_OPTIMISER_VERSION', "4.22.2");
37
  define('SHORTPIXEL_MAX_TIMEOUT', 10);
38
  define('SHORTPIXEL_VALIDATE_MAX_TIMEOUT', 15);
39
  define('SHORTPIXEL_BACKUP', 'ShortpixelBackups');