ShortPixel Image Optimizer - Version 4.8.1

Version Description

  • fix notice that would not dismiss
Download this release

Release Info

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

Code changes from version 4.8.0 to 4.8.1

class/db/wp-shortpixel-media-library-adapter.php CHANGED
@@ -173,11 +173,6 @@ class WpShortPixelMediaLbraryAdapter {
173
 
174
  }
175
 
176
- if( false && $totalFilesThis < $processedFilesThis) {
177
- echo(" <br>ID: {$file->post_id} {$file->meta_key} SIZESCOUNT: $sizesCount ". ($isProcessed ? "isProcessed" : "")
178
- ." TOTAL: $totalFiles PROCESSED: $processedTotalFiles TOTAL FILES THIS: $totalFilesThis PROCESSED THIS $processedFilesThis ");
179
- }
180
-
181
  $dt = new DateTime($idInfo->idDates[$file->post_id]);
182
  if($dt > $month1) {
183
  $totalFilesM1 += $totalFilesThis;
173
 
174
  }
175
 
 
 
 
 
 
176
  $dt = new DateTime($idInfo->idDates[$file->post_id]);
177
  if($dt > $month1) {
178
  $totalFilesM1 += $totalFilesThis;
class/wp-short-pixel.php CHANGED
@@ -196,7 +196,6 @@ class WPShortPixel {
196
 
197
  public function displayAdminNotices() {
198
  $dismissed = $this->_settings->dismissedNotices ? $this->_settings->dismissedNotices : array();
199
- unset($dismissed['unlisted']); //reset a specific notice
200
  $this->_settings->dismissedNotices = $dismissed;
201
 
202
  if(!$this->_settings->verifiedKey) {
@@ -209,22 +208,24 @@ class WPShortPixel {
209
  if( ($now > $act + 7200) && !isset($dismissed['2h'])) {
210
  ShortPixelView::displayActivationNotice('2h');
211
  } else if( ($now > $act + 72 * 3600) && !isset($dismissed['3d'])) {
212
- ShortPixelView::displayActivationNotice('3d');
213
  }
214
  }
215
  if(!isset($dismissed['compat'])) {
216
  $conflictPlugins = self::getConflictingPlugins();
217
  if(count($conflictPlugins)) {
218
  ShortPixelView::displayActivationNotice('compat', $conflictPlugins);
 
219
  }
220
  }
221
  if( !isset($dismissed['unlisted']) && !$this->_settings->optimizeUnlisted
222
  && isset($this->_settings->currentStats['foundUnlistedThumbs']) && $this->_settings->currentStats['foundUnlistedThumbs']) {
223
  ShortPixelView::displayActivationNotice('unlisted', $this->_settings->currentStats['foundUnlistedThumbs']);
224
-
225
  }
226
  //if(false)
227
- if(!is_array($this->_settings->currentStats) || isset($_GET['checkquota'])) {
 
228
  $this->getQuotaInformation();
229
  }
230
  if($this->_settings->verifiedKey
@@ -235,13 +236,13 @@ class WPShortPixel {
235
  $quotaData = $stats;
236
 
237
  //this is for bulk page - alert on the total credits for total images
238
- if( $screen && $screen->id == 'media_page_wp-short-pixel-bulk' && $this->bulkUpgradeNeeded($stats)) {
239
  //looks like the user hasn't got enough credits to bulk process all media library
240
  ShortPixelView::displayActivationNotice('upgbulk', array('filesTodo' => $stats['totalFiles'] - $stats['totalProcessedFiles'],
241
  'quotaAvailable' => $quotaData['APICallsQuotaNumeric'] + $quotaData['APICallsQuotaOneTimeNumeric'] - $quotaData['APICallsMadeNumeric'] - $quotaData['APICallsMadeOneTimeNumeric']));
242
  }
243
  //consider the monthly plus 1/6 of the available one-time credits.
244
- elseif($this->monthlyUpgradeNeeded($stats)) {
245
  //looks like the user hasn't got enough credits to process the monthly images, display a notice telling this
246
  ShortPixelView::displayActivationNotice('upgmonth', array('monthAvg' => $this->getMonthAvg($stats), 'monthlyQuota' => $quotaData['APICallsQuotaNumeric']));
247
  }
196
 
197
  public function displayAdminNotices() {
198
  $dismissed = $this->_settings->dismissedNotices ? $this->_settings->dismissedNotices : array();
 
199
  $this->_settings->dismissedNotices = $dismissed;
200
 
201
  if(!$this->_settings->verifiedKey) {
208
  if( ($now > $act + 7200) && !isset($dismissed['2h'])) {
209
  ShortPixelView::displayActivationNotice('2h');
210
  } else if( ($now > $act + 72 * 3600) && !isset($dismissed['3d'])) {
211
+ ShortPixelView::displayActivationNotice('3d');
212
  }
213
  }
214
  if(!isset($dismissed['compat'])) {
215
  $conflictPlugins = self::getConflictingPlugins();
216
  if(count($conflictPlugins)) {
217
  ShortPixelView::displayActivationNotice('compat', $conflictPlugins);
218
+ return;
219
  }
220
  }
221
  if( !isset($dismissed['unlisted']) && !$this->_settings->optimizeUnlisted
222
  && isset($this->_settings->currentStats['foundUnlistedThumbs']) && $this->_settings->currentStats['foundUnlistedThumbs']) {
223
  ShortPixelView::displayActivationNotice('unlisted', $this->_settings->currentStats['foundUnlistedThumbs']);
224
+ return;
225
  }
226
  //if(false)
227
+ $currentStats = $this->_settings->currentStats;
228
+ if(!is_array($currentStats) || isset($_GET['checkquota']) || isset($currentStats["quotaData"])) {
229
  $this->getQuotaInformation();
230
  }
231
  if($this->_settings->verifiedKey
236
  $quotaData = $stats;
237
 
238
  //this is for bulk page - alert on the total credits for total images
239
+ if( !isset($dismissed['upgbulk']) && $screen && $screen->id == 'media_page_wp-short-pixel-bulk' && $this->bulkUpgradeNeeded($stats)) {
240
  //looks like the user hasn't got enough credits to bulk process all media library
241
  ShortPixelView::displayActivationNotice('upgbulk', array('filesTodo' => $stats['totalFiles'] - $stats['totalProcessedFiles'],
242
  'quotaAvailable' => $quotaData['APICallsQuotaNumeric'] + $quotaData['APICallsQuotaOneTimeNumeric'] - $quotaData['APICallsMadeNumeric'] - $quotaData['APICallsMadeOneTimeNumeric']));
243
  }
244
  //consider the monthly plus 1/6 of the available one-time credits.
245
+ elseif(!isset($dismissed['upgmonth']) && $this->monthlyUpgradeNeeded($stats)) {
246
  //looks like the user hasn't got enough credits to process the monthly images, display a notice telling this
247
  ShortPixelView::displayActivationNotice('upgmonth', array('monthAvg' => $this->getMonthAvg($stats), 'monthlyQuota' => $quotaData['APICallsQuotaNumeric']));
248
  }
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.8
6
  Requires PHP: 5.3
7
- Stable tag: 4.8.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -228,6 +228,9 @@ The ShortPixel team is here to help. <a href="https://shortpixel.com/contact">Co
228
 
229
  == Changelog ==
230
 
 
 
 
231
  = 4.8.0 =
232
  * propose best plans options for optimizing all images
233
  * option to optimize or not the found unlisted thumbs, alert the user about them.
@@ -235,9 +238,11 @@ The ShortPixel team is here to help. <a href="https://shortpixel.com/contact">Co
235
  * fix compatbility problem with S3 Offload which caused sending two different sets of URLs for an image.
236
  * trim site_url output - found a client case where it ended with a tab...
237
  * all wp_options with autoload=no
 
238
  * minify all js and css files
239
  * performance improvements for the picture tag generation
240
  * retina versions of the icons
 
241
  * fix "Optimize 0 thumbnails" in column menu generated from Javascript.
242
 
243
  = 4.7.2 =
4
  Requires at least: 3.2.0
5
  Tested up to: 4.8
6
  Requires PHP: 5.3
7
+ Stable tag: 4.8.1
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.1 =
232
+ * fix notice that would not dismiss
233
+
234
  = 4.8.0 =
235
  * propose best plans options for optimizing all images
236
  * option to optimize or not the found unlisted thumbs, alert the user about them.
238
  * fix compatbility problem with S3 Offload which caused sending two different sets of URLs for an image.
239
  * trim site_url output - found a client case where it ended with a tab...
240
  * all wp_options with autoload=no
241
+ * subscribe and get the API Key directly from the plugin
242
  * minify all js and css files
243
  * performance improvements for the picture tag generation
244
  * retina versions of the icons
245
+ * fix compatibility with PHP 5.3 for using class:: inside closures
246
  * fix "Optimize 0 thumbnails" in column menu generated from Javascript.
247
 
248
  = 4.7.2 =
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.0
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.0");
22
  define('SHORTPIXEL_MAX_TIMEOUT', 10);
23
  define('SHORTPIXEL_VALIDATE_MAX_TIMEOUT', 15);
24
  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" 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.1
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.1");
22
  define('SHORTPIXEL_MAX_TIMEOUT', 10);
23
  define('SHORTPIXEL_VALIDATE_MAX_TIMEOUT', 15);
24
  define('SHORTPIXEL_BACKUP', 'ShortpixelBackups');