Image optimization & Lazy Load by Optimole - Version 3.3.2

Version Description

Download this release

Release Info

Developer optimole
Plugin Icon 128x128 Image optimization & Lazy Load by Optimole
Version 3.3.2
Comparing to
See all releases

Code changes from version 3.3.1 to 3.3.2

CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  ##### [Version 3.3.1](https://github.com/Codeinwp/optimole-wp/compare/v3.3.0...v3.3.1) (2022-03-10)
2
 
3
  #### Features
1
+ ##### [Version 3.3.2](https://github.com/Codeinwp/optimole-wp/compare/v3.3.1...v3.3.2) (2022-03-17)
2
+
3
+ #### Fixes
4
+ * Hardening security for users with administrator roles.
5
+ * Update dependencies to the latest version.
6
+
7
  ##### [Version 3.3.1](https://github.com/Codeinwp/optimole-wp/compare/v3.3.0...v3.3.1) (2022-03-10)
8
 
9
  #### Features
inc/admin.php CHANGED
@@ -252,11 +252,11 @@ class Optml_Admin {
252
  Optml_Lazyload_Replacer::IFRAME_TEMP_COMMENT,
253
  esc_url( $domain ),
254
  $min,
255
- $bgclasses,
256
  $native_lazy_enabled ? 'true' : 'false',
257
  $scale_is_disabled ? 'true' : 'false',
258
- $watcher_classes,
259
- addcslashes( $lazyload_bg_selectors, '"' ),
260
  defined( 'OPTML_NETWORK_ON' ) && constant( 'OPTML_NETWORK_ON' ) ? ( OPTML_NETWORK_ON ? 'true' : 'false' ) : ( $default_network ? 'true' : 'false' ),
261
  $retina_ready ? 'true' : 'false',
262
  $this->settings->get_numeric_quality()
252
  Optml_Lazyload_Replacer::IFRAME_TEMP_COMMENT,
253
  esc_url( $domain ),
254
  $min,
255
+ wp_strip_all_tags( $bgclasses ),
256
  $native_lazy_enabled ? 'true' : 'false',
257
  $scale_is_disabled ? 'true' : 'false',
258
+ wp_strip_all_tags( $watcher_classes ),
259
+ addcslashes( wp_strip_all_tags( $lazyload_bg_selectors ), '"' ),
260
  defined( 'OPTML_NETWORK_ON' ) && constant( 'OPTML_NETWORK_ON' ) ? ( OPTML_NETWORK_ON ? 'true' : 'false' ) : ( $default_network ? 'true' : 'false' ),
261
  $retina_ready ? 'true' : 'false',
262
  $this->settings->get_numeric_quality()
inc/settings.php CHANGED
@@ -5,6 +5,7 @@
5
  */
6
  class Optml_Settings {
7
  use Optml_Normalizer;
 
8
  const FILTER_EXT = 'extension';
9
  const FILTER_URL = 'page_url';
10
  const FILTER_FILENAME = 'filename';
@@ -31,6 +32,12 @@ class Optml_Settings {
31
  'scale' => 'bool',
32
  'cdn' => 'bool',
33
  ];
 
 
 
 
 
 
34
  /**
35
  * Default settings schema.
36
  *
@@ -88,12 +95,6 @@ class Optml_Settings {
88
  * @var array All options.
89
  */
90
  private $options;
91
- /**
92
- * Holds the status of the auto connect hook.
93
- *
94
- * @var boolean Whether or not the auto connect action is hooked.
95
- */
96
- private static $auto_connect_hooked = false;
97
 
98
  /**
99
  * Optml_Settings constructor.
@@ -112,13 +113,13 @@ class Optml_Settings {
112
  if ( defined( 'OPTIML_USE_ENV' ) && constant( 'OPTIML_USE_ENV' ) && $this->to_boolean( constant( 'OPTIML_USE_ENV' ) ) ) {
113
 
114
  if ( defined( 'OPTIML_API_KEY' )
115
- && constant( 'OPTIML_API_KEY' ) !== ''
116
  ) {
117
  if ( ! $this->is_connected() && ! self::$auto_connect_hooked ) {
118
  self::$auto_connect_hooked = true;
119
  add_action(
120
  'plugins_loaded',
121
- [$this, 'auto_connect']
122
  );
123
  }
124
  }
@@ -141,64 +142,66 @@ class Optml_Settings {
141
  if ( $type === 'int' && ( $value === '' || (int) $value > 100 || (int) $value < 0 ) ) {
142
  continue;
143
  }
144
- $sanitized_value = ( $type === 'bool' ) ? ( $value === 'on' ? 'enabled' : 'disabled' ) : (int) $value;
145
  $this->options[ $key ] = $sanitized_value;
146
  }
147
  }
148
  }
149
  }
 
150
  /**
151
- * Auto connect action.
 
 
152
  */
153
- public function auto_connect() {
154
- $request = new WP_REST_Request( 'POST' );
155
- $request->set_param( 'api_key', constant( 'OPTIML_API_KEY' ) );
156
- Optml_Main::instance()->rest->connect( $request );
 
 
 
 
157
 
158
- remove_action( 'plugins_loaded', [ $this, 'auto_connect' ] );
159
- self::$auto_connect_hooked = false;
160
  }
 
161
  /**
162
- * Return filter definitions.
163
  *
164
- * @return mixed|null Filter values.
 
 
165
  */
166
- public function get_watchers() {
167
-
168
- return $this->get( 'watchers' );
 
169
 
 
170
  }
171
 
172
  /**
173
- * Return filter definitions.
174
  *
175
- * @return mixed|null Filter values.
 
 
176
  */
177
- public function get_filters() {
 
 
178
 
179
- $filters = $this->get( 'filters' );
180
- if ( ! isset( $filters[ self::FILTER_TYPE_LAZYLOAD ] ) ) {
181
- $filters[ self::FILTER_TYPE_LAZYLOAD ] = [];
182
- }
183
- if ( ! isset( $filters[ self::FILTER_TYPE_OPTIMIZE ] ) ) {
184
- $filters[ self::FILTER_TYPE_OPTIMIZE ] = [];
185
- }
186
- foreach ( $filters as $filter_key => $filter_rules ) {
187
- if ( ! isset( $filter_rules[ self::FILTER_EXT ] ) ) {
188
- $filters[ $filter_key ][ self::FILTER_EXT ] = [];
189
- }
190
- if ( ! isset( $filter_rules[ self::FILTER_FILENAME ] ) ) {
191
- $filters[ $filter_key ][ self::FILTER_FILENAME ] = [];
192
- }
193
- if ( ! isset( $filter_rules[ self::FILTER_URL ] ) ) {
194
- $filters[ $filter_key ][ self::FILTER_URL ] = [];
195
- }
196
- if ( ! isset( $filter_rules[ self::FILTER_CLASS ] ) ) {
197
- $filters[ $filter_key ][ self::FILTER_CLASS ] = [];
198
- }
199
- }
200
 
201
- return $filters;
 
202
  }
203
 
204
  /**
@@ -246,10 +249,10 @@ class Optml_Settings {
246
  case 'cache_buster_assets':
247
  case 'cache_buster_images':
248
  case 'cache_buster':
249
- $sanitized_value = is_string( $value ) ? $value : '';
250
  break;
251
  case 'cloud_sites':
252
- $current_sites = $this->get( 'cloud_sites' );
253
  $sanitized_value = array_replace_recursive( $current_sites, $value );
254
  if ( isset( $value['all'] ) && $value['all'] === 'true' ) {
255
  $sanitized_value = [ 'all' => 'true' ];
@@ -271,7 +274,7 @@ class Optml_Settings {
271
  }
272
  break;
273
  case 'watchers':
274
- $sanitized_value = $value;
275
  break;
276
  case 'skip_lazyload_images':
277
  $sanitized_value = $this->to_bound_integer( $value, 0, 100 );
@@ -312,6 +315,38 @@ class Optml_Settings {
312
  return $sanitized;
313
  }
314
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
  /**
316
  * Update settings.
317
  *
@@ -340,49 +375,6 @@ class Optml_Settings {
340
  return $update;
341
  }
342
 
343
- /**
344
- * Check if key is allowed.
345
- *
346
- * @param string $key Is key allowed or not.
347
- *
348
- * @return bool Is key allowed or not.
349
- */
350
- private function is_allowed( $key ) {
351
- return isset( $this->default_schema[ $key ] );
352
- }
353
-
354
- /**
355
- * Check if the user is connected to Optimole.
356
- *
357
- * @return bool Connection status.
358
- */
359
- public function is_connected() {
360
- $service_data = $this->get( 'service_data' );
361
- if ( ! isset( $service_data['cdn_key'] ) ) {
362
- return false;
363
- }
364
- if ( empty( $service_data ['cdn_key'] ) || empty( $service_data['cdn_secret'] ) ) {
365
- return false;
366
- }
367
-
368
- return true;
369
- }
370
-
371
- /**
372
- * Get setting value by key.
373
- *
374
- * @param string $key Key to search against.
375
- *
376
- * @return mixed|null Setting value.
377
- */
378
- public function get( $key ) {
379
- if ( ! $this->is_allowed( $key ) ) {
380
- return null;
381
- }
382
-
383
- return isset( $this->options[ $key ] ) ? $this->options[ $key ] : '';
384
- }
385
-
386
  /**
387
  * Return site settings.
388
  *
@@ -390,10 +382,11 @@ class Optml_Settings {
390
  */
391
  public function get_site_settings() {
392
  $service_data = $this->get( 'service_data' );
393
- $whitelist = [];
394
  if ( isset( $service_data['whitelist'] ) ) {
395
  $whitelist = $service_data['whitelist'];
396
  }
 
397
  return [
398
  'quality' => $this->get_quality(),
399
  'admin_bar_item' => $this->get( 'admin_bar_item' ),
@@ -448,6 +441,17 @@ class Optml_Settings {
448
  return $quality;
449
  }
450
 
 
 
 
 
 
 
 
 
 
 
 
451
  /**
452
  * Return an watermark array.
453
  *
@@ -498,6 +502,7 @@ class Optml_Settings {
498
  if ( isset( $service_data['status'] ) && $service_data['status'] === 'inactive' ) {
499
  return false;
500
  }
 
501
  return $this->to_boolean( $status );
502
  }
503
 
@@ -555,7 +560,7 @@ class Optml_Settings {
555
  * @return bool Reset action status.
556
  */
557
  public function reset() {
558
- $reset_schema = $this->default_schema;
559
  $reset_schema['filters'] = $this->options['filters'];
560
 
561
  $update = update_option( $this->namespace, $reset_schema );
5
  */
6
  class Optml_Settings {
7
  use Optml_Normalizer;
8
+
9
  const FILTER_EXT = 'extension';
10
  const FILTER_URL = 'page_url';
11
  const FILTER_FILENAME = 'filename';
32
  'scale' => 'bool',
33
  'cdn' => 'bool',
34
  ];
35
+ /**
36
+ * Holds the status of the auto connect hook.
37
+ *
38
+ * @var boolean Whether or not the auto connect action is hooked.
39
+ */
40
+ private static $auto_connect_hooked = false;
41
  /**
42
  * Default settings schema.
43
  *
95
  * @var array All options.
96
  */
97
  private $options;
 
 
 
 
 
 
98
 
99
  /**
100
  * Optml_Settings constructor.
113
  if ( defined( 'OPTIML_USE_ENV' ) && constant( 'OPTIML_USE_ENV' ) && $this->to_boolean( constant( 'OPTIML_USE_ENV' ) ) ) {
114
 
115
  if ( defined( 'OPTIML_API_KEY' )
116
+ && constant( 'OPTIML_API_KEY' ) !== ''
117
  ) {
118
  if ( ! $this->is_connected() && ! self::$auto_connect_hooked ) {
119
  self::$auto_connect_hooked = true;
120
  add_action(
121
  'plugins_loaded',
122
+ [ $this, 'auto_connect' ]
123
  );
124
  }
125
  }
142
  if ( $type === 'int' && ( $value === '' || (int) $value > 100 || (int) $value < 0 ) ) {
143
  continue;
144
  }
145
+ $sanitized_value = ( $type === 'bool' ) ? ( $value === 'on' ? 'enabled' : 'disabled' ) : (int) $value;
146
  $this->options[ $key ] = $sanitized_value;
147
  }
148
  }
149
  }
150
  }
151
+
152
  /**
153
+ * Check if the user is connected to Optimole.
154
+ *
155
+ * @return bool Connection status.
156
  */
157
+ public function is_connected() {
158
+ $service_data = $this->get( 'service_data' );
159
+ if ( ! isset( $service_data['cdn_key'] ) ) {
160
+ return false;
161
+ }
162
+ if ( empty( $service_data ['cdn_key'] ) || empty( $service_data['cdn_secret'] ) ) {
163
+ return false;
164
+ }
165
 
166
+ return true;
 
167
  }
168
+
169
  /**
170
+ * Get setting value by key.
171
  *
172
+ * @param string $key Key to search against.
173
+ *
174
+ * @return mixed|null Setting value.
175
  */
176
+ public function get( $key ) {
177
+ if ( ! $this->is_allowed( $key ) ) {
178
+ return null;
179
+ }
180
 
181
+ return isset( $this->options[ $key ] ) ? $this->options[ $key ] : '';
182
  }
183
 
184
  /**
185
+ * Check if key is allowed.
186
  *
187
+ * @param string $key Is key allowed or not.
188
+ *
189
+ * @return bool Is key allowed or not.
190
  */
191
+ private function is_allowed( $key ) {
192
+ return isset( $this->default_schema[ $key ] );
193
+ }
194
 
195
+ /**
196
+ * Auto connect action.
197
+ */
198
+ public function auto_connect() {
199
+ $request = new WP_REST_Request( 'POST' );
200
+ $request->set_param( 'api_key', constant( 'OPTIML_API_KEY' ) );
201
+ Optml_Main::instance()->rest->connect( $request );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
202
 
203
+ remove_action( 'plugins_loaded', [ $this, 'auto_connect' ] );
204
+ self::$auto_connect_hooked = false;
205
  }
206
 
207
  /**
249
  case 'cache_buster_assets':
250
  case 'cache_buster_images':
251
  case 'cache_buster':
252
+ $sanitized_value = is_string( $value ) ? sanitize_text_field( $value ) : '';
253
  break;
254
  case 'cloud_sites':
255
+ $current_sites = $this->get( 'cloud_sites' );
256
  $sanitized_value = array_replace_recursive( $current_sites, $value );
257
  if ( isset( $value['all'] ) && $value['all'] === 'true' ) {
258
  $sanitized_value = [ 'all' => 'true' ];
274
  }
275
  break;
276
  case 'watchers':
277
+ $sanitized_value = sanitize_text_field( $value );
278
  break;
279
  case 'skip_lazyload_images':
280
  $sanitized_value = $this->to_bound_integer( $value, 0, 100 );
315
  return $sanitized;
316
  }
317
 
318
+ /**
319
+ * Return filter definitions.
320
+ *
321
+ * @return mixed|null Filter values.
322
+ */
323
+ public function get_filters() {
324
+
325
+ $filters = $this->get( 'filters' );
326
+ if ( ! isset( $filters[ self::FILTER_TYPE_LAZYLOAD ] ) ) {
327
+ $filters[ self::FILTER_TYPE_LAZYLOAD ] = [];
328
+ }
329
+ if ( ! isset( $filters[ self::FILTER_TYPE_OPTIMIZE ] ) ) {
330
+ $filters[ self::FILTER_TYPE_OPTIMIZE ] = [];
331
+ }
332
+ foreach ( $filters as $filter_key => $filter_rules ) {
333
+ if ( ! isset( $filter_rules[ self::FILTER_EXT ] ) ) {
334
+ $filters[ $filter_key ][ self::FILTER_EXT ] = [];
335
+ }
336
+ if ( ! isset( $filter_rules[ self::FILTER_FILENAME ] ) ) {
337
+ $filters[ $filter_key ][ self::FILTER_FILENAME ] = [];
338
+ }
339
+ if ( ! isset( $filter_rules[ self::FILTER_URL ] ) ) {
340
+ $filters[ $filter_key ][ self::FILTER_URL ] = [];
341
+ }
342
+ if ( ! isset( $filter_rules[ self::FILTER_CLASS ] ) ) {
343
+ $filters[ $filter_key ][ self::FILTER_CLASS ] = [];
344
+ }
345
+ }
346
+
347
+ return $filters;
348
+ }
349
+
350
  /**
351
  * Update settings.
352
  *
375
  return $update;
376
  }
377
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
378
  /**
379
  * Return site settings.
380
  *
382
  */
383
  public function get_site_settings() {
384
  $service_data = $this->get( 'service_data' );
385
+ $whitelist = [];
386
  if ( isset( $service_data['whitelist'] ) ) {
387
  $whitelist = $service_data['whitelist'];
388
  }
389
+
390
  return [
391
  'quality' => $this->get_quality(),
392
  'admin_bar_item' => $this->get( 'admin_bar_item' ),
441
  return $quality;
442
  }
443
 
444
+ /**
445
+ * Return filter definitions.
446
+ *
447
+ * @return mixed|null Filter values.
448
+ */
449
+ public function get_watchers() {
450
+
451
+ return $this->get( 'watchers' );
452
+
453
+ }
454
+
455
  /**
456
  * Return an watermark array.
457
  *
502
  if ( isset( $service_data['status'] ) && $service_data['status'] === 'inactive' ) {
503
  return false;
504
  }
505
+
506
  return $this->to_boolean( $status );
507
  }
508
 
560
  * @return bool Reset action status.
561
  */
562
  public function reset() {
563
+ $reset_schema = $this->default_schema;
564
  $reset_schema['filters'] = $this->options['filters'];
565
 
566
  $update = update_option( $this->namespace, $reset_schema );
optimole-wp.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Image optimization service by Optimole
4
  * Description: Complete handling of your website images.
5
- * Version: 3.3.1
6
  * Author: Optimole
7
  * Author URI: https://optimole.com
8
  * License: GPL-2.0+
@@ -74,7 +74,7 @@ function optml() {
74
  }
75
  define( 'OPTML_URL', plugin_dir_url( __FILE__ ) );
76
  define( 'OPTML_PATH', plugin_dir_path( __FILE__ ) );
77
- define( 'OPTML_VERSION', '3.3.1' );
78
  define( 'OPTML_NAMESPACE', 'optml' );
79
  define( 'OPTML_BASEFILE', __FILE__ );
80
  // Fallback for old PHP versions when this constant is not defined.
2
  /**
3
  * Plugin Name: Image optimization service by Optimole
4
  * Description: Complete handling of your website images.
5
+ * Version: 3.3.2
6
  * Author: Optimole
7
  * Author URI: https://optimole.com
8
  * License: GPL-2.0+
74
  }
75
  define( 'OPTML_URL', plugin_dir_url( __FILE__ ) );
76
  define( 'OPTML_PATH', plugin_dir_path( __FILE__ ) );
77
+ define( 'OPTML_VERSION', '3.3.2' );
78
  define( 'OPTML_NAMESPACE', 'optml' );
79
  define( 'OPTML_BASEFILE', __FILE__ );
80
  // Fallback for old PHP versions when this constant is not defined.
readme.txt CHANGED
@@ -94,10 +94,19 @@ Premium users will be able to optimize images starting with more than 25k monthl
94
 
95
  == Changelog ==
96
 
 
 
 
 
 
 
 
 
 
97
  ##### [Version 3.3.1](https://github.com/Codeinwp/optimole-wp/compare/v3.3.0...v3.3.1) (2022-03-10)
98
 
99
  #### Features
100
- - Adds filter, , for more control over which images are converted to AVIF, by default SVG images are not converted
101
  #### Fixes
102
  - Plugin interface header display size on safari
103
 
94
 
95
  == Changelog ==
96
 
97
+ ##### [Version 3.3.2](https://github.com/Codeinwp/optimole-wp/compare/v3.3.1...v3.3.2) (2022-03-17)
98
+
99
+ #### Fixes
100
+ * Hardening security for users with administrator roles.
101
+ * Update dependencies to the latest version.
102
+
103
+
104
+
105
+
106
  ##### [Version 3.3.1](https://github.com/Codeinwp/optimole-wp/compare/v3.3.0...v3.3.1) (2022-03-10)
107
 
108
  #### Features
109
+ - Adds filter, <code>optml_should_avif_ext</code> , for more control over which images are converted to AVIF, by default SVG images are not converted
110
  #### Fixes
111
  - Plugin interface header display size on safari
112
 
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitc0fb08c4a2921d5726fbcc1edceda3b1::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitb72e45d3fd937e66590f56c1effc6e43::getLoader();
vendor/codeinwp/themeisle-sdk/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ##### [Version 3.2.21](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.20...v3.2.21) (2021-06-30)
2
 
3
  review and improve compatibility with auto-updates on custom updates endpoint
1
+ ##### [Version 3.2.24](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.23...v3.2.24) (2022-02-09)
2
+
3
+ Fix edge case issue on dismiss
4
+ Avoid issues with open_basedir restrictions
5
+
6
+ ##### [Version 3.2.23](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.22...v3.2.23) (2022-02-02)
7
+
8
+ Fix php 8.1 issues
9
+ Fix edge case when update_themes site transient was empty and a fatal error was thrown
10
+
11
+ ##### [Version 3.2.22](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.21...v3.2.22) (2021-10-27)
12
+
13
+ Fix edge case when reset failed checks was not working properly
14
+
15
  ##### [Version 3.2.21](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.20...v3.2.21) (2021-06-30)
16
 
17
  review and improve compatibility with auto-updates on custom updates endpoint
vendor/codeinwp/themeisle-sdk/load.php CHANGED
@@ -14,7 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) {
14
  return;
15
  }
16
  // Current SDK version and path.
17
- $themeisle_sdk_version = '3.2.21';
18
  $themeisle_sdk_path = dirname( __FILE__ );
19
 
20
  global $themeisle_sdk_max_version;
@@ -24,16 +24,17 @@ global $themeisle_sdk_max_path;
24
  $themeisle_sdk_relative_licenser_path = '/src/Modules/Licenser.php';
25
 
26
  global $themeisle_sdk_abs_licenser_path;
27
- if ( ! is_file( $themeisle_sdk_path . $themeisle_sdk_relative_licenser_path ) && is_file( $themeisle_sdk_max_path . $themeisle_sdk_relative_licenser_path ) ) {
28
  $themeisle_sdk_abs_licenser_path = $themeisle_sdk_max_path . $themeisle_sdk_relative_licenser_path;
29
  add_filter( 'themeisle_sdk_required_files', 'themeisle_sdk_load_licenser_if_present' );
30
  }
31
- if ( version_compare( $themeisle_sdk_version, $themeisle_sdk_max_path ) == 0 &&
 
32
  apply_filters( 'themeisle_sdk_should_overwrite_path', false, $themeisle_sdk_path, $themeisle_sdk_max_path ) ) {
33
  $themeisle_sdk_max_path = $themeisle_sdk_path;
34
  }
35
 
36
- if ( version_compare( $themeisle_sdk_version, $themeisle_sdk_max_version ) > 0 ) {
37
  $themeisle_sdk_max_version = $themeisle_sdk_version;
38
  $themeisle_sdk_max_path = $themeisle_sdk_path;
39
  }
14
  return;
15
  }
16
  // Current SDK version and path.
17
+ $themeisle_sdk_version = '3.2.24';
18
  $themeisle_sdk_path = dirname( __FILE__ );
19
 
20
  global $themeisle_sdk_max_version;
24
  $themeisle_sdk_relative_licenser_path = '/src/Modules/Licenser.php';
25
 
26
  global $themeisle_sdk_abs_licenser_path;
27
+ if ( ! is_file( $themeisle_sdk_path . $themeisle_sdk_relative_licenser_path ) && ! empty( $themeisle_sdk_max_path ) && is_file( $themeisle_sdk_max_path . $themeisle_sdk_relative_licenser_path ) ) {
28
  $themeisle_sdk_abs_licenser_path = $themeisle_sdk_max_path . $themeisle_sdk_relative_licenser_path;
29
  add_filter( 'themeisle_sdk_required_files', 'themeisle_sdk_load_licenser_if_present' );
30
  }
31
+
32
+ if ( ( is_null( $themeisle_sdk_max_path ) || version_compare( $themeisle_sdk_version, $themeisle_sdk_max_path ) == 0 ) &&
33
  apply_filters( 'themeisle_sdk_should_overwrite_path', false, $themeisle_sdk_path, $themeisle_sdk_max_path ) ) {
34
  $themeisle_sdk_max_path = $themeisle_sdk_path;
35
  }
36
 
37
+ if ( is_null( $themeisle_sdk_max_version ) || version_compare( $themeisle_sdk_version, $themeisle_sdk_max_version ) > 0 ) {
38
  $themeisle_sdk_max_version = $themeisle_sdk_version;
39
  $themeisle_sdk_max_path = $themeisle_sdk_path;
40
  }
vendor/codeinwp/themeisle-sdk/src/Modules/Licenser.php CHANGED
@@ -30,7 +30,7 @@ class Licenser extends Abstract_Module {
30
  *
31
  * @var int $max_failed Maximum failed checks allowed before show the notice
32
  */
33
- private static $max_failed = 5;
34
  /**
35
  * License key string.
36
  *
@@ -244,7 +244,7 @@ class Licenser extends Abstract_Module {
244
  */
245
  public function get_distributor_name() {
246
  if ( $this->is_from_partner( $this->product ) ) {
247
- return 'ThemeIsle';
248
  }
249
 
250
  return $this->product->get_store_name();
@@ -281,7 +281,7 @@ class Licenser extends Abstract_Module {
281
  $status = $this->get_license_status( true );
282
  $no_activations_string = apply_filters( $this->product->get_key() . '_lc_no_activations_string', 'No more activations left for %s. You need to upgrade your plan in order to use %s on more websites. If you need assistance, please get in touch with %s staff.' );
283
  $no_valid_string = apply_filters( $this->product->get_key() . '_lc_no_valid_string', 'In order to benefit from updates and support for %s, please add your license code from your <a href="%s" target="_blank">purchase history</a> and validate it <a href="%s">here</a>. ' );
284
- $expired_license_string = apply_filters( $this->product->get_key() . '_lc_expired_string', 'Your %s License Key has expired. In order to continue receiving support and software updates you must <a href="%s" target="_blank">renew</a> your license key.' );
285
  // No activations left for this license.
286
  if ( 'valid' != $status && $this->check_activation() ) {
287
  ?>
@@ -413,26 +413,22 @@ class Licenser extends Abstract_Module {
413
 
414
  if ( is_wp_error( $response ) ) {
415
  $license_data = new \stdClass();
416
- $license_data->license = 'valid';
417
  } else {
418
  $license_data = $response;
419
  }
420
 
421
  $license_old = get_option( $this->product->get_key() . '_license_data', '' );
422
-
423
- if ( 'valid' === $license_old->license && ( $license_data->license !== $license_old->license ) ) {
424
  $this->increment_failed_checks();
425
- } else {
426
- $this->reset_failed_checks();
427
- }
428
 
429
- if ( $this->failed_checks <= self::$max_failed ) {
430
  return $license_old;
431
  }
432
 
433
  if ( ! isset( $license_data->key ) ) {
434
  $license_data->key = isset( $license_old->key ) ? $license_old->key : '';
435
  }
 
436
 
437
  return $license_data;
438
 
@@ -633,10 +629,19 @@ class Licenser extends Abstract_Module {
633
  */
634
  public function theme_update_transient( $value ) {
635
  $update_data = $this->check_for_update();
636
- if ( $update_data ) {
637
- $value->response[ $this->product->get_slug() ] = $update_data;
 
 
 
 
 
 
 
 
638
  }
639
 
 
640
  return $value;
641
  }
642
 
30
  *
31
  * @var int $max_failed Maximum failed checks allowed before show the notice
32
  */
33
+ private static $max_failed = 2;
34
  /**
35
  * License key string.
36
  *
244
  */
245
  public function get_distributor_name() {
246
  if ( $this->is_from_partner( $this->product ) ) {
247
+ return 'Themeisle';
248
  }
249
 
250
  return $this->product->get_store_name();
281
  $status = $this->get_license_status( true );
282
  $no_activations_string = apply_filters( $this->product->get_key() . '_lc_no_activations_string', 'No more activations left for %s. You need to upgrade your plan in order to use %s on more websites. If you need assistance, please get in touch with %s staff.' );
283
  $no_valid_string = apply_filters( $this->product->get_key() . '_lc_no_valid_string', 'In order to benefit from updates and support for %s, please add your license code from your <a href="%s" target="_blank">purchase history</a> and validate it <a href="%s">here</a>. ' );
284
+ $expired_license_string = apply_filters( $this->product->get_key() . '_lc_expired_string', 'Your %s\'s License Key has expired. In order to continue receiving support and software updates you must <a href="%s" target="_blank">renew</a> your license key.' );
285
  // No activations left for this license.
286
  if ( 'valid' != $status && $this->check_activation() ) {
287
  ?>
413
 
414
  if ( is_wp_error( $response ) ) {
415
  $license_data = new \stdClass();
416
+ $license_data->license = 'invalid';
417
  } else {
418
  $license_data = $response;
419
  }
420
 
421
  $license_old = get_option( $this->product->get_key() . '_license_data', '' );
422
+ if ( 'valid' === $license_old->license && ( $license_data->license !== $license_old->license ) && $this->failed_checks <= self::$max_failed ) {
 
423
  $this->increment_failed_checks();
 
 
 
424
 
 
425
  return $license_old;
426
  }
427
 
428
  if ( ! isset( $license_data->key ) ) {
429
  $license_data->key = isset( $license_old->key ) ? $license_old->key : '';
430
  }
431
+ $this->reset_failed_checks();
432
 
433
  return $license_data;
434
 
629
  */
630
  public function theme_update_transient( $value ) {
631
  $update_data = $this->check_for_update();
632
+ if ( empty( $value ) ) {
633
+ return $value;
634
+ }
635
+
636
+ if ( ! isset( $value->response ) ) {
637
+ return $value;
638
+ }
639
+
640
+ if ( ! $update_data ) {
641
+ return $value;
642
  }
643
 
644
+ $value->response[ $this->product->get_slug() ] = $update_data;
645
  return $value;
646
  }
647
 
vendor/codeinwp/themeisle-sdk/src/Modules/Notification.php CHANGED
@@ -269,8 +269,9 @@ class Notification extends Abstract_Module {
269
  ],
270
  ];
271
  $notification_details = wp_parse_args( $notification_details, $default );
272
-
273
- $notification_html = '<div class="notice notice-success is-dismissible themeisle-sdk-notice" data-notification-id="' . esc_attr( $notification_details['id'] ) . '" id="' . esc_attr( $notification_details['id'] ) . '-notification"> <div class="themeisle-sdk-notification-box">';
 
274
 
275
  if ( ! empty( $notification_details['heading'] ) ) {
276
  $notification_html .= sprintf( '<h4>%s</h4>', wp_kses_post( $notification_details['heading'] ) );
@@ -343,16 +344,18 @@ class Notification extends Abstract_Module {
343
  'nonce': '<?php echo esc_attr( wp_create_nonce( (string) __CLASS__ ) ); ?>',
344
  'action': 'themeisle_sdk_dismiss_notice',
345
  'id': notification_id,
346
- 'confirm': confirm
347
- }
348
- );
 
 
349
  if (confirm === 'yes') {
350
  $(this).trigger('themeisle-sdk:confirmed');
351
  } else {
352
  $(this).trigger('themeisle-sdk:canceled');
353
  }
354
  container.hide();
355
- if (link.attr('href') === '#') {
356
  return false;
357
  }
358
  });
@@ -383,6 +386,31 @@ class Notification extends Abstract_Module {
383
  do_action( $id . '_process_confirm', $confirm );
384
  wp_send_json( [] );
385
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
386
 
387
  /**
388
  * Check if we should load the notification module.
@@ -456,6 +484,7 @@ class Notification extends Abstract_Module {
456
  self::$notifications = $notifications;
457
  add_action( 'admin_notices', array( __CLASS__, 'show_notification' ) );
458
  add_action( 'wp_ajax_themeisle_sdk_dismiss_notice', array( __CLASS__, 'dismiss' ) );
 
459
  add_action( 'admin_head', array( __CLASS__, 'setup_notifications' ) );
460
 
461
  return $this;
269
  ],
270
  ];
271
  $notification_details = wp_parse_args( $notification_details, $default );
272
+ global $pagenow;
273
+ $notification_details['ctas']['cancel']['link'] = wp_nonce_url( add_query_arg( [ 'nid' => $notification_details['id'] ], admin_url( $pagenow ) ), $notification_details['id'], 'tsdk_dismiss_nonce' );
274
+ $notification_html = '<div class="notice notice-success is-dismissible themeisle-sdk-notice" data-notification-id="' . esc_attr( $notification_details['id'] ) . '" id="' . esc_attr( $notification_details['id'] ) . '-notification"> <div class="themeisle-sdk-notification-box">';
275
 
276
  if ( ! empty( $notification_details['heading'] ) ) {
277
  $notification_html .= sprintf( '<h4>%s</h4>', wp_kses_post( $notification_details['heading'] ) );
344
  'nonce': '<?php echo esc_attr( wp_create_nonce( (string) __CLASS__ ) ); ?>',
345
  'action': 'themeisle_sdk_dismiss_notice',
346
  'id': notification_id,
347
+ 'confirm': confirm,
348
+ },
349
+ ).fail(function() {
350
+ location.href = encodeURI(link.attr('href'));
351
+ });
352
  if (confirm === 'yes') {
353
  $(this).trigger('themeisle-sdk:confirmed');
354
  } else {
355
  $(this).trigger('themeisle-sdk:canceled');
356
  }
357
  container.hide();
358
+ if (confirm === 'no' || link.attr('href') === '#') {
359
  return false;
360
  }
361
  });
386
  do_action( $id . '_process_confirm', $confirm );
387
  wp_send_json( [] );
388
  }
389
+ /**
390
+ * Dismiss the notification.
391
+ */
392
+ public static function dismiss_get() {
393
+ $is_nonce_dismiss = sanitize_text_field( isset( $_GET['tsdk_dismiss_nonce'] ) ? $_GET['tsdk_dismiss_nonce'] : '' );
394
+ if ( strlen( $is_nonce_dismiss ) < 5 ) {
395
+ return;
396
+ }
397
+ $id = sanitize_text_field( isset( $_GET['nid'] ) ? $_GET['nid'] : '' );
398
+ if ( empty( $id ) ) {
399
+ return;
400
+ }
401
+ $nonce = wp_verify_nonce( sanitize_text_field( $_GET['tsdk_dismiss_nonce'] ), $id );
402
+ if ( $nonce !== 1 ) {
403
+ return;
404
+ }
405
+ $ids = wp_list_pluck( self::$notifications, 'id' );
406
+ if ( ! in_array( $id, $ids, true ) ) {
407
+ return;
408
+ }
409
+ $confirm = 'no';
410
+ self::set_last_active_notification_timestamp();
411
+ update_option( $id, $confirm );
412
+ do_action( $id . '_process_confirm', $confirm );
413
+ }
414
 
415
  /**
416
  * Check if we should load the notification module.
484
  self::$notifications = $notifications;
485
  add_action( 'admin_notices', array( __CLASS__, 'show_notification' ) );
486
  add_action( 'wp_ajax_themeisle_sdk_dismiss_notice', array( __CLASS__, 'dismiss' ) );
487
+ add_action( 'admin_head', array( __CLASS__, 'dismiss_get' ) );
488
  add_action( 'admin_head', array( __CLASS__, 'setup_notifications' ) );
489
 
490
  return $this;
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitc0fb08c4a2921d5726fbcc1edceda3b1
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInitc0fb08c4a2921d5726fbcc1edceda3b1
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInitc0fb08c4a2921d5726fbcc1edceda3b1', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
27
- spl_autoload_unregister(array('ComposerAutoloaderInitc0fb08c4a2921d5726fbcc1edceda3b1', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Composer\Autoload\ComposerStaticInitc0fb08c4a2921d5726fbcc1edceda3b1::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
@@ -51,12 +51,12 @@ class ComposerAutoloaderInitc0fb08c4a2921d5726fbcc1edceda3b1
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
- $includeFiles = Composer\Autoload\ComposerStaticInitc0fb08c4a2921d5726fbcc1edceda3b1::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
- composerRequirec0fb08c4a2921d5726fbcc1edceda3b1($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
@@ -68,7 +68,7 @@ class ComposerAutoloaderInitc0fb08c4a2921d5726fbcc1edceda3b1
68
  * @param string $file
69
  * @return void
70
  */
71
- function composerRequirec0fb08c4a2921d5726fbcc1edceda3b1($fileIdentifier, $file)
72
  {
73
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
74
  $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitb72e45d3fd937e66590f56c1effc6e43
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInitb72e45d3fd937e66590f56c1effc6e43', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
27
+ spl_autoload_unregister(array('ComposerAutoloaderInitb72e45d3fd937e66590f56c1effc6e43', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Composer\Autoload\ComposerStaticInitb72e45d3fd937e66590f56c1effc6e43::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
+ $includeFiles = Composer\Autoload\ComposerStaticInitb72e45d3fd937e66590f56c1effc6e43::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
+ composerRequireb72e45d3fd937e66590f56c1effc6e43($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
68
  * @param string $file
69
  * @return void
70
  */
71
+ function composerRequireb72e45d3fd937e66590f56c1effc6e43($fileIdentifier, $file)
72
  {
73
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
74
  $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInitc0fb08c4a2921d5726fbcc1edceda3b1
8
  {
9
  public static $files = array (
10
  '9fef4034ed73e26a337d9856ea126f7f' => __DIR__ . '/..' . '/codeinwp/themeisle-sdk/load.php',
@@ -17,7 +17,7 @@ class ComposerStaticInitc0fb08c4a2921d5726fbcc1edceda3b1
17
  public static function getInitializer(ClassLoader $loader)
18
  {
19
  return \Closure::bind(function () use ($loader) {
20
- $loader->classMap = ComposerStaticInitc0fb08c4a2921d5726fbcc1edceda3b1::$classMap;
21
 
22
  }, null, ClassLoader::class);
23
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitb72e45d3fd937e66590f56c1effc6e43
8
  {
9
  public static $files = array (
10
  '9fef4034ed73e26a337d9856ea126f7f' => __DIR__ . '/..' . '/codeinwp/themeisle-sdk/load.php',
17
  public static function getInitializer(ClassLoader $loader)
18
  {
19
  return \Closure::bind(function () use ($loader) {
20
+ $loader->classMap = ComposerStaticInitb72e45d3fd937e66590f56c1effc6e43::$classMap;
21
 
22
  }, null, ClassLoader::class);
23
  }
vendor/composer/installed.json CHANGED
@@ -2,23 +2,23 @@
2
  "packages": [
3
  {
4
  "name": "codeinwp/themeisle-sdk",
5
- "version": "3.2.21",
6
- "version_normalized": "3.2.21.0",
7
  "source": {
8
  "type": "git",
9
  "url": "https://github.com/Codeinwp/themeisle-sdk.git",
10
- "reference": "cafd016b61ec0928c0234e312046782a77c14318"
11
  },
12
  "dist": {
13
  "type": "zip",
14
- "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/cafd016b61ec0928c0234e312046782a77c14318",
15
- "reference": "cafd016b61ec0928c0234e312046782a77c14318",
16
  "shasum": ""
17
  },
18
  "require-dev": {
19
  "codeinwp/phpcs-ruleset": "dev-main"
20
  },
21
- "time": "2021-06-30T10:55:18+00:00",
22
  "type": "library",
23
  "installation-source": "dist",
24
  "notification-url": "https://packagist.org/downloads/",
@@ -39,7 +39,7 @@
39
  ],
40
  "support": {
41
  "issues": "https://github.com/Codeinwp/themeisle-sdk/issues",
42
- "source": "https://github.com/Codeinwp/themeisle-sdk/tree/v3.2.21"
43
  },
44
  "install-path": "../codeinwp/themeisle-sdk"
45
  }
2
  "packages": [
3
  {
4
  "name": "codeinwp/themeisle-sdk",
5
+ "version": "3.2.24",
6
+ "version_normalized": "3.2.24.0",
7
  "source": {
8
  "type": "git",
9
  "url": "https://github.com/Codeinwp/themeisle-sdk.git",
10
+ "reference": "e5c171e33120fdf8ce6dd3a7bddad984583023f0"
11
  },
12
  "dist": {
13
  "type": "zip",
14
+ "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/e5c171e33120fdf8ce6dd3a7bddad984583023f0",
15
+ "reference": "e5c171e33120fdf8ce6dd3a7bddad984583023f0",
16
  "shasum": ""
17
  },
18
  "require-dev": {
19
  "codeinwp/phpcs-ruleset": "dev-main"
20
  },
21
+ "time": "2022-02-09T21:11:37+00:00",
22
  "type": "library",
23
  "installation-source": "dist",
24
  "notification-url": "https://packagist.org/downloads/",
39
  ],
40
  "support": {
41
  "issues": "https://github.com/Codeinwp/themeisle-sdk/issues",
42
+ "source": "https://github.com/Codeinwp/themeisle-sdk/tree/v3.2.24"
43
  },
44
  "install-path": "../codeinwp/themeisle-sdk"
45
  }
vendor/composer/installed.php CHANGED
@@ -20,12 +20,12 @@
20
  'dev_requirement' => false,
21
  ),
22
  'codeinwp/themeisle-sdk' => array(
23
- 'pretty_version' => '3.2.21',
24
- 'version' => '3.2.21.0',
25
  'type' => 'library',
26
  'install_path' => __DIR__ . '/../codeinwp/themeisle-sdk',
27
  'aliases' => array(),
28
- 'reference' => 'cafd016b61ec0928c0234e312046782a77c14318',
29
  'dev_requirement' => false,
30
  ),
31
  ),
20
  'dev_requirement' => false,
21
  ),
22
  'codeinwp/themeisle-sdk' => array(
23
+ 'pretty_version' => '3.2.24',
24
+ 'version' => '3.2.24.0',
25
  'type' => 'library',
26
  'install_path' => __DIR__ . '/../codeinwp/themeisle-sdk',
27
  'aliases' => array(),
28
+ 'reference' => 'e5c171e33120fdf8ce6dd3a7bddad984583023f0',
29
  'dev_requirement' => false,
30
  ),
31
  ),