Slider by WD – Responsive Slider - Version 1.2.32

Version Description

  • Added: Option to allow create slider by user roles.
Download this release

Release Info

Developer 10web
Plugin Icon 128x128 Slider by WD – Responsive Slider
Version 1.2.32
Comparing to
See all releases

Code changes from version 1.2.30 to 1.2.32

admin/controllers/WDSControllerGoptions_wds.php CHANGED
@@ -47,6 +47,7 @@ class WDSControllerGoptions_wds {
47
  public function save() {
48
  $register_scripts = (isset($_REQUEST['register_scripts']) ? (int) $_REQUEST['register_scripts'] : 0);
49
  $loading_gif = WDW_S_Library::esc_sanitize_data($_REQUEST, 'loading_gif', 'sanitize_text_field', 0);
 
50
  $default_layer_fweight = WDW_S_Library::esc_sanitize_data($_REQUEST, 'default_layer_fweight', 'sanitize_text_field');
51
  $default_layer_start = WDW_S_Library::esc_sanitize_data($_REQUEST, 'default_layer_start', 'sanitize_text_field', 0);
52
  $default_layer_effect_in = WDW_S_Library::esc_sanitize_data($_REQUEST, 'default_layer_effect_in', 'sanitize_text_field');
@@ -77,6 +78,7 @@ class WDSControllerGoptions_wds {
77
  'default_layer_google_fonts' => $default_layer_google_fonts,
78
  'register_scripts' => $register_scripts,
79
  'loading_gif' => $loading_gif,
 
80
  'spider_uploader' => $spider_uploader,
81
  'possib_add_ffamily' => $possib_add_ffamily,
82
  'possib_add_ffamily_google' => $possib_add_ffamily_google,
47
  public function save() {
48
  $register_scripts = (isset($_REQUEST['register_scripts']) ? (int) $_REQUEST['register_scripts'] : 0);
49
  $loading_gif = WDW_S_Library::esc_sanitize_data($_REQUEST, 'loading_gif', 'sanitize_text_field', 0);
50
+ $permission = WDW_S_Library::esc_sanitize_data($_REQUEST, 'permission', 'sanitize_text_field', 'manage_options');
51
  $default_layer_fweight = WDW_S_Library::esc_sanitize_data($_REQUEST, 'default_layer_fweight', 'sanitize_text_field');
52
  $default_layer_start = WDW_S_Library::esc_sanitize_data($_REQUEST, 'default_layer_start', 'sanitize_text_field', 0);
53
  $default_layer_effect_in = WDW_S_Library::esc_sanitize_data($_REQUEST, 'default_layer_effect_in', 'sanitize_text_field');
78
  'default_layer_google_fonts' => $default_layer_google_fonts,
79
  'register_scripts' => $register_scripts,
80
  'loading_gif' => $loading_gif,
81
+ 'permission' => $permission,
82
  'spider_uploader' => $spider_uploader,
83
  'possib_add_ffamily' => $possib_add_ffamily,
84
  'possib_add_ffamily_google' => $possib_add_ffamily_google,
admin/views/WDSViewGoptions_wds.php CHANGED
@@ -13,6 +13,12 @@ class WDSViewGoptions_wds {
13
  'normal' => __('Normal', WDS()->prefix),
14
  'bold' => __('Bold', WDS()->prefix),
15
  );
 
 
 
 
 
 
16
  $default_layer_effects_in = array(
17
  'none' => __('None', WDS()->prefix),
18
  'bounce' => __('Bounce', WDS()->prefix),
@@ -113,6 +119,7 @@ class WDSViewGoptions_wds {
113
  $global_options->loading_gif = get_option("wds_loading_gif", 0);
114
  $global_options->register_scripts = get_option("wds_register_scripts", 0);
115
  }
 
116
  $uninstall_href = add_query_arg( array( 'page' => 'uninstall_wds'), admin_url('admin.php') );
117
  ?>
118
  <div class="clear"></div>
@@ -157,6 +164,26 @@ class WDSViewGoptions_wds {
157
  </div>
158
  </div>
159
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  </div>
161
  <div class="wd-table-col wd-table-col-50 wd-table-col-right">
162
  <div class="wd-box-section">
13
  'normal' => __('Normal', WDS()->prefix),
14
  'bold' => __('Bold', WDS()->prefix),
15
  );
16
+ $permissions = array(
17
+ 'edit_posts' => 'Contributor',
18
+ 'publish_posts' => 'Author',
19
+ 'moderate_comments' => 'Editor',
20
+ 'manage_options' => 'Administrator',
21
+ );
22
  $default_layer_effects_in = array(
23
  'none' => __('None', WDS()->prefix),
24
  'bounce' => __('Bounce', WDS()->prefix),
119
  $global_options->loading_gif = get_option("wds_loading_gif", 0);
120
  $global_options->register_scripts = get_option("wds_register_scripts", 0);
121
  }
122
+ $global_options->permission = isset($global_options->permission) && $global_options->permission ? $global_options->permission : 'manage_options';;
123
  $uninstall_href = add_query_arg( array( 'page' => 'uninstall_wds'), admin_url('admin.php') );
124
  ?>
125
  <div class="clear"></div>
164
  </div>
165
  </div>
166
  </div>
167
+ <div class="wd-box-section">
168
+ <div class="wd-box-title">
169
+ <strong><?php _e('Role Options', WDS()->prefix); ?></strong>
170
+ </div>
171
+ <div class="wd-box-content">
172
+ <div class="wd-group">
173
+ <label for="permission" class="wd-label"><?php _e('Roles', WDS()->prefix); ?></label>
174
+ <select id="permission" name="permission">
175
+ <?php
176
+ foreach ($permissions as $key => $permission) {
177
+ ?>
178
+ <option value="<?php echo $key; ?>" <?php if (isset($global_options->permission) && $global_options->permission == $key) echo 'selected="selected"'; ?>><?php echo $permission; ?></option>
179
+ <?php
180
+ }
181
+ ?>
182
+ </select>
183
+ <p class="description"><?php _e('Choose a WordPress user role which can have visible slider on the menu bar.',WDS()->prefix); ?></p>
184
+ </div>
185
+ </div>
186
+ </div>
187
  </div>
188
  <div class="wd-table-col wd-table-col-50 wd-table-col-right">
189
  <div class="wd-box-section">
banner_class.php DELETED
@@ -1,512 +0,0 @@
1
- <?php
2
-
3
- class TWBanner {
4
- public $menu_postfix = ''; // To display on only current plugin pages.
5
- public $prefix = ''; // Current plugin prefix.
6
- public $logo = ''; // Current plugin logo relative URL.
7
- public $plugin_slug = ''; // Current plugin slug.
8
- public $plugin_url = ''; // Current plugin URL.
9
- public $plugin_id = ''; // Current plugin id.
10
- public $text = ''; // Banner text.
11
- public $slug = ''; // Plugin slug to be installed.
12
- public $mu_plugin_slug = ''; // Must use plugin slug.
13
- public $base_php = ''; // Plugin base php filename to be installed.
14
- public $page_url = ''; // Redirect to URL after activating the plugin.
15
- public $status_install = 0; // Is plugin installed.
16
- public $status_active = 0; // Is plugin active.
17
-
18
- /**
19
- * TW_Banner_Class constructor.
20
- *
21
- * @param $opt_banner_param
22
- */
23
- public function __construct( $opt_banner_param ) {
24
- $this->menu_postfix = $opt_banner_param["menu_postfix"];
25
- $this->prefix = $opt_banner_param["prefix"];
26
- $this->logo = $opt_banner_param["logo"];
27
- $this->plugin_slug = $opt_banner_param['plugin_slug'];
28
- $this->plugin_url = $opt_banner_param["plugin_url"];
29
- $this->plugin_id = $opt_banner_param['plugin_id'];
30
- $this->text = $opt_banner_param['text'];
31
- $this->slug = $opt_banner_param['slug'];
32
- $this->mu_plugin_slug = $opt_banner_param['mu_plugin_slug'];
33
- $this->base_php = $opt_banner_param['base_php'];
34
- $this->page_url = $opt_banner_param['page_url'];
35
- $this->init();
36
- }
37
-
38
- /**
39
- * Add actions.
40
- */
41
- public function init() {
42
- add_action('wp_ajax_wd_tenweb_dismiss', array( $this, 'dismiss' ));
43
- add_action('wp_ajax_tenweb_status', array( $this, 'change_status' ));
44
-
45
- // Check the page to show banner.
46
- if ( ( !isset($_GET['page']) || ( preg_match("/^$this->menu_postfix/", esc_html( $_GET['page'] )) === 0 && preg_match("/$this->menu_postfix$/", esc_html( $_GET['page'] )) === 0 )) || ( isset($_GET['task']) && !strpos(esc_html($_GET['task']), 'edit') === TRUE && !(strpos(esc_html($_GET['task']), 'display') > -1)) ) {
47
-
48
- return;
49
- }
50
-
51
- if ( $this->is_plugin_mu($this->mu_plugin_slug) ) {
52
- $this->status_install = 1;
53
- $this->status_active = 1;
54
- }
55
- else {
56
- $this->upgrade_install_status();
57
- }
58
- if ( !$this->status_active ) {
59
- add_action('admin_notices', array( $this, 'tenweb_install_notice' ));
60
- }
61
- }
62
-
63
- /**
64
- * Check plugin install status.
65
- */
66
- public function upgrade_install_status() {
67
- if ( !function_exists('is_plugin_active') ) {
68
- include_once(ABSPATH . 'wp-admin/includes/plugin.php');
69
- }
70
- if ( $this->is_plugin_installed($this->slug) ) {
71
- $this->status_install = 1;
72
- if ( is_plugin_active($this->slug . '/' . $this->base_php) ) {
73
- $this->status_active = 1;
74
- }
75
- }
76
- }
77
-
78
- /**
79
- * Save status.
80
- */
81
- public function dismiss() {
82
- update_option('tenweb_notice_status', '1', 'no');
83
- }
84
-
85
- /**
86
- * Plugin install/activate status.
87
- *
88
- * @return string
89
- */
90
- public function tenweb_install_notice() {
91
- // Remove old notice.
92
- if ( get_option('tenweb_notice_status') !== FALSE ) {
93
- update_option('tenweb_notice_status', '1', 'no');
94
- }
95
- $meta_value = get_option('tenweb_notice_status');
96
- if ( $meta_value === '' || $meta_value === FALSE ) {
97
- ob_start();
98
- $dismiss_url = add_query_arg(array( 'action' => 'wd_tenweb_dismiss' ), admin_url('admin-ajax.php'));
99
- $verify_url = add_query_arg(array( 'action' => 'tenweb_status' ), admin_url('admin-ajax.php'));
100
- ?>
101
- <style>
102
- .hide {
103
- display: none !important;
104
- }
105
- #verifyUrl {
106
- display: none;
107
- }
108
- #loading {
109
- position: absolute;
110
- right: 20px;
111
- top: 50%;
112
- transform: translateY(-50%);
113
- margin: 0px;
114
- background: url("<?php echo $this->plugin_url . '/images/spinner.gif'; ?>") no-repeat;
115
- background-size: 20px 20px;
116
- filter: alpha(opacity=70);
117
- }
118
- #wd_tenweb_logo_notice {
119
- height: 32px;
120
- float: left;
121
- }
122
- .error_install,
123
- .error_activate {
124
- color: red;
125
- font-size: 10px;
126
- }
127
- #wpbody-content #v2_tenweb_notice_cont {
128
- display: none;
129
- flex-wrap: wrap;
130
- background: #fff;
131
- box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .1);
132
- position: relative;
133
- margin-left: 0px;
134
- padding: 5px 0;
135
- overflow: hidden;
136
- border-left: 4px solid #0073AA;
137
- font-family: Open Sans, sans-serif;
138
- height: 40px;
139
- min-height: 40px;
140
- box-sizing: initial;
141
- }
142
- .v2_logo {
143
- display: flex;
144
- flex-direction: column;
145
- justify-content: center;
146
- height: inherit;
147
- }
148
- #v2_tenweb_notice_cont {
149
- height: 50px;
150
- padding: 0px;
151
- }
152
- .v2_content {
153
- flex-grow: 1;
154
- height: inherit;
155
- margin-left: 25px;
156
- }
157
- .v2_content p {
158
- margin: 0px;
159
- padding: 0px;
160
- }
161
- .v2_content p > span {
162
- font-size: 16px;
163
- color: #333B46;
164
- font-weight: 600;
165
- line-height: 40px;
166
- margin: 0;
167
- }
168
- #wd_tenweb_logo_notice {
169
- margin-left: 25px;
170
- height: 30px;
171
- line-height: 100%;
172
- }
173
- .v2_button {
174
- display: flex;
175
- margin-right: 30px;
176
- flex-direction: column;
177
- justify-content: center;
178
- }
179
- .v2_button #install_now, #activate_now {
180
- width: 112px;
181
- height: 32px;
182
- line-height: 30px;
183
- font-size: 14px;
184
- text-align: center;
185
- padding: 0;
186
- }
187
- #v2_tenweb_notice_cont .wd_tenweb_notice_dissmiss.notice-dismiss {
188
- top: 3px;
189
- right: 3px;
190
- padding: 0px;
191
- }
192
- .v2_button .button {
193
- position: relative;
194
- }
195
- .v2_button .button #loading {
196
- position: absolute;
197
- right: 10px;
198
- top: 50%;
199
- transform: translateY(-50%);
200
- margin: 0px;
201
- background-size: 12px 12px;
202
- filter: alpha(opacity=70);
203
- width: 12px;
204
- height: 12px;
205
- }
206
- @media only screen and (max-width: 1200px) and (min-width: 821px) {
207
- #wpbody-content #v2_tenweb_notice_cont {
208
- height: 50px;
209
- min-height: 50px;
210
- }
211
- #v2_tenweb_notice_cont {
212
- height: 60px;
213
- }
214
- .v2_content {
215
- margin-left: 25px;
216
- }
217
- .v2_content p {
218
- font-size: 14px;
219
- color: #333B46;
220
- font-weight: 600;
221
- line-height: 20px;
222
- margin-top: 5px;
223
- }
224
- .v2_content p span {
225
- display: block;
226
- }
227
- #wd_tenweb_logo_notice {
228
- margin-left: 25px;
229
- height: 30px;
230
- line-height: 100%;
231
- }
232
- .v2_button {
233
- display: flex;
234
- margin-right: 30px;
235
- flex-direction: column;
236
- justify-content: center;
237
- }
238
- .v2_button #install_now {
239
- width: 112px;
240
- height: 32px;
241
- line-height: 30px;
242
- font-size: 14px;
243
- text-align: center;
244
- padding: 0;
245
- }
246
- #v2_tenweb_notice_cont .wd_tenweb_notice_dissmiss.notice-dismiss {
247
- top: 3px;
248
- right: 3px;
249
- }
250
- }
251
- @media only screen and (max-width: 820px) and (min-width: 781px) {
252
- #wpbody-content #v2_tenweb_notice_cont {
253
- height: 50px;
254
- min-height: 50px;
255
- }
256
- #v2_tenweb_notice_cont {
257
- height: 60px;
258
- }
259
- .v2_content {
260
- margin-left: 25px;
261
- }
262
- .v2_content p {
263
- font-size: 13px;
264
- color: #333B46;
265
- font-weight: 600;
266
- line-height: 20px;
267
- margin-top: 5px;
268
- }
269
- .v2_content p span {
270
- display: block;
271
- }
272
- }
273
- @media only screen and (max-width: 780px) {
274
- #wpbody-content #v2_tenweb_notice_cont {
275
- height: auto;
276
- min-height: auto;
277
- }
278
- #v2_tenweb_notice_cont {
279
- height: auto;
280
- padding: 5px;
281
- }
282
- .v2_logo {
283
- display: block;
284
- height: auto;
285
- width: 100%;
286
- margin-top: 5px;
287
- }
288
- .v2_content {
289
- display: block;
290
- margin-left: 9px;
291
- margin-top: 10px;
292
- width: calc(100% - 10px);
293
- }
294
- .v2_content p {
295
- line-height: unset;
296
- font-size: 15px;
297
- line-height: 25px;
298
- }
299
- .v2_content p span {
300
- display: block;
301
- }
302
- #wd_tenweb_logo_notice {
303
- margin-left: 9px;
304
- }
305
- .v2_button {
306
- margin-left: 9px;
307
- margin-top: 10px;
308
- margin-bottom: 5px;
309
- }
310
- }
311
- </style>
312
- <script type="text/javascript">
313
- jQuery(document).ready(function () {
314
- jQuery('#v2_tenweb_notice_cont').css('display', 'flex');
315
- });
316
- </script>
317
- <div id="v2_tenweb_notice_cont" class="notice wd-notice">
318
- <div class="v2_logo">
319
- <img id="wd_tenweb_logo_notice" src="<?php echo $this->plugin_url . $this->logo; ?>" />
320
- </div>
321
- <div class="v2_content">
322
- <p>
323
- <?php echo $this->text ?>
324
- </p>
325
- </div>
326
- <div class="v2_button">
327
- <?php $this->tw_install_button(2); ?>
328
- </div>
329
- <button type="button" class="wd_tenweb_notice_dissmiss notice-dismiss" onclick="jQuery('#v2_tenweb_notice_cont').attr('style', 'display: none !important;'); jQuery.post('<?php echo $dismiss_url; ?>');">
330
- <span class="screen-reader-text"></span></button>
331
- <div id="verifyUrl" data-url="<?php echo $verify_url; ?>"></div>
332
- </div>
333
- <?php
334
- echo ob_get_clean();
335
- }
336
- }
337
-
338
- /**
339
- * Change status.
340
- */
341
- public function change_status() {
342
- $this->upgrade_install_status();
343
- if ( $this->status_install ) {
344
- $old_opt_array = array();
345
- $new_opt_array = array( $this->plugin_slug => $this->plugin_id );
346
- $key = 'tenweb_manager_installed';
347
- $option = get_option($key);
348
- if ( !empty($option) ) {
349
- $old_opt_array = (array) json_decode($option);
350
- }
351
- $array_installed = array_merge($new_opt_array, $old_opt_array);
352
- update_option($key, json_encode($array_installed));
353
- }
354
- $jsondata = array( 'status_install' => $this->status_install, 'status_active' => $this->status_active );
355
- echo json_encode($jsondata);
356
- exit;
357
- }
358
-
359
- /**
360
- * Install/activate button.
361
- *
362
- * @param $v
363
- */
364
- public function tw_install_button( $v ) {
365
- $prefix = $this->prefix;
366
- $install_url = esc_url(wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=' . $this->slug), 'install-plugin_' . $this->slug));
367
- $activation_url = $this->na_action_link($this->slug . '/' . $this->base_php, 'activate');
368
- $tenweb_url = $this->page_url;
369
- $dismiss_url = add_query_arg(array( 'action' => 'wd_tenweb_dismiss' ), admin_url('admin-ajax.php'));
370
- $activate = $this->status_install && !$this->status_active ? TRUE : FALSE;
371
- ?>
372
- <a class="button<?php echo($v == 2 ? ' button-primary' : ''); ?> tenweb_activaion"
373
- id="<?php echo $activate ? 'activate_now' : 'install_now'; ?>"
374
- data-activation="<?php _e("Activation", $prefix); ?>"
375
- data-tenweb-url="<?php echo $tenweb_url; ?>"
376
- data-install-url="<?php echo $install_url; ?>"
377
- data-activate-url="<?php echo $activation_url; ?>">
378
- <span class="tenweb_activaion_text"><?php echo $activate ? __("Activate", $prefix) : __("Install", $prefix); ?></span>
379
- <span class="spinner" id="loading"></span>
380
- </a>
381
- <span class="hide <?php echo $activate ? 'error_activate' : 'error_install tenweb_active'; ?> ">
382
- <?php echo $activate ? __("Activation failed, please try again.", $prefix) : __("Installation failed, please try again.", $prefix); ?>
383
- </span>
384
- <script>
385
- var url = jQuery(".tenweb_activaion").attr("data-install-url");
386
- var activate_url = jQuery(".tenweb_activaion").attr("data-activate-url");
387
-
388
- function install_tenweb_plugin() {
389
- jQuery("#loading").addClass('is-active');
390
- jQuery(this).prop('disable', true);
391
- jQuery.ajax({
392
- method: "POST",
393
- url: url,
394
- }).done(function () {
395
- /* Check if plugin installed.*/
396
- jQuery.ajax({
397
- type: 'POST',
398
- dataType: 'json',
399
- url: jQuery("#verifyUrl").attr('data-url'),
400
- error: function () {
401
- jQuery("#loading").removeClass('is-active');
402
- jQuery(".error_install").show();
403
- },
404
- success: function (response) {
405
- if (response.status_install == 1) {
406
- jQuery('#install_now .tenweb_activaion_text').text(jQuery("#install_now").data("activation"));
407
- activate_tenweb_plugin();
408
- }
409
- else {
410
- jQuery("#loading").removeClass('is-active');
411
- jQuery(".error_install").removeClass('hide');
412
- }
413
- }
414
- });
415
- }).fail(function () {
416
- jQuery("#loading").removeClass('is-active');
417
- jQuery(".error_install").removeClass('hide');
418
- });
419
- }
420
-
421
- function activate_tenweb_plugin() {
422
- jQuery("#activate_now #loading").addClass('is-active');
423
- jQuery.ajax({
424
- method: "POST",
425
- url: activate_url,
426
- }).done(function () {
427
- jQuery("#loading").removeClass('is-active');
428
- var data_tenweb_url = '';
429
- /* Check if plugin installed.*/
430
- jQuery.ajax({
431
- type: 'POST',
432
- dataType: 'json',
433
- url: jQuery("#verifyUrl").attr('data-url'),
434
- error: function () {
435
- jQuery("#loading").removeClass('is-active');
436
- jQuery(".error_activate").removeClass('hide');
437
- },
438
- success: function (response) {
439
- if (response.status_active == 1) {
440
- //jQuery('#install_now').addClass('hide');
441
- data_tenweb_url = jQuery('.tenweb_activaion').attr('data-tenweb-url');
442
- jQuery.post('<?php echo $dismiss_url; ?>');
443
- }
444
- else {
445
- jQuery("#loading").removeClass('is-active');
446
- jQuery(".error_activate").removeClass('hide');
447
- }
448
- },
449
- complete: function () {
450
- if (data_tenweb_url != '') {
451
- window.location.href = data_tenweb_url;
452
- }
453
- }
454
- });
455
- }).fail(function () {
456
- jQuery("#loading").removeClass('is-active');
457
- });
458
- }
459
-
460
- jQuery("#install_now").on("click", function () {
461
- install_tenweb_plugin();
462
- });
463
- jQuery("#activate_now").on("click", function () {
464
- activate_tenweb_plugin();
465
- });
466
- </script>
467
- <?php
468
- }
469
-
470
- /**
471
- * Check if plugin is installed.
472
- *
473
- * @param $plugin_slug
474
- *
475
- * @return bool
476
- */
477
- public function is_plugin_installed( $plugin_slug ) {
478
- if ( is_dir(WP_PLUGIN_DIR . '/' . $plugin_slug) ) {
479
- return TRUE;
480
- }
481
-
482
- return FALSE;
483
- }
484
-
485
- /**
486
- * Check if plugin is must used.
487
- *
488
- * @param $plugin_slug
489
- *
490
- * @return bool
491
- */
492
- public function is_plugin_mu( $plugin_slug ) {
493
- if ( $plugin_slug != '' ) {
494
- if ( is_dir(WPMU_PLUGIN_DIR . '/' . $plugin_slug) ) {
495
- return TRUE;
496
- }
497
- }
498
-
499
- return FALSE;
500
- }
501
-
502
- public function na_action_link( $plugin, $action = 'activate' ) {
503
- if ( strpos($plugin, '/') ) {
504
- $plugin = str_replace('\/', '%2F', $plugin);
505
- }
506
- $url = sprintf(admin_url('plugins.php?action=' . $action . '&plugin=%s&plugin_status=all&paged=1&s'), $plugin);
507
- $_REQUEST['plugin'] = $plugin;
508
- $url = wp_nonce_url($url, $action . '-plugin_' . $plugin);
509
-
510
- return $url;
511
- }
512
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
filemanager/UploadHandler.php CHANGED
@@ -11,7 +11,7 @@
11
  */
12
 
13
  if (function_exists('current_user_can')) {
14
- if (!current_user_can('manage_options')) {
15
  die('Access Denied');
16
  }
17
  }
11
  */
12
 
13
  if (function_exists('current_user_can')) {
14
+ if (!current_user_can(WDS()->options->permission)) {
15
  die('Access Denied');
16
  }
17
  }
framework/WDW_S_Library.php CHANGED
@@ -2389,6 +2389,7 @@ class WDW_S_Library {
2389
  'spider_uploader' => 0,
2390
  'possib_add_ffamily' => '',
2391
  'possib_add_ffamily_google' => '',
 
2392
  );
2393
  return $global_options;
2394
  }
2389
  'spider_uploader' => 0,
2390
  'possib_add_ffamily' => '',
2391
  'possib_add_ffamily_google' => '',
2392
+ 'permission' => 'manage_options',
2393
  );
2394
  return $global_options;
2395
  }
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: webdorado,10web
3
  Tags: responsive slider, slider, slideshow, wordpress slider, image slider, gallery slider, images slider, Photo Slider, post slider, slider plugin
4
  Requires at least: 3.4
5
- Tested up to: 5.3
6
  Requires PHP: 5.2
7
- Stable tag: 1.2.30
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -445,6 +445,12 @@ The plugin takes the full width of the widget area if the **Boxed Layout** in **
445
 
446
  == Changelog ==
447
 
 
 
 
 
 
 
448
  = 1.2.30 =
449
  * Added: Option to hide filmstrip on mobile screens.
450
 
2
  Contributors: webdorado,10web
3
  Tags: responsive slider, slider, slideshow, wordpress slider, image slider, gallery slider, images slider, Photo Slider, post slider, slider plugin
4
  Requires at least: 3.4
5
+ Tested up to: 5.4
6
  Requires PHP: 5.2
7
+ Stable tag: 1.2.32
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
445
 
446
  == Changelog ==
447
 
448
+ = 1.2.32 =
449
+ * Added: Option to allow create slider by user roles.
450
+
451
+ = 1.2.31 =
452
+ * Removed: Banner to install Image optimizer.
453
+
454
  = 1.2.30 =
455
  * Added: Option to hide filmstrip on mobile screens.
456
 
slider-wd.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Slider by 10Web
4
  * Plugin URI: https://10web.io/plugins/wordpress-slider/?utm_source=slider&utm_medium=free_plugin
5
  * Description: This is a responsive plugin, which allows adding sliders to your posts/pages and to custom location. It uses large number of transition effects and supports various types of layers.
6
- * Version: 1.2.30
7
  * Author: 10Web
8
  * Author URI: https://10web.io/pricing/?utm_source=slider&utm_medium=free_plugin
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -46,6 +46,7 @@ final class WDS {
46
  public $is_free = TRUE;
47
  public $upload_dir = '';
48
  public $free_msg = '';
 
49
 
50
  /**
51
  * Main WDS Instance.
@@ -78,8 +79,8 @@ final class WDS {
78
  $this->plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
79
  $this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
80
  $this->main_file = plugin_basename(__FILE__);
81
- $this->plugin_version = '1.2.30';
82
- $this->db_version = '1.2.30';
83
  $this->prefix = 'wds';
84
  $this->nicename = __('Slider', $this->prefix);
85
  $this->use_home_url();
@@ -87,6 +88,9 @@ final class WDS {
87
  $this->upload_dir = str_replace(ABSPATH, '', $upload_dir['basedir']) . '/slider-wd';
88
  $this->site_url_placeholder = '@#$%';
89
  $this->site_url_buttons_placeholder = '@##$%';
 
 
 
90
  }
91
 
92
  private function use_home_url() {
@@ -276,13 +280,10 @@ final class WDS {
276
  * Plugin menu.
277
  */
278
  function admin_menu() {
279
- $parent_slug = $this->is_free ? null : 'sliders_wds';
280
- if( !$this->is_free || get_option( "wds_subscribe_done" ) == 1 ) {
281
- add_menu_page($this->nicename, $this->nicename, 'manage_options', 'sliders_' . $this->prefix, array($this, 'admin_pages_new'), $this->plugin_url . '/images/wd_slider.png');
282
- $parent_slug = "sliders_wds";
283
- }
284
 
285
- $sliders_page = add_submenu_page($parent_slug, __('Sliders', $this->prefix), __('Sliders', $this->prefix), 'manage_options', 'sliders_'. $this->prefix, array($this, 'admin_pages_new'));
286
  add_action('admin_print_styles-' . $sliders_page, array($this, 'admin_styles'));
287
  add_action('admin_print_scripts-' . $sliders_page, array($this, 'admin_scripts'));
288
  add_action('load-' . $sliders_page, array($this, 'sliders_per_page_option'));
@@ -291,7 +292,7 @@ final class WDS {
291
  add_action('admin_print_styles-' . $global_options_page, array($this, 'admin_styles'));
292
  add_action('admin_print_scripts-' . $global_options_page, array($this, 'admin_scripts'));
293
 
294
- $demo_slider = add_submenu_page($parent_slug, __('Import', $this->prefix), __('Import', $this->prefix), 'manage_options', 'demo_sliders_wds', array($this, 'demo_sliders'));
295
  add_action('admin_print_styles-' . $demo_slider, array($this, 'admin_styles'));
296
  add_action('admin_print_scripts-' . $demo_slider, array($this, 'admin_scripts'));
297
 
@@ -365,10 +366,9 @@ final class WDS {
365
  $controller->execute();
366
  }
367
  }
368
-
369
  function admin_pages() {
370
  if (function_exists('current_user_can')) {
371
- if (!current_user_can('manage_options')) {
372
  die('Access Denied');
373
  }
374
  }
@@ -408,7 +408,7 @@ final class WDS {
408
  */
409
  function demo_sliders() {
410
  if (function_exists('current_user_can')) {
411
- if (!current_user_can('manage_options')) {
412
  die('Access Denied');
413
  }
414
  }
@@ -442,7 +442,7 @@ final class WDS {
442
  */
443
  function admin_ajax() {
444
  if (function_exists('current_user_can')) {
445
- if (!current_user_can('manage_options')) {
446
  die('Access Denied');
447
  }
448
  }
@@ -531,7 +531,7 @@ final class WDS {
531
 
532
  function filemanager_ajax() {
533
  if (function_exists('current_user_can')) {
534
- if (!current_user_can('manage_options')) {
535
  die('Access Denied');
536
  }
537
  }
@@ -904,7 +904,7 @@ final class WDS {
904
 
905
  function add_embed_ajax() {
906
  if (function_exists('current_user_can')) {
907
- if (!current_user_can('manage_options')) {
908
  die('Access Denied');
909
  }
910
  }
@@ -1039,7 +1039,7 @@ final class WDS {
1039
  "plugin_menu_title" => "Slider",
1040
  "plugin_menu_icon" => $this->plugin_url . '/images/wd_slider.png',
1041
  "deactivate" => ( $this->is_free ? TRUE : FALSE ),
1042
- "subscribe" => ( $this->is_free ? TRUE : FALSE ),
1043
  "custom_post" => '',
1044
  "menu_position" => null,
1045
  "display_overview" => false,
@@ -1121,7 +1121,7 @@ final class WDS {
1121
  */
1122
  function media_upload_window() {
1123
  if (function_exists('current_user_can')) {
1124
- if (!current_user_can('manage_options')) {
1125
  die('Access Denied');
1126
  }
1127
  }
@@ -1311,26 +1311,3 @@ function wds_get_sliders() {
1311
  }
1312
  return $sliders;
1313
  }
1314
-
1315
- /**
1316
- * Show 10Web plugin's install/activate banner.
1317
- */
1318
- if ( !class_exists ( 'TWBanner' ) ) {
1319
- require_once( WDS()->plugin_dir . '/banner_class.php' );
1320
- }
1321
- if ( WDS()->is_free ) {
1322
- $tw_banner_params = array(
1323
- 'menu_postfix' => '_' . WDS()->prefix, // To display on only current plugin pages.
1324
- 'prefix' => WDS()->prefix, // Current plugin prefix.
1325
- 'logo' => '/images/wt-gb/wd_slider.svg', // Current plugin logo relative URL.
1326
- 'plugin_slug' => 'slider-wd', // Current plugin slug.
1327
- 'plugin_url' => WDS()->plugin_url, // Current plugin URL.
1328
- 'plugin_id' => 97, // Current plugin id.
1329
- 'text' => sprintf(__("%s Slider advises:%s %sUse Image Optimizer service to optimize your images quickly and easily.%s", WDS()->prefix), '<span>','</span>', '<span>','</span>'), // Banner text.
1330
- 'slug' => '10web-manager', // Plugin slug to be installed.
1331
- 'mu_plugin_slug' => '10web-manager', // Must use plugin slug.
1332
- 'base_php' => '10web-manager.php', // Plugin base php filename to be installed.
1333
- 'page_url' => admin_url('admin.php?page=tenweb_menu'), // Redirect to URL after activating the plugin.
1334
- );
1335
- new TWBanner($tw_banner_params);
1336
- }
3
  * Plugin Name: Slider by 10Web
4
  * Plugin URI: https://10web.io/plugins/wordpress-slider/?utm_source=slider&utm_medium=free_plugin
5
  * Description: This is a responsive plugin, which allows adding sliders to your posts/pages and to custom location. It uses large number of transition effects and supports various types of layers.
6
+ * Version: 1.2.32
7
  * Author: 10Web
8
  * Author URI: https://10web.io/pricing/?utm_source=slider&utm_medium=free_plugin
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
46
  public $is_free = TRUE;
47
  public $upload_dir = '';
48
  public $free_msg = '';
49
+ public $options = array();
50
 
51
  /**
52
  * Main WDS Instance.
79
  $this->plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
80
  $this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
81
  $this->main_file = plugin_basename(__FILE__);
82
+ $this->plugin_version = '1.2.32';
83
+ $this->db_version = '1.2.32';
84
  $this->prefix = 'wds';
85
  $this->nicename = __('Slider', $this->prefix);
86
  $this->use_home_url();
88
  $this->upload_dir = str_replace(ABSPATH, '', $upload_dir['basedir']) . '/slider-wd';
89
  $this->site_url_placeholder = '@#$%';
90
  $this->site_url_buttons_placeholder = '@##$%';
91
+ $global_options = get_option($this->prefix . '_global_options');
92
+ $this->options = !empty($global_options) ? json_decode($global_options) : array();
93
+ $this->options->permission = isset($this->options->permission) && $this->options->permission ? $this->options->permission : 'manage_options';
94
  }
95
 
96
  private function use_home_url() {
280
  * Plugin menu.
281
  */
282
  function admin_menu() {
283
+ $parent_slug = "sliders_wds";
284
+ add_menu_page($this->nicename, $this->nicename, $this->options->permission, 'sliders_' . $this->prefix, array($this, 'admin_pages_new'), $this->plugin_url . '/images/wd_slider.png');
 
 
 
285
 
286
+ $sliders_page = add_submenu_page($parent_slug, __('Sliders', $this->prefix), __('Sliders', $this->prefix), $this->options->permission, 'sliders_'. $this->prefix, array($this, 'admin_pages_new'));
287
  add_action('admin_print_styles-' . $sliders_page, array($this, 'admin_styles'));
288
  add_action('admin_print_scripts-' . $sliders_page, array($this, 'admin_scripts'));
289
  add_action('load-' . $sliders_page, array($this, 'sliders_per_page_option'));
292
  add_action('admin_print_styles-' . $global_options_page, array($this, 'admin_styles'));
293
  add_action('admin_print_scripts-' . $global_options_page, array($this, 'admin_scripts'));
294
 
295
+ $demo_slider = add_submenu_page($parent_slug, __('Import', $this->prefix), __('Import', $this->prefix), $this->options->permission, 'demo_sliders_wds', array($this, 'demo_sliders'));
296
  add_action('admin_print_styles-' . $demo_slider, array($this, 'admin_styles'));
297
  add_action('admin_print_scripts-' . $demo_slider, array($this, 'admin_scripts'));
298
 
366
  $controller->execute();
367
  }
368
  }
 
369
  function admin_pages() {
370
  if (function_exists('current_user_can')) {
371
+ if (!current_user_can($this->options->permission)) {
372
  die('Access Denied');
373
  }
374
  }
408
  */
409
  function demo_sliders() {
410
  if (function_exists('current_user_can')) {
411
+ if (!current_user_can($this->options->permission)) {
412
  die('Access Denied');
413
  }
414
  }
442
  */
443
  function admin_ajax() {
444
  if (function_exists('current_user_can')) {
445
+ if (!current_user_can($this->options->permission)) {
446
  die('Access Denied');
447
  }
448
  }
531
 
532
  function filemanager_ajax() {
533
  if (function_exists('current_user_can')) {
534
+ if (!current_user_can($this->options->permission)) {
535
  die('Access Denied');
536
  }
537
  }
904
 
905
  function add_embed_ajax() {
906
  if (function_exists('current_user_can')) {
907
+ if (!current_user_can($this->options->permission)) {
908
  die('Access Denied');
909
  }
910
  }
1039
  "plugin_menu_title" => "Slider",
1040
  "plugin_menu_icon" => $this->plugin_url . '/images/wd_slider.png',
1041
  "deactivate" => ( $this->is_free ? TRUE : FALSE ),
1042
+ "subscribe" => FALSE,
1043
  "custom_post" => '',
1044
  "menu_position" => null,
1045
  "display_overview" => false,
1121
  */
1122
  function media_upload_window() {
1123
  if (function_exists('current_user_can')) {
1124
+ if (!current_user_can($this->options->permission)) {
1125
  die('Access Denied');
1126
  }
1127
  }
1311
  }
1312
  return $sliders;
1313
  }