PluginProbe
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News / 2.2.10
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News v2.2.10
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 2.3.5 2.3.6 2.4.0 2.4.1 2.4.10 2.4.11 2.4.12 2.4.13 2.4.14 2.4.15 2.4.16 2.4.17 2.4.18 2.4.19 2.4.2 2.4.20 2.4.21 All 88 releases
← All changes | admin/views/sp-framework/classes/options.class.php +139 -294 2.4.212.2.10 View file →
@@ -1,88 +1,28 @@
1 -<?php
1 +<?php if ( ! defined( 'ABSPATH' ) ) {
2 + die; } // Cannot access directly.
2 3 /**
3 - * The options class of the plugin.
4 4 *
5 - * @package Smart_Post_Show
6 - * @subpackage Smart_Post_Show/views/sp-framework/classes
5 + * Options Class
6 + *
7 + * @since 1.0.0
8 + * @version 1.0.0
7 9 */
8 -
9 -if ( ! defined( 'ABSPATH' ) ) {
10 - die; } // Cannot access directly.
11 -
12 10 if ( ! class_exists( 'SP_PC_Options' ) ) {
13 - /**
14 - * Options Class
15 - *
16 - * @since 1.0.0
17 - * @version 1.0.0
18 - */
19 11 class SP_PC_Options extends SP_PC_Abstract {
20 12
21 - /**
22 - * Unique ID/Name
23 - *
24 - * @var string
25 - */
26 - public $unique = '';
27 - /**
28 - * Notice.
29 - *
30 - * @var string
31 - */
32 - public $notice = '';
33 - /**
34 - * Abstract.
35 - *
36 - * @var string
37 - */
38 - public $abstract = 'options';
39 - /**
40 - * Setions.
41 - *
42 - * @var array
43 - */
44 - public $sections = array();
45 - /**
46 - * Options
47 - *
48 - * @var array
49 - */
50 - public $options = array();
51 -
52 - /**
53 - * Errors.
54 - *
55 - * @var array
56 - */
57 - public $errors = array();
58 -
59 - /**
60 - * Pre tabs.
61 - *
62 - * @var array
63 - */
64 - public $pre_tabs = array();
65 -
66 - /**
67 - * Pre fields.
68 - *
69 - * @var array
70 - */
71 - public $pre_fields = array();
72 -
73 - /**
74 - * Pre sections.
75 - *
76 - * @var array
77 - */
13 + // constans.
14 + public $unique = '';
15 + public $notice = '';
16 + public $abstract = 'options';
17 + public $sections = array();
18 + public $options = array();
19 + public $errors = array();
20 + public $pre_tabs = array();
21 + public $pre_fields = array();
78 22 public $pre_sections = array();
79 23
80 - /**
81 - * Default arguments.
82 - *
83 - * @var array
84 - */
24 + // default args.
85 25 public $args = array(
86 26
87 27 // framework title.
88 28 'framework_title' => 'SPF Framework <small>by SP</small>',
@@ -91,9 +31,9 @@
91 31 // menu settings.
92 32 'menu_title' => '',
93 33 'menu_slug' => '',
94 34 'menu_type' => 'menu',
95 - // 'menu_capability' => 'manage_options', It's implemented in add_admin_menu()
35 + 'menu_capability' => 'manage_options',
96 36 'menu_icon' => null,
97 37 'menu_position' => null,
98 38 'menu_hidden' => false,
99 39 'menu_parent' => '',
@@ -146,14 +86,9 @@
146 86 'defaults' => array(),
147 87
148 88 );
149 89
150 - /**
151 - * Run framework construct.
152 - *
153 - * @param string $key The filter unique key.
154 - * @param array $params The parameters.
155 - */
90 + // run framework construct.
156 91 public function __construct( $key, $params = array() ) {
157 92
158 93 $this->unique = $key;
159 94 $this->args = apply_filters( "spf_{$this->unique}_args", wp_parse_args( $params['args'], $this->args ), $this );
@@ -180,24 +115,13 @@
180 115 parent::__construct();
181 116
182 117 }
183 118
184 - /**
185 - * Instance.
186 - *
187 - * @param object $key The instance key.
188 - * @param array $params All the parameters.
189 - * @return mixed
190 - */
119 + // instance.
191 120 public static function instance( $key, $params = array() ) {
192 121 return new self( $key, $params );
193 122 }
194 - /**
195 - * Pre tabs.
196 - *
197 - * @param array $sections All the sections.
198 - * @return mixed
199 - */
123 +
200 124 public function pre_tabs( $sections ) {
201 125
202 126 $result = array();
203 127 $parents = array();
@@ -223,14 +147,8 @@
223 147
224 148 return wp_list_sort( $result, array( 'priority' => 'ASC' ), 'ASC', true );
225 149 }
226 150
227 - /**
228 - * Pre fields method.
229 - *
230 - * @param array $sections The sections.
231 - * @return $result
232 - */
233 151 public function pre_fields( $sections ) {
234 152
235 153 $result = array();
236 154
@@ -244,14 +162,8 @@
244 162
245 163 return $result;
246 164 }
247 165
248 - /**
249 - * The pre sections.
250 - *
251 - * @param array $sections The sections.
252 - * @return mixed
253 - */
254 166 public function pre_sections( $sections ) {
255 167
256 168 $result = array();
257 169
@@ -268,14 +180,9 @@
268 180
269 181 return $result;
270 182 }
271 183
272 - /**
273 - * Add admin bar menu.
274 - *
275 - * @param object $wp_admin_bar The admin bar.
276 - * @return void
277 - */
184 + // add admin bar menu.
278 185 public function add_admin_bar_menu( $wp_admin_bar ) {
279 186
280 187 if ( ! empty( $this->args['show_bar_menu'] ) && empty( $this->args['menu_hidden'] ) ) {
281 188
@@ -318,45 +225,43 @@
318 225 }
319 226
320 227 }
321 228
322 - /**
323 - * Ajax save method.
324 - *
325 - * @return void
326 - */
327 229 public function ajax_save() {
328 230
329 - $result = $this->set_options( true );
330 - if ( ! $result ) {
331 - wp_send_json_error(
332 - array(
333 - 'success' => false,
334 - 'error' => esc_html__(
335 - 'Error while saving.',
336 - 'post-carousel'
337 - ),
338 - )
339 - );
231 + if ( ! empty( $_POST['data'] ) ) {
340 232
341 - } else {
342 - wp_send_json_success(
343 - array(
344 - 'success' => true,
345 - 'notice' => $this->notice,
346 - 'errors' => $this->errors,
347 - )
348 - );
233 + $_POST = json_decode( stripslashes( $_POST['data'] ), true );
234 +
235 + // if ( ! empty( $_POST['spf_options_nonce'] ) && wp_verify_nonce( $_POST['spf_options_nonce'], 'spf_options_nonce' ) ) {
236 + if ( wp_verify_nonce( spf_get_var( 'spf_options_nonce' . $this->unique ), 'spf_options_nonce' ) ) {
237 +
238 + $this->set_options();
239 +
240 + wp_send_json_success(
241 + array(
242 + 'success' => true,
243 + 'notice' => $this->notice,
244 + 'errors' => $this->errors,
245 + )
246 + );
247 +
248 + }
349 249 }
250 +
251 + wp_send_json_error(
252 + array(
253 + 'success' => false,
254 + 'error' => esc_html__(
255 + 'Error while saving.',
256 + 'smart-post-show'
257 + ),
258 + )
259 + );
260 +
350 261 }
351 262
352 - /**
353 - * Get default value.
354 - *
355 - * @param array $field The field array.
356 - * @param array $options The options array.
357 - * @return mixed
358 - */
263 + // get default value
359 264 public function get_default( $field, $options = array() ) {
360 265
361 266 $default = ( isset( $this->args['defaults'][ $field['id'] ] ) ) ? $this->args['defaults'][ $field['id'] ] : '';
362 267 $default = ( isset( $field['default'] ) ) ? $field['default'] : $default;
@@ -365,13 +270,9 @@
365 270 return $default;
366 271
367 272 }
368 273
369 - /**
370 - * Save defaults and set new fields value to main options.
371 - *
372 - * @return void
373 - */
274 + // save defaults and set new fields value to main options.
374 275 public function save_defaults() {
375 276
376 277 $tmp_options = $this->options;
377 278
@@ -386,54 +287,34 @@
386 287 }
387 288
388 289 }
389 290
390 - /**
391 - * Set options.
392 - *
393 - * @param boolean $ajax The ajax save.
394 - *
395 - * @return mixed
396 - */
397 - public function set_options( $ajax = false ) {
291 + // set options.
292 + public function set_options() {
398 293
399 - // XSS ok.
400 - // No worries, This "POST" requests is sanitizing in the below foreach. see #L380 - #L384.
401 - $response = ( $ajax && ! empty( $_POST['data'] ) ) ? json_decode( wp_unslash( trim( $_POST['data'] ) ), true ) : $_POST; // phpcs:ignore
294 + if ( wp_verify_nonce( spf_get_var( 'spf_options_nonce' . $this->unique ), 'spf_options_nonce' ) ) {
402 295
403 - // Set variables.
404 - $data = array();
405 - $noncekey = 'spf_options_nonce' . $this->unique;
406 - $nonce = ( ! empty( $response[ $noncekey ] ) ) ? $response[ $noncekey ] : '';
407 - $options = ( ! empty( $response[ $this->unique ] ) ) ? $response[ $this->unique ] : array();
408 - $transient = ( ! empty( $response['spf_transient'] ) ) ? $response['spf_transient'] : array();
409 -
410 - if ( wp_verify_nonce( $nonce, 'spf_options_nonce' ) ) {
411 -
412 - $importing = false;
296 + $request = spf_get_var( $this->unique, array() );
297 + $transient = spf_get_var( 'spf_transient' );
413 298 $section_id = ( ! empty( $transient['section'] ) ) ? $transient['section'] : '';
414 299
415 300 // import data.
416 - if ( ! $ajax && ! empty( $response['spf_import_data'] ) ) {
301 + if ( ! empty( $transient['spf_import_data'] ) ) {
417 302
418 - // XSS ok.
419 - // No worries, This "POST" requests is sanitizing in the below foreach. see #L380 - #L384.
420 - $import_data = json_decode( wp_unslash( trim( $response['spf_import_data'] ) ), true );
421 - $options = ( is_array( $import_data ) && ! empty( $import_data ) ) ? $import_data : array();
422 - $importing = true;
423 - $this->notice = esc_html__( 'Settings successfully imported.', 'post-carousel' );
303 + $import_data = json_decode( stripslashes( trim( $transient['spf_import_data'] ) ), true );
304 + $request = ( is_array( $import_data ) ) ? $import_data : array();
424 305
425 - }
306 + $this->notice = esc_html__( 'Success. Imported backup options.', 'smart-post-show' );
426 307
427 - if ( ! empty( $transient['reset'] ) ) {
308 + } elseif ( ! empty( $transient['reset'] ) ) {
428 309
429 310 foreach ( $this->pre_fields as $field ) {
430 311 if ( ! empty( $field['id'] ) ) {
431 - $data[ $field['id'] ] = $this->get_default( $field );
312 + $request[ $field['id'] ] = $this->get_default( $field );
432 313 }
433 314 }
434 315
435 - $this->notice = esc_html__( 'Default options restored.', 'post-carousel' );
316 + $this->notice = esc_html__( 'Default options restored.', 'smart-post-show' );
436 317
437 318 } elseif ( ! empty( $transient['reset_section'] ) && ! empty( $section_id ) ) {
438 319
439 320 if ( ! empty( $this->pre_sections[ $section_id - 1 ]['fields'] ) ) {
@@ -439,15 +320,14 @@
439 320 if ( ! empty( $this->pre_sections[ $section_id - 1 ]['fields'] ) ) {
440 321
441 322 foreach ( $this->pre_sections[ $section_id - 1 ]['fields'] as $field ) {
442 323 if ( ! empty( $field['id'] ) ) {
443 - $data[ $field['id'] ] = $this->get_default( $field );
324 + $request[ $field['id'] ] = $this->get_default( $field );
444 325 }
445 326 }
446 327 }
447 328
448 - $data = wp_parse_args( $data, $this->options );
449 - $this->notice = esc_html__( 'Default options restored for only this section.', 'post-carousel' );
329 + $this->notice = esc_html__( 'Default options restored for only this section.', 'smart-post-show' );
450 330
451 331 } else {
452 332
453 333 // sanitize and validate.
@@ -454,104 +334,87 @@
454 334 foreach ( $this->pre_fields as $field ) {
455 335
456 336 if ( ! empty( $field['id'] ) ) {
457 337
458 - $field_id = $field['id'];
459 - $field_value = isset( $options[ $field_id ] ) ? $options[ $field_id ] : '';
460 -
461 - // Ajax and Importing doing wp_unslash already.
462 - if ( ! $ajax && ! $importing ) {
463 - $field_value = wp_unslash( $field_value );
464 - }
465 -
466 338 // sanitize.
467 - if ( ! isset( $field['sanitize'] ) ) {
468 - if ( is_array( $field_value ) ) {
339 + if ( ! empty( $field['sanitize'] ) ) {
469 340
470 - $data[ $field_id ] = wp_kses_post_deep( $field_value );
341 + $sanitize = $field['sanitize'];
342 + $value_sanitize = isset( $request[ $field['id'] ] ) ? $request[ $field['id'] ] : '';
343 + $request[ $field['id'] ] = call_user_func( $sanitize, $value_sanitize );
471 344
472 - } else {
473 -
474 - $data[ $field_id ] = wp_kses_post( $field_value );
475 - }
476 - } elseif ( isset( $field['sanitize'] ) && is_callable( $field['sanitize'] ) ) {
477 -
478 - $data[ $field_id ] = call_user_func( $field['sanitize'], $field_value );
479 -
480 - } else {
481 - $data[ $field_id ] = $field_value;
482 -
483 345 }
484 346
485 - // Validate "post" request of field.
486 - if ( isset( $field['validate'] ) && is_callable( $field['validate'] ) ) {
347 + // validate.
348 + if ( ! empty( $field['validate'] ) ) {
487 349
488 - $has_validated = call_user_func( $field['validate'], $field_value );
350 + $value_validate = isset( $request[ $field['id'] ] ) ? $request[ $field['id'] ] : '';
351 + $has_validated = call_user_func( $field['validate'], $value_validate );
489 352
490 353 if ( ! empty( $has_validated ) ) {
491 - $data[ $field_id ] = ( isset( $this->options[ $field_id ] ) ) ? $this->options[ $field_id ] : '';
492 - $this->errors[ $field_id ] = $has_validated;
354 + $request[ $field['id'] ] = ( isset( $this->options[ $field['id'] ] ) ) ? $this->options[ $field['id'] ] : '';
355 + $this->errors[ $field['id'] ] = $has_validated;
493 356 }
494 357 }
358 +
359 + // auto sanitize.
360 + if ( ! isset( $request[ $field['id'] ] ) || is_null( $request[ $field['id'] ] ) ) {
361 + $request[ $field['id'] ] = '';
362 + }
495 363 }
496 364 }
497 365 }
498 366
499 - $data = apply_filters( "spf_{$this->unique}_save", $data, $this );
367 + // ignore nonce requests.
368 + if ( isset( $request['_nonce'] ) ) {
369 + unset( $request['_nonce'] ); }
500 370
501 - do_action( "spf_{$this->unique}_save_before", $data, $this );
371 + $request = wp_unslash( $request );
502 372
503 - $this->options = $data;
373 + $request = apply_filters( "spf_{$this->unique}_save", $request, $this );
504 374
505 - $this->save_options( $data );
375 + do_action( "spf_{$this->unique}_save_before", $request, $this );
506 376
507 - do_action( "spf_{$this->unique}_save_after", $data, $this );
377 + $this->options = $request;
508 378
379 + $this->save_options( $request );
380 +
381 + do_action( "spf_{$this->unique}_save_after", $request, $this );
382 +
509 383 if ( empty( $this->notice ) ) {
510 - $this->notice = esc_html__( 'Settings saved.', 'post-carousel' );
384 + $this->notice = esc_html__( 'Settings saved.', 'smart-post-show' );
511 385 }
512 -
513 - return true;
514 386 }
515 387
516 - return false;
388 + return true;
517 389
518 390 }
519 391
520 - /**
521 - * Save options database.
522 - *
523 - * @param array $data The options values.
524 - * @return void
525 - */
526 - public function save_options( $data ) {
392 + // save options database.
393 + public function save_options( $request ) {
527 394
528 - if ( 'transient' === $this->args['database'] ) {
529 - set_transient( $this->unique, $data, $this->args['transient_time'] );
530 - } elseif ( 'theme_mod' === $this->args['database'] ) {
531 - set_theme_mod( $this->unique, $data );
532 - } elseif ( 'network' === $this->args['database'] ) {
533 - update_site_option( $this->unique, $data );
395 + if ( $this->args['database'] === 'transient' ) {
396 + set_transient( $this->unique, $request, $this->args['transient_time'] );
397 + } elseif ( $this->args['database'] === 'theme_mod' ) {
398 + set_theme_mod( $this->unique, $request );
399 + } elseif ( $this->args['database'] === 'network' ) {
400 + update_site_option( $this->unique, $request );
534 401 } else {
535 - update_option( $this->unique, $data );
402 + update_option( $this->unique, $request );
536 403 }
537 404
538 - do_action( "spf_{$this->unique}_saved", $data, $this );
405 + do_action( "spf_{$this->unique}_saved", $request, $this );
539 406
540 407 }
541 408
542 - /**
543 - * Get options from database.
544 - *
545 - * @return mixed
546 - */
409 + // get options from database.
547 410 public function get_options() {
548 411
549 - if ( 'transient' === $this->args['database'] ) {
412 + if ( $this->args['database'] === 'transient' ) {
550 413 $this->options = get_transient( $this->unique );
551 - } elseif ( 'theme_mod' === $this->args['database'] ) {
414 + } elseif ( $this->args['database'] === 'theme_mod' ) {
552 415 $this->options = get_theme_mod( $this->unique );
553 - } elseif ( 'network' === $this->args['database'] ) {
416 + } elseif ( $this->args['database'] === 'network' ) {
554 417 $this->options = get_site_option( $this->unique );
555 418 } else {
556 419 $this->options = get_option( $this->unique );
557 420 }
@@ -564,18 +427,16 @@
564 427
565 428 }
566 429
567 430 /**
568 - * WP api – admin menu.
431 + * wp api: admin menu.
569 432 */
570 433 public function add_admin_menu() {
571 - // Show plugin setting menu as per user role. – ShapedPlugin
572 - // Use the hook 'sp_pc_dashboard_capability' to change user capability.
573 - $menu_capability = apply_filters( 'sp_pc_dashboard_capability', 'manage_options' );
574 - extract( $this->args ); // phpcs:ignore
575 434
576 - if ( 'submenu' === $menu_type ) {
435 + extract( $this->args );
577 436
437 + if ( $menu_type === 'submenu' ) {
438 +
578 439 $menu_page = call_user_func( 'add_submenu_page', $menu_parent, $menu_title, $menu_title, $menu_capability, $menu_slug, array( &$this, 'add_options_html' ) );
579 440
580 441 } else {
581 442
@@ -676,10 +537,8 @@
676 537 public function add_options_html() {
677 538
678 539 $has_nav = ( count( $this->pre_tabs ) > 1 ) ? true : false;
679 540 $show_all = ( ! $has_nav ) ? ' spf-show-all' : '';
680 - $show_buttons = isset( $this->args['show_buttons'] ) ? $this->args['show_buttons'] : true;
681 - $menu_slug = isset( $this->args['menu_slug'] ) ? $this->args['menu_slug'] : '';
682 541 $ajax_class = ( $this->args['ajax_save'] ) ? ' spf-save-ajax' : '';
683 542 $sticky_class = ( $this->args['sticky_header'] ) ? ' spf-sticky-header' : '';
684 543 $wrapper_class = ( $this->args['framework_class'] ) ? ' ' . $this->args['framework_class'] : '';
685 544 $theme = ( $this->args['theme'] ) ? ' spf-theme-' . $this->args['theme'] : '';
@@ -684,25 +543,22 @@
684 543 $wrapper_class = ( $this->args['framework_class'] ) ? ' ' . $this->args['framework_class'] : '';
685 544 $theme = ( $this->args['theme'] ) ? ' spf-theme-' . $this->args['theme'] : '';
686 545 $class = ( $this->args['class'] ) ? ' ' . $this->args['class'] : '';
687 546
688 - if ( 'pcp_replace_layout' === $menu_slug ) {
689 - echo '<div class="wrap pcp_replace_layout_notice"><p class="spf-text-desc">To unlock the Replace Layout on The Default Blog, WooCommerce Shop, Category, Tag, Taxonomy, Search, Author, Date... Pages, and Post Types, <a target="__blank" href="https://smartpostshow.com/"><b>Upgrade To Pro</b></a></p></div>';
690 - }
547 + echo '<div class="wrap"><h1>' . $this->args['menu_title'] . '</h1></div>';
548 + echo '<div class="spf spf-options' . $theme . $class . $wrapper_class . '" data-slug="' . $this->args['menu_slug'] . '" data-unique="' . $this->unique . '">';
691 549
692 - echo '<div class="spf spf-options' . esc_attr( $theme ) . esc_attr( $class ) . esc_attr( $wrapper_class ) . '" data-slug="' . esc_attr( $this->args['menu_slug'] ) . '" data-unique="' . esc_attr( $this->unique ) . '">';
693 -
694 550 $notice_class = ( ! empty( $this->notice ) ) ? ' spf-form-show' : '';
695 551 $notice_text = ( ! empty( $this->notice ) ) ? $this->notice : '';
696 552
697 - // echo '<div class="spf-form-result spf-form-success' . esc_attr( $notice_class ) . '">' . esc_html( $notice_text ) . '</div>';
553 + echo '<div class="spf-form-result spf-form-success' . $notice_class . '">' . $notice_text . '</div>';
698 554
699 555 $error_class = ( ! empty( $this->errors ) ) ? ' spf-form-show' : '';
700 556
701 - echo '<div class="spf-form-result spf-form-error' . esc_attr( $error_class ) . '">';
557 + echo '<div class="spf-form-result spf-form-error' . $error_class . '">';
702 558 if ( ! empty( $this->errors ) ) {
703 559 foreach ( $this->errors as $error ) {
704 - echo '<i class="spf-label-error">!</i> ' . esc_html( $error ) . '<br />';
560 + echo '<i class="spf-label-error">!</i> ' . $error . '<br />';
705 561 }
706 562 }
707 563 echo '</div>';
708 564
@@ -716,41 +572,30 @@
716 572 echo '<div class="spf-header' . esc_attr( $sticky_class ) . '">';
717 573 echo '<div class="spf-header-inner">';
718 574
719 575 echo '<div class="spf-header-left">';
720 - if ( 'pcp_replace_layout' === $menu_slug ) {
721 - echo '<h1><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve">
722 - <style type="text/css">
723 - .st0{fill:#D64224;}
724 - </style>
725 - <path class="st0" d="M0,69.3V0h69.4v18.6H18.6v50.7L0,69.3L0,69.3z M100,100H30.6V30.7H100V100z"/>
726 - </svg>' . esc_html__( 'Replace Layout', 'post-carousel' ) . '</h1>';
727 - } elseif ( $show_buttons ) {
728 - echo '<h1><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1.4em" fill="#e1624b" height="1.4em" viewBox="0 0 288 288" enable-background="new 0 0 288 288" xml:space="preserve"><path fill="#e1624b" d="M262.102,20.977H27.615c-3.195,0-6.638,2.401-6.638,5.63v234.359c0,3.229,3.443,6.057,6.638,6.057h234.487c3.187,0,4.921-2.828,4.921-6.057V26.607C267.023,23.378,265.289,20.977,262.102,20.977z M118.37,53.441h51.26v43.571h-51.26V53.441z M55.15,53.441h51.26v43.571H55.15V53.441z M135.457,235.413H55.15v-46.134h80.307V235.413z M135.457,173.047H55.15v-46.134h80.307V173.047z M235.413,235.413h-80.307v-46.134h80.307V235.413z M235.413,173.047h-80.307v-46.134h80.307V173.047z M235.413,97.012h-51.26V53.441h51.26V97.012z"></path><line fill="none" x1="-99" y1="-84" x2="-99" y2="-57"></line><line fill="none" x1="-170" y1="61" x2="-170" y2="101"></line></svg>' . esc_html__( 'Settings', 'post-carousel' ) . '</h1>';
729 - } else {
730 - echo '<h1 class="export-import"><img src="' . esc_url( SP_PC_URL ) . 'admin/assets/img/import-export.svg">' . esc_html( $this->args['framework_title'] ) . '</h1>';
731 - }
576 + echo '<h1><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1.4em" fill="#e1624b" height="1.4em" viewBox="0 0 288 288" enable-background="new 0 0 288 288" xml:space="preserve"><path fill="#e1624b" d="M262.102,20.977H27.615c-3.195,0-6.638,2.401-6.638,5.63v234.359c0,3.229,3.443,6.057,6.638,6.057h234.487c3.187,0,4.921-2.828,4.921-6.057V26.607C267.023,23.378,265.289,20.977,262.102,20.977z M118.37,53.441h51.26v43.571h-51.26V53.441z M55.15,53.441h51.26v43.571H55.15V53.441z M135.457,235.413H55.15v-46.134h80.307V235.413z M135.457,173.047H55.15v-46.134h80.307V173.047z M235.413,235.413h-80.307v-46.134h80.307V235.413z M235.413,173.047h-80.307v-46.134h80.307V173.047z M235.413,97.012h-51.26V53.441h51.26V97.012z"/><line fill="none" x1="-99" y1="-84" x2="-99" y2="-57"/><line fill="none" x1="-170" y1="61" x2="-170" y2="101"/></svg>' . esc_html__( 'Settings', 'smart-post-show' ) . '</h1>';
732 577 echo '</div>';
733 578
734 579 echo '<div class="spf-header-right">';
735 580
736 - echo ( $has_nav && $this->args['show_all_options'] ) ? '<div class="spf-expand-all" title="' . esc_html__( 'show all options', 'post-carousel' ) . '"><i class="fa fa-outdent"></i></div>' : '';
581 + echo ( $has_nav && $this->args['show_all_options'] ) ? '<div class="spf-expand-all" title="' . esc_html__( 'show all options', 'smart-post-show' ) . '"><i class="fa fa-outdent"></i></div>' : '';
737 582
738 - echo ( $this->args['show_search'] ) ? '<div class="spf-search"><input type="text" name="spf-search" placeholder="' . esc_html__( 'Search option(s)', 'post-carousel' ) . '" autocomplete="off" /></div>' : '';
739 - if ( $show_buttons ) {
740 - echo '<div class="spf-buttons">';
741 - echo '<input type="submit" name="' . esc_attr( $this->unique ) . '[_nonce][save]" class="button button-primary spf-save' . esc_attr( $ajax_class ) . '" value="' . esc_html__( 'Save Settings', 'post-carousel' ) . '" data-save="' . esc_html__( 'Saving...', 'post-carousel' ) . '">';
742 - echo ( $this->args['show_reset_section'] ) ? '<input type="submit" name="spf_transient[reset_section]" class="button button-secondary spf-reset-section spf-confirm" value="' . esc_html__( 'Reset Tab', 'post-carousel' ) . '" data-confirm="' . esc_html__( 'Are you sure you want to reset all settings to default values?', 'post-carousel' ) . '">' : '';
743 - echo ( $this->args['show_reset_all'] ) ? '<input type="submit" name="spf_transient[reset]" class="button spf-reset-all spf-confirm" value="' . esc_html__( 'Reset All', 'post-carousel' ) . '" data-confirm="' . esc_html__( 'Are you sure to reset all options?', 'post-carousel' ) . '">' : '';
744 - echo '</div>';
745 - }
583 + echo ( $this->args['show_search'] ) ? '<div class="spf-search"><input type="text" name="spf-search" placeholder="' . esc_html__( 'Search option(s)', 'smart-post-show' ) . '" autocomplete="off" /></div>' : '';
584 +
585 + echo '<div class="spf-buttons">';
586 + echo '<input type="submit" name="' . $this->unique . '[_nonce][save]" class="button button-primary spf-save' . $ajax_class . '" value="' . esc_html__( 'Save', 'smart-post-show' ) . '" data-save="' . esc_html__( 'Saving...', 'smart-post-show' ) . '">';
587 + echo ( $this->args['show_reset_section'] ) ? '<input type="submit" name="spf_transient[reset_section]" class="button button-secondary spf-reset-section spf-confirm" value="' . esc_html__( 'Reset Section', 'smart-post-show' ) . '" data-confirm="' . esc_html__( 'Are you sure to reset this section options?', 'smart-post-show' ) . '">' : '';
588 + echo ( $this->args['show_reset_all'] ) ? '<input type="submit" name="spf_transient[reset]" class="button spf-reset-all spf-confirm" value="' . esc_html__( 'Reset All', 'smart-post-show' ) . '" data-confirm="' . esc_html__( 'Are you sure to reset all options?', 'smart-post-show' ) . '">' : '';
746 589 echo '</div>';
747 590
591 + echo '</div>';
592 +
748 593 echo '<div class="clear"></div>';
749 594 echo '</div>';
750 595 echo '</div>';
751 596
752 - echo '<div class="spf-wrapper' . esc_attr( $show_all ) . '">';
597 + echo '<div class="spf-wrapper' . $show_all . '">';
753 598
754 599 if ( $has_nav ) {
755 600 echo '<div class="spf-nav spf-nav-options">';
756 601
@@ -766,9 +611,9 @@
766 611 if ( ! empty( $tab['subs'] ) ) {
767 612
768 613 echo '<li class="spf-tab-depth-0">';
769 614
770 - echo '<a href="#tab=' . esc_attr( $tab_key ) . '" class="spf-arrow">' . wp_kses_post( $tab_icon ) . esc_html( $tab['title'] ) . esc_html( $tab_error ) . '</a>';
615 + echo '<a href="#tab=' . $tab_key . '" class="spf-arrow">' . $tab_icon . $tab['title'] . $tab_error . '</a>';
771 616
772 617 echo '<ul>';
773 618
774 619 foreach ( $tab['subs'] as $sub ) {
@@ -775,9 +620,9 @@
775 620
776 621 $sub_error = $this->error_check( $sub );
777 622 $sub_icon = ( ! empty( $sub['icon'] ) ) ? '<i class="' . $sub['icon'] . '"></i>' : '';
778 623
779 - echo '<li class="spf-tab-depth-1"><a id="spf-tab-link-' . esc_attr( $tab_key ) . '" href="#tab=' . esc_attr( $tab_key ) . '">' . wp_kses_post( $sub_icon ) . esc_html( $sub['title'] ) . esc_html( $sub_error ) . '</a></li>';
624 + echo '<li class="spf-tab-depth-1"><a id="spf-tab-link-' . $tab_key . '" href="#tab=' . $tab_key . '">' . $sub_icon . $sub['title'] . $sub_error . '</a></li>';
780 625
781 626 $tab_key++;
782 627 }
783 628
@@ -786,9 +631,9 @@
786 631 echo '</li>';
787 632
788 633 } else {
789 634
790 - echo '<li class="spf-tab-depth-0"><a id="spf-tab-link-' . esc_attr( $tab_key ) . '" href="#tab=' . esc_attr( $tab_key ) . '">' . wp_kses_post( $tab_icon ) . esc_html( $tab['title'] ) . esc_html( $tab_error ) . '</a></li>';
635 + echo '<li class="spf-tab-depth-0"><a id="spf-tab-link-' . $tab_key . '" href="#tab=' . $tab_key . '">' . $tab_icon . $tab['title'] . $tab_error . '</a></li>';
791 636
792 637 $tab_key++;
793 638 }
794 639 }
@@ -809,11 +654,11 @@
809 654
810 655 $onload = ( ! $has_nav ) ? ' spf-onload' : '';
811 656 $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class="spf-icon ' . $section['icon'] . '"></i>' : '';
812 657
813 - echo '<div id="spf-section-' . esc_attr( $section_key ) . '" class="spf-section' . esc_attr( $onload ) . '">';
814 - echo ( $has_nav ) ? '<div class="spf-section-title"><h3>' . wp_kses_post( $section_icon ) . esc_html( $section['title'] ) . '</h3></div>' : '';
815 - echo ( ! empty( $section['description'] ) ) ? '<div class="spf-field spf-section-description">' . esc_html( $section['description'] ) . '</div>' : '';
658 + echo '<div id="spf-section-' . $section_key . '" class="spf-section' . $onload . '">';
659 + echo ( $has_nav ) ? '<div class="spf-section-title"><h3>' . $section_icon . $section['title'] . '</h3></div>' : '';
660 + echo ( ! empty( $section['description'] ) ) ? '<div class="spf-field spf-section-description">' . $section['description'] . '</div>' : '';
816 661
817 662 if ( ! empty( $section['fields'] ) ) {
818 663
819 664 foreach ( $section['fields'] as $field ) {
@@ -830,9 +675,9 @@
830 675
831 676 }
832 677 } else {
833 678
834 - echo '<div class="spf-no-option spf-text-muted">' . esc_html__( 'No option provided by developer.', 'post-carousel' ) . '</div>';
679 + echo '<div class="spf-no-option spf-text-muted">' . esc_html__( 'No option provided by developer.', 'smart-post-show' ) . '</div>';
835 680
836 681 }
837 682
838 683 echo '</div>';
@@ -854,14 +699,14 @@
854 699
855 700 echo '<div class="spf-footer">';
856 701
857 702 echo '<div class="spf-buttons">';
858 - echo '<input type="submit" name="spf_transient[save]" class="button button-primary spf-save' . esc_attr( $ajax_class ) . '" value="' . esc_html__( 'Save', 'post-carousel' ) . '" data-save="' . esc_html__( 'Saving...', 'post-carousel' ) . '">';
859 - echo ( $this->args['show_reset_section'] ) ? '<input type="submit" name="spf_transient[reset_section]" class="button button-secondary spf-reset-section spf-confirm" value="' . esc_html__( 'Reset Section', 'post-carousel' ) . '" data-confirm="' . esc_html__( 'Are you sure to reset this section options?', 'post-carousel' ) . '">' : '';
860 - echo ( $this->args['show_reset_all'] ) ? '<input type="submit" name="spf_transient[reset]" class="button spf-reset-all spf-confirm" value="' . esc_html__( 'Reset All', 'post-carousel' ) . '" data-confirm="' . esc_html__( 'Are you sure to reset all options?', 'post-carousel' ) . '">' : '';
703 + echo '<input type="submit" name="spf_transient[save]" class="button button-primary spf-save' . $ajax_class . '" value="' . esc_html__( 'Save', 'smart-post-show' ) . '" data-save="' . esc_html__( 'Saving...', 'smart-post-show' ) . '">';
704 + echo ( $this->args['show_reset_section'] ) ? '<input type="submit" name="spf_transient[reset_section]" class="button button-secondary spf-reset-section spf-confirm" value="' . esc_html__( 'Reset Section', 'smart-post-show' ) . '" data-confirm="' . esc_html__( 'Are you sure to reset this section options?', 'smart-post-show' ) . '">' : '';
705 + echo ( $this->args['show_reset_all'] ) ? '<input type="submit" name="spf_transient[reset]" class="button spf-reset-all spf-confirm" value="' . esc_html__( 'Reset All', 'smart-post-show' ) . '" data-confirm="' . esc_html__( 'Are you sure to reset all options?', 'smart-post-show' ) . '">' : '';
861 706 echo '</div>';
862 707
863 - echo ( ! empty( $this->args['footer_text'] ) ) ? '<div class="spf-copyright">' . esc_html( $this->args['footer_text'] ) . '</div>' : '';
708 + echo ( ! empty( $this->args['footer_text'] ) ) ? '<div class="spf-copyright">' . $this->args['footer_text'] . '</div>' : '';
864 709
865 710 echo '<div class="clear"></div>';
866 711 echo '</div>';
867 712
@@ -872,9 +717,9 @@
872 717 echo '</div>';
873 718
874 719 echo '<div class="clear"></div>';
875 720
876 - echo ( ! empty( $this->args['footer_after'] ) ) ? wp_kses_post( $this->args['footer_after'] ) : '';
721 + echo ( ! empty( $this->args['footer_after'] ) ) ? $this->args['footer_after'] : '';
877 722
878 723 echo '</div>';
879 724
880 725 }