ShortPixel Image Optimizer - Version 4.16.4

Version Description

Release date: 26th March 2020 * Fix for some notices that could not be dismissed * Fix for "Confirm new credits" notification * 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.16.4
Comparing to
See all releases

Code changes from version 4.16.3 to 4.16.4

build/shortpixel/notices/src/NoticeModel.php CHANGED
@@ -179,7 +179,7 @@ class NoticeModel //extends ShortPixelModel
179
 
180
  // $data_string = "{action:'$this->notice_action'}";
181
 
182
- $js = "jQuery(document).on('click','#$this->id button .notice-dismiss',
183
  function() {
184
  var data = $data;
185
  var url = $url;
179
 
180
  // $data_string = "{action:'$this->notice_action'}";
181
 
182
+ $js = "jQuery(document).on('click','#$this->id button.notice-dismiss',
183
  function() {
184
  var data = $data;
185
  var url = $url;
class/controller/adminnotices_controller.php CHANGED
@@ -26,6 +26,8 @@ class adminNoticesController extends ShortPixelController
26
  const MSG_NO_APIKEY_REPEAT = 'ApiNotice301'; // First Repeat.
27
  const MSG_NO_APIKEY_REPEAT_LONG = 'ApiNotice302'; // Last Repeat.
28
 
 
 
29
  public function __construct()
30
  {
31
  add_action('admin_notices', array($this, 'check_admin_notices'), 5); // run before the plugin admin notices
@@ -59,6 +61,11 @@ class adminNoticesController extends ShortPixelController
59
  Notices::removeNoticeBYID(self::MSG_QUOTA_REACHED);
60
  }
61
 
 
 
 
 
 
62
  /** ReInstates A Persistent Notice manually */
63
  public static function reInstateQuotaExceeded()
64
  {
@@ -78,9 +85,24 @@ class adminNoticesController extends ShortPixelController
78
  $this->doUnlistedNotices();
79
  $this->doQuotaNotices();
80
 
 
81
  }
82
 
83
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  /** Load the various messages about the lack of API-keys in the plugin */
85
  protected function doAPINotices()
86
  {
26
  const MSG_NO_APIKEY_REPEAT = 'ApiNotice301'; // First Repeat.
27
  const MSG_NO_APIKEY_REPEAT_LONG = 'ApiNotice302'; // Last Repeat.
28
 
29
+ const MSG_INTEGRATION_NGGALLERY = 'IntNotice400';
30
+
31
  public function __construct()
32
  {
33
  add_action('admin_notices', array($this, 'check_admin_notices'), 5); // run before the plugin admin notices
61
  Notices::removeNoticeBYID(self::MSG_QUOTA_REACHED);
62
  }
63
 
64
+ public static function resetIntegrationNotices()
65
+ {
66
+ Notices::removeNoticeByID(self::MSG_INTEGRATION_NGGALLERY);
67
+ }
68
+
69
  /** ReInstates A Persistent Notice manually */
70
  public static function reInstateQuotaExceeded()
71
  {
85
  $this->doUnlistedNotices();
86
  $this->doQuotaNotices();
87
 
88
+ //$this->doIntegrationNotices();
89
  }
90
 
91
 
92
+ protected function doIntegrationNotices()
93
+ {
94
+ $settings= \wpSPIO()->settings();
95
+
96
+ if (\wpSPIO()->env()->has_nextgen && ! $settings->includeNextGen )
97
+ {
98
+ $url = admin_url('options-general.php?page=wp-shortpixel-settings&part=adv-settings');
99
+ $message = sprintf(__('It seems you are using NextGen Gallery. You can optimize your galleries with ShortPixel, but this is currently not enabled. To enable, %sgo to settings and enable%s it!', 'shortpixel_image_optimiser'), '<a href="' . $url . '">', '</a>');
100
+ $notice = Notices::addNormal($message);
101
+ Notices::makePersistent($notice, self::MSG_INTEGRATION_NGGALLERY, YEAR_IN_SECONDS);
102
+ }
103
+
104
+ }
105
+
106
  /** Load the various messages about the lack of API-keys in the plugin */
107
  protected function doAPINotices()
108
  {
class/controller/settings.php CHANGED
@@ -115,6 +115,9 @@ class SettingsController extends shortPixelController
115
  $nextgen = new NextGen();
116
  $previous = $this->model->includeNextGen;
117
  $nextgen->nextGenEnabled($previous);
 
 
 
118
  }
119
 
120
  $check_key = false;
115
  $nextgen = new NextGen();
116
  $previous = $this->model->includeNextGen;
117
  $nextgen->nextGenEnabled($previous);
118
+
119
+ // Reset any integration notices when updating settings.
120
+ adminNoticesController::resetIntegrationNotices();
121
  }
122
 
123
  $check_key = false;
class/view/shortpixel_view.php CHANGED
@@ -618,7 +618,7 @@ class ShortPixelView {
618
  <span class='icon' style="margin-right: 25px;"><img src="<?php echo(wpSPIO()->plugin_url('res/img/robo-winky.png' ));?>" ></span>
619
  <span class='content'>
620
  <p><?php _e('After you optimized all your images your site speed might still be improved. Allow ShortPixel Specialists to tell you how.', 'shortpixel-image-optimiser'); ?><p>
621
- <p style='font-size: 16px;'><a href="https://shortpixel.com/lp/wso/" target="_blank" style='font-weight: 700;'><?php _e('Get Your Site Assessment','shortpixel-image-optimiser'); ?></a></p>
622
  </span>
623
  </div>
624
  </div>
618
  <span class='icon' style="margin-right: 25px;"><img src="<?php echo(wpSPIO()->plugin_url('res/img/robo-winky.png' ));?>" ></span>
619
  <span class='content'>
620
  <p><?php _e('After you optimized all your images your site speed might still be improved. Allow ShortPixel Specialists to tell you how.', 'shortpixel-image-optimiser'); ?><p>
621
+ <p style='font-size: 16px;'><a href="https://shortpixel.com/lp/wso/?utm_source=SPIO" target="_blank" style='font-weight: 700;'><?php _e('Get Your Site Assessment','shortpixel-image-optimiser'); ?></a></p>
622
  </span>
623
  </div>
624
  </div>
class/wp-short-pixel.php CHANGED
@@ -3582,6 +3582,8 @@ class WPShortPixel {
3582
  public function resetQuotaExceeded() {
3583
  if( $this->_settings->quotaExceeded == 1) {
3584
  $dismissed = $this->_settings->dismissedNotices ? $this->_settings->dismissedNotices : array();
 
 
3585
  unset($dismissed['exceed']);
3586
  $this->_settings->prioritySkip = array();
3587
  $this->_settings->dismissedNotices = $dismissed;
3582
  public function resetQuotaExceeded() {
3583
  if( $this->_settings->quotaExceeded == 1) {
3584
  $dismissed = $this->_settings->dismissedNotices ? $this->_settings->dismissedNotices : array();
3585
+ ShortPixel\adminNoticesController::resetAPINotices();
3586
+ ShortPixel\adminNoticesController::resetQuotaNotices();
3587
  unset($dismissed['exceed']);
3588
  $this->_settings->prioritySkip = array();
3589
  $this->_settings->dismissedNotices = $dismissed;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: compressor, image, compression, optimize, image optimizer, image optimiser
4
  Requires at least: 3.2.0
5
  Tested up to: 5.3
6
  Requires PHP: 5.3
7
- Stable tag: 4.16.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -281,6 +281,13 @@ Hide the Cloudflare settings by defining these constants in wp-config.php:
281
 
282
  == Changelog ==
283
 
 
 
 
 
 
 
 
284
  = 4.16.3 =
285
 
286
  Release date: 9th March 2020
4
  Requires at least: 3.2.0
5
  Tested up to: 5.3
6
  Requires PHP: 5.3
7
+ Stable tag: 4.16.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
281
 
282
  == Changelog ==
283
 
284
+ = 4.16.4 =
285
+
286
+ Release date: 26th March 2020
287
+ * Fix for some notices that could not be dismissed
288
+ * Fix for "Confirm new credits" notification
289
+ * Language – 0 new strings added, 0 updated, 0 fuzzied, and 0 obsoleted
290
+
291
  = 4.16.3 =
292
 
293
  Release date: 9th March 2020
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.16.3
7
  * Author: ShortPixel
8
  * Author URI: https://shortpixel.com
9
  * Text Domain: shortpixel-image-optimiser
@@ -19,7 +19,7 @@ define('SHORTPIXEL_PLUGIN_DIR', __DIR__);
19
 
20
  //define('SHORTPIXEL_AFFILIATE_CODE', '');
21
 
22
- define('SHORTPIXEL_IMAGE_OPTIMISER_VERSION', "4.16.3");
23
  define('SHORTPIXEL_MAX_TIMEOUT', 10);
24
  define('SHORTPIXEL_VALIDATE_MAX_TIMEOUT', 15);
25
  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.16.4
7
  * Author: ShortPixel
8
  * Author URI: https://shortpixel.com
9
  * Text Domain: shortpixel-image-optimiser
19
 
20
  //define('SHORTPIXEL_AFFILIATE_CODE', '');
21
 
22
+ define('SHORTPIXEL_IMAGE_OPTIMISER_VERSION', "4.16.4");
23
  define('SHORTPIXEL_MAX_TIMEOUT', 10);
24
  define('SHORTPIXEL_VALIDATE_MAX_TIMEOUT', 15);
25
  define('SHORTPIXEL_BACKUP', 'ShortpixelBackups');