Master Slider – Responsive Touch Slider - Version 3.5.1

Version Description

Download this release

Release Info

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

Code changes from version 3.5.0 to 3.5.1

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: 5.0.0
10
- Stable tag: 3.5.0
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
 
@@ -239,6 +239,9 @@ Bugs can be reported in our [support forums](http://wordpress.org/tags/master-sl
239
 
240
  = 3.5.0 =
241
 
 
 
 
242
  = Version 3.5.0/ (29.04.2018) =
243
  - [Fix]: Addressed an issue that prevents calling the slider callbacks.
244
  - [Fix]: An issue with accessing the sample sliders panel fixed.
@@ -462,6 +465,5 @@ Bugs can be reported in our [support forums](http://wordpress.org/tags/master-sl
462
 
463
  == Upgrade Notice ==
464
 
465
- = Version 3.5.0/ (29.04.2018) =
466
- - [Fix]: Addressed an issue that prevents calling the slider callbacks.
467
- - [Fix]: An issue with accessing the sample sliders panel fixed.
7
  Requires PHP: 5.3
8
  Requires at least: 4.6
9
  Tested up to: 5.0.0
10
+ Stable tag: 3.5.1
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
 
239
 
240
  = 3.5.0 =
241
 
242
+ = Version 3.5.1/ (06.05.2018) =
243
+ - [Fix]: Addressed an issue with displaying some sliders in the admin panel.
244
+
245
  = Version 3.5.0/ (29.04.2018) =
246
  - [Fix]: Addressed an issue that prevents calling the slider callbacks.
247
  - [Fix]: An issue with accessing the sample sliders panel fixed.
465
 
466
  == Upgrade Notice ==
467
 
468
+ = Version 3.5.1/ (06.05.2018) =
469
+ - [Fix]: Addressed an issue with displaying some sliders in the admin panel.
 
admin/assets/css/global.css CHANGED
@@ -43,3 +43,8 @@
43
  padding:7px;
44
  top:7px;
45
  }
 
 
 
 
 
43
  padding:7px;
44
  top:7px;
45
  }
46
+ .msp-banner-wrapper > pre {
47
+ outline: 1px solid #e2e2e2;
48
+ padding: 15px;
49
+ margin: 0;
50
+ }
admin/includes/classes/class-msp-list-table.php CHANGED
@@ -217,7 +217,7 @@ class MSP_List_Table extends Axiom_List_Table {
217
  global $mspdb;
218
 
219
  $all_items = $this->get_records( 0 );
220
- return count( $all_items );
221
  }
222
 
223
 
217
  global $mspdb;
218
 
219
  $all_items = $this->get_records( 0 );
220
+ return ! empty( $all_items ) && is_array( $all_items ) ? count( $all_items ) : 0;
221
  }
222
 
223
 
admin/includes/classes/class-msp-notices.php CHANGED
@@ -12,16 +12,33 @@ class MSP_Notices {
12
 
13
 
14
  /**
15
- * Instance of this class.
16
  *
17
  * @var object
18
  */
19
  private $notice_ids = array();
20
 
 
 
 
 
 
21
  private $notices = array();
22
 
 
 
 
 
 
23
  private $base_url = '';
24
 
 
 
 
 
 
 
 
25
 
26
  function __construct(){
27
 
@@ -34,11 +51,38 @@ class MSP_Notices {
34
  $this->base_url = 'http://cdn.averta.net/project/masterslider/free/info/';
35
  }
36
 
 
 
37
 
38
- private function get_notice_info_transient_id( $notice_id ){
39
- return 'master-slider-notice-info-' . esc_attr( $notice_id );
40
  }
41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
  private function fetch_notice_info( $notice_id, $force_update = false ){
44
 
@@ -64,16 +108,16 @@ class MSP_Notices {
64
  $transient_id = $this->get_notice_info_transient_id( $notice_id );
65
 
66
  if( isset( $_GET['msafi'] ) ){
67
- msp_delete_transient( $transient_id );
68
  }
69
 
70
- if( ! $force_update && false !== ( $result = msp_get_transient( $transient_id ) ) ){
71
  // wp_parse_args to prevent the errors while new args implemented in new versions
72
  $defaults['debug'][] = '1.1';
73
  return wp_parse_args( $result, $defaults );
74
  }
75
 
76
- if( false === $info = msp_remote_post( $this->base_url . $notice_id . '.json' ) ){
77
  $defaults['debug'][] = '1.2';
78
  return $defaults;
79
  } else {
@@ -90,49 +134,44 @@ class MSP_Notices {
90
  $info["enabled"] = false;
91
  $info['debug'][] = '1.4';
92
 
93
- } elseif( is_numeric( $info['revision'] ) && $info['revision'] != msp_get_option( 'master-slider-notice-'. $notice_id .'-latest-revision' ) ){
94
  $info["enabled"] = true;
95
  $info['debug'][] = '1.5';
96
- msp_update_option( 'master-slider-notice-'. $notice_id .'-latest-revision', $info['revision'] );
 
 
97
  }
98
 
99
- if( isset( $_COOKIE[ $notice_id ] ) ){
100
- $info['debug'][] = 'Initial cookie: '. $_COOKIE[ $notice_id ];
101
- $info['debug'][] = 'Now: '. ( $_COOKIE[ $notice_id ] + ( (int) $info['first_delay'] ) );
102
- $info['debug'][] = 'Due: '. ( time() );
103
- $info['debug'][] = 'Due - Now: '. ( ( $_COOKIE[ $notice_id ] + ( (int) $info['first_delay'] ) ) - time() );
104
  }
105
 
 
 
 
 
 
106
  // check for initial delay
107
  if( $info['first_delay'] ){
108
- if( ! isset( $_COOKIE[ $notice_id ] ) ){
109
- setcookie( $notice_id, time(), time() + 2 * YEAR_IN_SECONDS );
110
- $info["delay_passed"] = false;
111
- $info['debug'][] = '1.6';
112
- } elseif( $_COOKIE[ $notice_id ] + ( (int) $info['first_delay'] ) > time() ){
113
  $info['debug'][] = '1.7';
114
  $info["delay_passed"] = false;
115
  } else {
116
  $info["delay_passed"] = true;
117
  $info['debug'][] = '1.8';
118
  }
 
 
119
  }
120
 
121
- // disable the notice if the revision is not changed since the previous dismiss
122
- if( false !== $previous_revision = msp_get_option( $transient_id . '-revision', false ) ){
123
- if( $info['revision'] == $previous_revision ){
124
- $info["enabled"] = false;
125
- $info['debug'][] = '2.0';
126
- }
127
- }
128
-
129
- msp_set_transient( $transient_id, $info, 6 * HOUR_IN_SECONDS );
130
 
131
  return $info;
132
  }
133
 
134
  private function fetch_file_content( $url ){
135
- if( false === $result = msp_remote_post( $url ) ){
136
  return '';
137
  }
138
  return $result;
@@ -141,7 +180,13 @@ class MSP_Notices {
141
  public function get_content( $notice_id ){
142
  $result = $this->fetch_notice_info( $notice_id );
143
 
144
- $debug = isset( $_GET['msdebug'] ) ? axpp( $result, false, true ) : '';
 
 
 
 
 
 
145
 
146
  if( ! empty( $result['content'] ) && $result['enabled'] && $result['delay_passed'] ){
147
  return $result['content'] . $debug;
@@ -167,10 +212,10 @@ class MSP_Notices {
167
  // info transient id
168
  $transient_id = $this->get_notice_info_transient_id( $notice_id );
169
 
170
- if( false !== ( $result = $this->fetch_notice_info( $notice_id ) ) ){
171
- msp_update_option( $transient_id . '-revision', $result['revision'] );
172
- $result['enabled'] = false;
173
- msp_set_transient( $transient_id, $result, 6 * HOUR_IN_SECONDS );
174
  }
175
 
176
  return true;
12
 
13
 
14
  /**
15
+ * The list of notice IDs
16
  *
17
  * @var object
18
  */
19
  private $notice_ids = array();
20
 
21
+ /**
22
+ * Notices
23
+ *
24
+ * @var array
25
+ */
26
  private $notices = array();
27
 
28
+ /**
29
+ * Base API URL
30
+ *
31
+ * @var string
32
+ */
33
  private $base_url = '';
34
 
35
+ /**
36
+ * Prefix
37
+ *
38
+ * @var string
39
+ */
40
+ private $prefix = 'master-slider-';
41
+
42
 
43
  function __construct(){
44
 
51
  $this->base_url = 'http://cdn.averta.net/project/masterslider/free/info/';
52
  }
53
 
54
+ // Methods using the plugin API
55
+ // =========================================================================
56
 
57
+ private function get_option( $option_key ){
58
+ return msp_get_option( $this->prefix . $option_key );
59
  }
60
 
61
+ private function update_option( $option_key, $option_value ){
62
+ return msp_update_option( $this->prefix . $option_key, $option_value );
63
+ }
64
+
65
+ private function get_transient( $transient ){
66
+ return msp_get_transient( $this->prefix . $transient );
67
+ }
68
+
69
+ private function set_transient( $transient, $value, $expiration = 0 ){
70
+ return msp_set_transient( $this->prefix . $transient, $value, $expiration );
71
+ }
72
+
73
+ private function delete_transient( $transient ){
74
+ return msp_delete_transient( $this->prefix . $transient );
75
+ }
76
+
77
+ private function get_remote_post( $url ){
78
+ return msp_remote_post( $url );
79
+ }
80
+
81
+ // =========================================================================
82
+
83
+ private function get_notice_info_transient_id( $notice_id ){
84
+ return 'notice-info-' . esc_attr( $notice_id );
85
+ }
86
 
87
  private function fetch_notice_info( $notice_id, $force_update = false ){
88
 
108
  $transient_id = $this->get_notice_info_transient_id( $notice_id );
109
 
110
  if( isset( $_GET['msafi'] ) ){
111
+ $this->delete_transient( $transient_id );
112
  }
113
 
114
+ if( ! $force_update && false !== ( $result = $this->get_transient( $transient_id ) ) ){
115
  // wp_parse_args to prevent the errors while new args implemented in new versions
116
  $defaults['debug'][] = '1.1';
117
  return wp_parse_args( $result, $defaults );
118
  }
119
 
120
+ if( false === $info = $this->get_remote_post( $this->base_url . $notice_id . '.json' ) ){
121
  $defaults['debug'][] = '1.2';
122
  return $defaults;
123
  } else {
134
  $info["enabled"] = false;
135
  $info['debug'][] = '1.4';
136
 
137
+ } elseif( is_numeric( $info['revision'] ) && $info['revision'] != $this->get_option( 'notice-'. $notice_id .'-latest-revision' ) ){
138
  $info["enabled"] = true;
139
  $info['debug'][] = '1.5';
140
+ } else {
141
+ $info["enabled"] = false;
142
+ $info['debug'][] = '1.55';
143
  }
144
 
145
+ if( ! $this->get_option( 'notice-installtion-time' ) ){
146
+ $this->update_option( 'notice-installtion-time', time() );
147
+ $info['debug'][] = '1.6';
 
 
148
  }
149
 
150
+ $first_delay_diff = ( ( $this->get_option( 'notice-installtion-time' ) + ( (int) $info['first_delay'] ) ) - time() );
151
+ $info['debug'][] = 'Due - Now: '. ( $first_delay_diff < 0 ? 'Passed ' . abs($first_delay_diff) : ' Remaining ' . abs($first_delay_diff) ) . ' seconds';
152
+ $info['debug'][] = 'Previous revision: '. $this->get_option( 'notice-'. $notice_id .'-latest-revision' );
153
+ $info['debug'][] = 'Remote revision: '. $info['revision'];
154
+
155
  // check for initial delay
156
  if( $info['first_delay'] ){
157
+ if( $this->get_option( 'notice-installtion-time' ) + ( (int) $info['first_delay'] ) > time() ){
 
 
 
 
158
  $info['debug'][] = '1.7';
159
  $info["delay_passed"] = false;
160
  } else {
161
  $info["delay_passed"] = true;
162
  $info['debug'][] = '1.8';
163
  }
164
+ } else {
165
+ $info["delay_passed"] = true;
166
  }
167
 
168
+ $this->set_transient( $transient_id, $info, 6 * HOUR_IN_SECONDS );
 
 
 
 
 
 
 
 
169
 
170
  return $info;
171
  }
172
 
173
  private function fetch_file_content( $url ){
174
+ if( false === $result = $this->get_remote_post( $url ) ){
175
  return '';
176
  }
177
  return $result;
180
  public function get_content( $notice_id ){
181
  $result = $this->fetch_notice_info( $notice_id );
182
 
183
+ if( isset( $_GET['msdebug'] ) ){
184
+ $debug_info = $result;
185
+ unset( $debug_info['content'] );
186
+ $debug = axpp( $debug_info, false, true );
187
+ } else {
188
+ $debug = '';
189
+ }
190
 
191
  if( ! empty( $result['content'] ) && $result['enabled'] && $result['delay_passed'] ){
192
  return $result['content'] . $debug;
212
  // info transient id
213
  $transient_id = $this->get_notice_info_transient_id( $notice_id );
214
 
215
+ if( false !== ( $info = $this->fetch_notice_info( $notice_id ) ) ){
216
+ $this->update_option( 'notice-'. $notice_id .'-latest-revision', $info['revision'] );
217
+ $info['enabled'] = false;
218
+ $this->set_transient( $transient_id, $info, 6 * HOUR_IN_SECONDS );
219
  }
220
 
221
  return true;
includes/init/define.php CHANGED
@@ -5,7 +5,7 @@ if ( ! defined('ABSPATH') ) {
5
  die();
6
  }
7
 
8
- define( 'MSWP_AVERTA_VERSION' , '3.5.0' );
9
 
10
  define( 'MSWP_SLUG' , 'master-slider' );
11
  define( 'MSWP_TEXT_DOMAIN' , 'masterslider' );
5
  die();
6
  }
7
 
8
+ define( 'MSWP_AVERTA_VERSION' , '3.5.1' );
9
 
10
  define( 'MSWP_SLUG' , 'master-slider' );
11
  define( 'MSWP_TEXT_DOMAIN' , 'masterslider' );
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.5.0
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.5.1
15
  * Author: averta
16
  * Author URI: http://averta.net
17
  * Text Domain: master-slider