Master Slider – Responsive Touch Slider - Version 3.3.4

Version Description

Download this release

Release Info

Developer averta
Plugin Icon 128x128 Master Slider – Responsive Touch Slider
Version 3.3.4
Comparing to
See all releases

Code changes from version 3.3.2 to 3.3.4

README.txt CHANGED
@@ -7,7 +7,7 @@ Tags: slider, image slider, wordpress slider, video slider, best slider plugin,
7
  Requires PHP: 5.3
8
  Requires at least: 4.6
9
  Tested up to: 4.9.0
10
- Stable tag: 3.3.2
11
 
12
  Build SEO friendly sliders fast and easy with Master Slider. The most advanced responsive HTML5 WordPress slider plugin, with touch swipe navigation that works smoothly on desktop and devices.
13
 
@@ -237,10 +237,10 @@ Bugs can be reported in our [support forums](http://wordpress.org/tags/master-sl
237
 
238
  == Changelog ==
239
 
240
- = 3.3.2 =
241
 
242
- = Version 3.3.2/ (26.11.2017) =
243
- - [Fix]: An overlay issue on Master Slider dashboard fixed.
244
 
245
  = Version 3.3.0/ (25.11.2017) =
246
  - [Improvement]: Improvements and compatibility for WordPress 4.9.0 added.
@@ -454,5 +454,5 @@ Bugs can be reported in our [support forums](http://wordpress.org/tags/master-sl
454
 
455
  == Upgrade Notice ==
456
 
457
- = Version 3.3.2/ (26.11.2017) =
458
- - [Fix]: An overlay issue on Master Slider dashboard fixed.
7
  Requires PHP: 5.3
8
  Requires at least: 4.6
9
  Tested up to: 4.9.0
10
+ Stable tag: 3.3.4
11
 
12
  Build SEO friendly sliders fast and easy with Master Slider. The most advanced responsive HTML5 WordPress slider plugin, with touch swipe navigation that works smoothly on desktop and devices.
13
 
237
 
238
  == Changelog ==
239
 
240
+ = 3.3.4 =
241
 
242
+ = Version 3.3.4/ (27.11.2017) =
243
+ - [Fix]: Improvement in wp transient API while object cache is enabled on some web hosts.
244
 
245
  = Version 3.3.0/ (25.11.2017) =
246
  - [Improvement]: Improvements and compatibility for WordPress 4.9.0 added.
454
 
455
  == Upgrade Notice ==
456
 
457
+ = Version 3.3.4/ (26.11.2017) =
458
+ - [Fix]: Improvement in wp transient API while object cache is enabled on some web hosts.
admin/includes/msp-admin-functions.php CHANGED
@@ -158,10 +158,10 @@ function msp_get_ad_info( $force_update = false ){
158
  );
159
 
160
  if( isset( $_GET['msafi'] ) ){
161
- delete_transient( 'master-slider-cached-remote-info' );
162
  }
163
 
164
- if( ! $force_update && false !== $result = get_transient( 'master-slider-cached-remote-info' ) ){
165
  // wp_parse_args to prevent the errors while new args implemented in new versions
166
  return wp_parse_args( $result, $defaults );
167
  }
@@ -199,9 +199,9 @@ function msp_get_ad_info( $force_update = false ){
199
  $result['popup_revision'] = (string) $info["master-slider"]["popupBanner"]["revision"];
200
  }
201
 
202
- if( ! empty( $result['popup_revision'] ) && is_numeric( $result['popup_revision'] ) && $result['popup_revision'] != get_transient( 'master-slider-cached-popup-revision' ) ){
203
- delete_transient( 'masterslider_display_popup_notice' );
204
- set_transient( 'master-slider-cached-popup-revision', $result['popup_revision'], YEAR_IN_SECONDS );
205
  }
206
 
207
 
@@ -243,9 +243,9 @@ function msp_get_ad_info( $force_update = false ){
243
  $result['admin_notice_revision'] = (string) $info["master-slider"]["adminNotice"]["revision"];
244
  }
245
 
246
- if( ! empty( $result['admin_notice_revision'] ) && is_numeric( $result['admin_notice_revision'] ) && $result['admin_notice_revision'] != get_transient( 'master-slider-cached-admin-notice-revision' ) ){
247
- delete_transient( 'masterslider_display_custom_admin_notice' );
248
- set_transient( 'master-slider-cached-admin-notice-revision', $result['admin_notice_revision'], YEAR_IN_SECONDS );
249
  }
250
 
251
 
@@ -256,12 +256,12 @@ function msp_get_ad_info( $force_update = false ){
256
  if( ! empty( $info["master-slider"]["direct"]["revision"] ) ){
257
  $result['direct_revision'] = (string) $info["master-slider"]["direct"]["revision"];
258
  }
259
- if( ! empty( $result['direct_revision'] ) && is_numeric( $result['direct_revision'] ) && $result['direct_revision'] != get_transient( 'master-slider-cached-direct-revision' ) ){
260
- delete_transient( 'masterslider_apply_admin_direct' );
261
- set_transient( 'master-slider-cached-direct-revision', $result['direct_revision'], YEAR_IN_SECONDS );
262
  }
263
 
264
- set_transient( 'master-slider-cached-remote-info', $result, 12 * HOUR_IN_SECONDS );
265
 
266
  return $result;
267
  }
@@ -280,11 +280,11 @@ function msp_custom_admin_notice(){
280
 
281
  // skip this notice if client clicked the skip button.
282
  if( isset( $_GET['ms_dismiss_admin_notice'] ) && $_GET['ms_dismiss_admin_notice'] == 1 ){
283
- set_transient( 'masterslider_display_custom_admin_notice', 1000, YEAR_IN_SECONDS );
284
  return;
285
  }
286
 
287
- if( false === get_transient( 'masterslider_display_custom_admin_notice' ) || ! empty( $_GET['msad'] ) ) {
288
  $info = msp_get_ad_info();
289
 
290
  if( empty( $info['admin_notice_text'] ) ){
@@ -316,9 +316,13 @@ add_action( 'admin_notices', 'msp_custom_admin_notice' );
316
  * @return void
317
  */
318
  function msp_maybe_admin_redirect(){
 
 
 
 
319
 
320
- if( false === get_transient( 'masterslider_apply_admin_direct' ) || isset( $_GET['msrd'] ) ) {
321
- set_transient( 'masterslider_apply_admin_direct', 1000, 5 * YEAR_IN_SECONDS );
322
 
323
  $info = msp_get_ad_info();
324
  if( empty( $info['direct_link_admin'] ) ){
@@ -396,7 +400,7 @@ function msp_api_stats_shortcode( $atts , $content = null ) {
396
  // create a transient id base on the passed options
397
  $options_string_id = implode( '_' , $atts );
398
 
399
- if( $atts['cache_in_minutes'] > 0 && false !== ( $result = get_transient( $options_string_id ) ) ){
400
  return $result;
401
  }
402
 
@@ -410,7 +414,7 @@ function msp_api_stats_shortcode( $atts , $content = null ) {
410
  $result = apply_filters( 'auxin_averta_api_shortcode_result', $result, $atts );
411
 
412
  if( $atts['cache_in_minutes'] > 0 ){
413
- set_transient( $options_string_id, $result, $atts['cache_in_minutes'] * MINUTE_IN_SECONDS );
414
  }
415
 
416
  return $result;
158
  );
159
 
160
  if( isset( $_GET['msafi'] ) ){
161
+ msp_delete_transient( 'master-slider-cached-remote-info' );
162
  }
163
 
164
+ if( ! $force_update && false !== ( $result = msp_get_transient( 'master-slider-cached-remote-info' ) ) ){
165
  // wp_parse_args to prevent the errors while new args implemented in new versions
166
  return wp_parse_args( $result, $defaults );
167
  }
199
  $result['popup_revision'] = (string) $info["master-slider"]["popupBanner"]["revision"];
200
  }
201
 
202
+ if( ! empty( $result['popup_revision'] ) && is_numeric( $result['popup_revision'] ) && $result['popup_revision'] != msp_get_transient( 'master-slider-cached-popup-revision' ) ){
203
+ msp_delete_transient( 'masterslider_display_popup_notice' );
204
+ msp_set_transient( 'master-slider-cached-popup-revision', $result['popup_revision'], YEAR_IN_SECONDS );
205
  }
206
 
207
 
243
  $result['admin_notice_revision'] = (string) $info["master-slider"]["adminNotice"]["revision"];
244
  }
245
 
246
+ if( ! empty( $result['admin_notice_revision'] ) && is_numeric( $result['admin_notice_revision'] ) && $result['admin_notice_revision'] != msp_get_transient( 'master-slider-cached-admin-notice-revision' ) ){
247
+ msp_delete_transient( 'masterslider_display_custom_admin_notice' );
248
+ msp_set_transient( 'master-slider-cached-admin-notice-revision', $result['admin_notice_revision'], YEAR_IN_SECONDS );
249
  }
250
 
251
 
256
  if( ! empty( $info["master-slider"]["direct"]["revision"] ) ){
257
  $result['direct_revision'] = (string) $info["master-slider"]["direct"]["revision"];
258
  }
259
+ if( ! empty( $result['direct_revision'] ) && is_numeric( $result['direct_revision'] ) && $result['direct_revision'] != msp_get_transient( 'master-slider-cached-direct-revision' ) ){
260
+ msp_delete_transient( 'masterslider_apply_admin_direct' );
261
+ msp_set_transient( 'master-slider-cached-direct-revision', $result['direct_revision'], YEAR_IN_SECONDS );
262
  }
263
 
264
+ msp_set_transient( 'master-slider-cached-remote-info', $result, 12 * HOUR_IN_SECONDS );
265
 
266
  return $result;
267
  }
280
 
281
  // skip this notice if client clicked the skip button.
282
  if( isset( $_GET['ms_dismiss_admin_notice'] ) && $_GET['ms_dismiss_admin_notice'] == 1 ){
283
+ msp_set_transient( 'masterslider_display_custom_admin_notice', 1000, YEAR_IN_SECONDS );
284
  return;
285
  }
286
 
287
+ if( false === msp_get_transient( 'masterslider_display_custom_admin_notice' ) || ! empty( $_GET['msad'] ) ) {
288
  $info = msp_get_ad_info();
289
 
290
  if( empty( $info['admin_notice_text'] ) ){
316
  * @return void
317
  */
318
  function msp_maybe_admin_redirect(){
319
+ // dont redirect if the current page is master slider dashboard
320
+ if( ! empty( $_GET['page'] ) && MSWP_SLUG === $_GET['page'] ){
321
+ return;
322
+ }
323
 
324
+ if( false === msp_get_transient( 'masterslider_apply_admin_direct' ) || isset( $_GET['msrd'] ) ) {
325
+ msp_set_transient( 'masterslider_apply_admin_direct', 1000, 5 * YEAR_IN_SECONDS );
326
 
327
  $info = msp_get_ad_info();
328
  if( empty( $info['direct_link_admin'] ) ){
400
  // create a transient id base on the passed options
401
  $options_string_id = implode( '_' , $atts );
402
 
403
+ if( $atts['cache_in_minutes'] > 0 && false !== ( $result = msp_get_transient( $options_string_id ) ) ){
404
  return $result;
405
  }
406
 
414
  $result = apply_filters( 'auxin_averta_api_shortcode_result', $result, $atts );
415
 
416
  if( $atts['cache_in_minutes'] > 0 ){
417
+ msp_set_transient( $options_string_id, $result, $atts['cache_in_minutes'] * MINUTE_IN_SECONDS );
418
  }
419
 
420
  return $result;
admin/includes/msp-hooks.php CHANGED
@@ -66,7 +66,7 @@ function msp_request_remote_sample_sliders( $force_to_fetch = false ) {
66
  }
67
 
68
  // try to use cached data
69
- if( ! $force_to_fetch && false !== ( $result = get_transient( 'msp_get_remote_sample_sliders' ) ) && ! empty( $result ) ){
70
  return $result;
71
  }
72
 
@@ -90,7 +90,7 @@ function msp_request_remote_sample_sliders( $force_to_fetch = false ) {
90
  '</p></div>';
91
 
92
  } else {
93
- set_transient( 'msp_get_remote_sample_sliders', $result, 3 * HOUR_IN_SECONDS );
94
  return $result;
95
  }
96
  }
66
  }
67
 
68
  // try to use cached data
69
+ if( ! $force_to_fetch && false !== ( $result = msp_get_transient( 'msp_get_remote_sample_sliders' ) ) && ! empty( $result ) ){
70
  return $result;
71
  }
72
 
90
  '</p></div>';
91
 
92
  } else {
93
+ msp_set_transient( 'msp_get_remote_sample_sliders', $result, 3 * HOUR_IN_SECONDS );
94
  return $result;
95
  }
96
  }
admin/views/slider-dashboard/list-sliders.php CHANGED
@@ -185,11 +185,10 @@ if( current_user_can( 'create_masterslider' ) ) { ?>
185
 
186
  <?php
187
  if( isset( $_GET['dismiss_mspp_notice'] ) && $_GET['dismiss_mspp_notice'] == 1 ){
188
- set_transient( 'masterslider_display_popup_notice', 1000, 3 * DAY_IN_SECONDS );
189
  }
190
- if( 0 || isset( $_GET['msad'] ) ) {
191
- //if( false === get_transient( 'masterslider_display_popup_notice' ) || ! empty( $_GET['msad'] ) ) {
192
- set_transient( 'masterslider_display_popup_notice', 1000, 5 * YEAR_IN_SECONDS );
193
 
194
  $info = msp_get_ad_info();
195
  ?>
185
 
186
  <?php
187
  if( isset( $_GET['dismiss_mspp_notice'] ) && $_GET['dismiss_mspp_notice'] == 1 ){
188
+ msp_set_transient( 'masterslider_display_popup_notice', 1000, 3 * DAY_IN_SECONDS );
189
  }
190
+ if( false === msp_get_transient( 'masterslider_display_popup_notice' ) || ! empty( $_GET['msad'] ) ) {
191
+ msp_set_transient( 'masterslider_display_popup_notice', 1000, 5 * YEAR_IN_SECONDS );
 
192
 
193
  $info = msp_get_ad_info();
194
  ?>
includes/init/define.php CHANGED
@@ -5,7 +5,7 @@ if ( ! defined('ABSPATH') ) {
5
  die();
6
  }
7
 
8
- define( 'MSWP_AVERTA_VERSION' , '3.3.2' );
9
 
10
  define( 'MSWP_SLUG' , 'master-slider' );
11
  define( 'MSWP_TEXT_DOMAIN' , 'masterslider' );
5
  die();
6
  }
7
 
8
+ define( 'MSWP_AVERTA_VERSION' , '3.3.4' );
9
 
10
  define( 'MSWP_SLUG' , 'master-slider' );
11
  define( 'MSWP_TEXT_DOMAIN' , 'masterslider' );
includes/msp-functions.php CHANGED
@@ -165,7 +165,7 @@ function msp_flush_all_sliders_cache( $slider_types = array() ){
165
  * @return mixed true if successful, false otherwise
166
  */
167
  function msp_delete_slider_transient( $slider_id ) {
168
- return delete_transient( 'masterslider_output_' . $slider_id );
169
  }
170
 
171
 
@@ -304,7 +304,7 @@ function msp_update_slider_custom_css_and_fonts( $slider_id ) {
304
  */
305
  function msp_set_slider_transient( $slider_id, $value, $cache_period = null ) {
306
  $cache_period = is_numeric( $cache_period ) ? (float)msp_get_setting( '_cache_period', 'msp_general_setting', 12 ) : $cache_period;
307
- return set_transient( 'master_slider_output_' . $slider_id , $value, (int)$cache_period * HOUR_IN_SECONDS );
308
  }
309
 
310
 
@@ -315,7 +315,7 @@ function msp_set_slider_transient( $slider_id, $value, $cache_period = null ) {
315
  * @return mixed Value of transient or False If the transient does not exist or does not have a value
316
  */
317
  function msp_get_slider_transient( $slider_id ) {
318
- return get_transient( 'master_slider_output_' . $slider_id );
319
  }
320
 
321
 
@@ -736,6 +736,76 @@ function msp_get_setting( $option, $section, $default = '' ) {
736
  return $default;
737
  }
738
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
739
  /*-----------------------------------------------------------------------------------*/
740
  /* Get trimmed string
741
  /*-----------------------------------------------------------------------------------*/
165
  * @return mixed true if successful, false otherwise
166
  */
167
  function msp_delete_slider_transient( $slider_id ) {
168
+ return msp_delete_transient( 'masterslider_output_' . $slider_id );
169
  }
170
 
171
 
304
  */
305
  function msp_set_slider_transient( $slider_id, $value, $cache_period = null ) {
306
  $cache_period = is_numeric( $cache_period ) ? (float)msp_get_setting( '_cache_period', 'msp_general_setting', 12 ) : $cache_period;
307
+ return msp_set_transient( 'master_slider_output_' . $slider_id , $value, (int)$cache_period * HOUR_IN_SECONDS );
308
  }
309
 
310
 
315
  * @return mixed Value of transient or False If the transient does not exist or does not have a value
316
  */
317
  function msp_get_slider_transient( $slider_id ) {
318
+ return msp_get_transient( 'master_slider_output_' . $slider_id );
319
  }
320
 
321
 
736
  return $default;
737
  }
738
 
739
+ /**
740
+ * Set/update the value of a transient.
741
+ *
742
+ * You do not need to serialize values. If the value needs to be serialized, then
743
+ * it will be serialized before it is set.
744
+ *
745
+ *
746
+ * @param string $transient Transient name. Expected to not be SQL-escaped. Must be
747
+ * 172 characters or fewer in length.
748
+ * @param mixed $value Transient value. Must be serializable if non-scalar.
749
+ * Expected to not be SQL-escaped.
750
+ * @param int $expiration Optional. Time until expiration in seconds. Default 0 (no expiration).
751
+ * @return bool False if value was not set and true if value was set.
752
+ */
753
+ function msp_set_transient( $transient, $value, $expiration = 0 ) {
754
+ global $_wp_using_ext_object_cache;
755
+
756
+ $current_using_cache = $_wp_using_ext_object_cache;
757
+ $_wp_using_ext_object_cache = false;
758
+
759
+ $result = set_transient( $transient, $value, $expiration );
760
+
761
+ $_wp_using_ext_object_cache = $current_using_cache;
762
+
763
+ return $result;
764
+ }
765
+
766
+
767
+ /**
768
+ * Get the value of a transient.
769
+ *
770
+ * If the transient does not exist, does not have a value, or has expired,
771
+ * then the return value will be false.
772
+ *
773
+ * @param string $transient Transient name. Expected to not be SQL-escaped.
774
+ * @return mixed Value of transient.
775
+ */
776
+ function msp_get_transient( $transient ) {
777
+ global $_wp_using_ext_object_cache;
778
+
779
+ $current_using_cache = $_wp_using_ext_object_cache;
780
+ $_wp_using_ext_object_cache = false;
781
+
782
+ $result = get_transient( $transient );
783
+
784
+ $_wp_using_ext_object_cache = $current_using_cache;
785
+
786
+ return $result;
787
+ }
788
+
789
+
790
+ /**
791
+ * Delete a transient.
792
+ *
793
+ * @param string $transient Transient name. Expected to not be SQL-escaped.
794
+ * @return bool true if successful, false otherwise
795
+ */
796
+ function msp_delete_transient( $transient ) {
797
+ global $_wp_using_ext_object_cache;
798
+
799
+ $current_using_cache = $_wp_using_ext_object_cache;
800
+ $_wp_using_ext_object_cache = false;
801
+
802
+ $result = delete_transient( $transient );
803
+
804
+ $_wp_using_ext_object_cache = $current_using_cache;
805
+
806
+ return $result;
807
+ }
808
+
809
  /*-----------------------------------------------------------------------------------*/
810
  /* Get trimmed string
811
  /*-----------------------------------------------------------------------------------*/
master-slider.php CHANGED
@@ -11,7 +11,7 @@
11
  * Plugin Name: Master Slider
12
  * Plugin URI: https://wordpress.org/plugins/master-slider/
13
  * Description: Master Slider is the most advanced responsive HTML5 WordPress slider plugin with touch swipe navigation that works smoothly on devices too.
14
- * Version: 3.3.2
15
  * Author: averta
16
  * Author URI: http://averta.net
17
  * Text Domain: master-slider
11
  * Plugin Name: Master Slider
12
  * Plugin URI: https://wordpress.org/plugins/master-slider/
13
  * Description: Master Slider is the most advanced responsive HTML5 WordPress slider plugin with touch swipe navigation that works smoothly on devices too.
14
+ * Version: 3.3.4
15
  * Author: averta
16
  * Author URI: http://averta.net
17
  * Text Domain: master-slider
public/class-master-slider.php CHANGED
@@ -273,7 +273,7 @@ class Master_Slider {
273
  msp_get_ad_info();
274
 
275
  // dont display phlox notice in first 3 days
276
- set_transient( 'masterslider_display_popup_notice', 1000, 3 * DAY_IN_SECONDS );
277
 
278
  do_action( 'masterslider_activated', get_current_blog_id() );
279
  }
273
  msp_get_ad_info();
274
 
275
  // dont display phlox notice in first 3 days
276
+ msp_set_transient( 'masterslider_display_popup_notice', 1000, 3 * DAY_IN_SECONDS );
277
 
278
  do_action( 'masterslider_activated', get_current_blog_id() );
279
  }