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 -286 2.4.162.2.10 View file →
@@ -1,80 +1,28 @@
1 1 <?php if ( ! defined( 'ABSPATH' ) ) {
2 2 die; } // Cannot access directly.
3 -
3 +/**
4 + *
5 + * Options Class
6 + *
7 + * @since 1.0.0
8 + * @version 1.0.0
9 + */
4 10 if ( ! class_exists( 'SP_PC_Options' ) ) {
5 - /**
6 - * Options Class
7 - *
8 - * @since 1.0.0
9 - * @version 1.0.0
10 - */
11 11 class SP_PC_Options extends SP_PC_Abstract {
12 12
13 - /**
14 - * Unique ID/Name
15 - *
16 - * @var string
17 - */
18 - public $unique = '';
19 - /**
20 - * Notice.
21 - *
22 - * @var string
23 - */
24 - public $notice = '';
25 - /**
26 - * Abstract.
27 - *
28 - * @var string
29 - */
30 - public $abstract = 'options';
31 - /**
32 - * Setions.
33 - *
34 - * @var array
35 - */
36 - public $sections = array();
37 - /**
38 - * Options
39 - *
40 - * @var array
41 - */
42 - public $options = array();
43 -
44 - /**
45 - * Errors.
46 - *
47 - * @var array
48 - */
49 - public $errors = array();
50 -
51 - /**
52 - * Pre tabs.
53 - *
54 - * @var array
55 - */
56 - public $pre_tabs = array();
57 -
58 - /**
59 - * Pre fields.
60 - *
61 - * @var array
62 - */
63 - public $pre_fields = array();
64 -
65 - /**
66 - * Pre sections.
67 - *
68 - * @var array
69 - */
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();
70 22 public $pre_sections = array();
71 23
72 - /**
73 - * Default arguments.
74 - *
75 - * @var array
76 - */
24 + // default args.
77 25 public $args = array(
78 26
79 27 // framework title.
80 28 'framework_title' => 'SPF Framework <small>by SP</small>',
@@ -83,9 +31,9 @@
83 31 // menu settings.
84 32 'menu_title' => '',
85 33 'menu_slug' => '',
86 34 'menu_type' => 'menu',
87 - // 'menu_capability' => 'manage_options', It's implemented in add_admin_menu()
35 + 'menu_capability' => 'manage_options',
88 36 'menu_icon' => null,
89 37 'menu_position' => null,
90 38 'menu_hidden' => false,
91 39 'menu_parent' => '',
@@ -138,14 +86,9 @@
138 86 'defaults' => array(),
139 87
140 88 );
141 89
142 - /**
143 - * Run framework construct.
144 - *
145 - * @param string $key The filter unique key.
146 - * @param array $params The parameters.
147 - */
90 + // run framework construct.
148 91 public function __construct( $key, $params = array() ) {
149 92
150 93 $this->unique = $key;
151 94 $this->args = apply_filters( "spf_{$this->unique}_args", wp_parse_args( $params['args'], $this->args ), $this );
@@ -172,24 +115,13 @@
172 115 parent::__construct();
173 116
174 117 }
175 118
176 - /**
177 - * Instance.
178 - *
179 - * @param object $key The instance key.
180 - * @param array $params All the parameters.
181 - * @return mixed
182 - */
119 + // instance.
183 120 public static function instance( $key, $params = array() ) {
184 121 return new self( $key, $params );
185 122 }
186 - /**
187 - * Pre tabs.
188 - *
189 - * @param array $sections All the sections.
190 - * @return mixed
191 - */
123 +
192 124 public function pre_tabs( $sections ) {
193 125
194 126 $result = array();
195 127 $parents = array();
@@ -215,14 +147,8 @@
215 147
216 148 return wp_list_sort( $result, array( 'priority' => 'ASC' ), 'ASC', true );
217 149 }
218 150
219 - /**
220 - * Pre fields method.
221 - *
222 - * @param array $sections The sections.
223 - * @return $result
224 - */
225 151 public function pre_fields( $sections ) {
226 152
227 153 $result = array();
228 154
@@ -236,14 +162,8 @@
236 162
237 163 return $result;
238 164 }
239 165
240 - /**
241 - * The pre sections.
242 - *
243 - * @param array $sections The sections.
244 - * @return mixed
245 - */
246 166 public function pre_sections( $sections ) {
247 167
248 168 $result = array();
249 169
@@ -260,14 +180,9 @@
260 180
261 181 return $result;
262 182 }
263 183
264 - /**
265 - * Add admin bar menu.
266 - *
267 - * @param object $wp_admin_bar The admin bar.
268 - * @return void
269 - */
184 + // add admin bar menu.
270 185 public function add_admin_bar_menu( $wp_admin_bar ) {
271 186
272 187 if ( ! empty( $this->args['show_bar_menu'] ) && empty( $this->args['menu_hidden'] ) ) {
273 188
@@ -310,45 +225,43 @@
310 225 }
311 226
312 227 }
313 228
314 - /**
315 - * Ajax save method.
316 - *
317 - * @return void
318 - */
319 229 public function ajax_save() {
320 230
321 - $result = $this->set_options( true );
322 - if ( ! $result ) {
323 - wp_send_json_error(
324 - array(
325 - 'success' => false,
326 - 'error' => esc_html__(
327 - 'Error while saving.',
328 - 'post-carousel'
329 - ),
330 - )
331 - );
231 + if ( ! empty( $_POST['data'] ) ) {
332 232
333 - } else {
334 - wp_send_json_success(
335 - array(
336 - 'success' => true,
337 - 'notice' => $this->notice,
338 - 'errors' => $this->errors,
339 - )
340 - );
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 + }
341 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 +
342 261 }
343 262
344 - /**
345 - * Get default value.
346 - *
347 - * @param array $field The field array.
348 - * @param array $options The options array.
349 - * @return mixed
350 - */
263 + // get default value
351 264 public function get_default( $field, $options = array() ) {
352 265
353 266 $default = ( isset( $this->args['defaults'][ $field['id'] ] ) ) ? $this->args['defaults'][ $field['id'] ] : '';
354 267 $default = ( isset( $field['default'] ) ) ? $field['default'] : $default;
@@ -357,13 +270,9 @@
357 270 return $default;
358 271
359 272 }
360 273
361 - /**
362 - * Save defaults and set new fields value to main options.
363 - *
364 - * @return void
365 - */
274 + // save defaults and set new fields value to main options.
366 275 public function save_defaults() {
367 276
368 277 $tmp_options = $this->options;
369 278
@@ -378,54 +287,34 @@
378 287 }
379 288
380 289 }
381 290
382 - /**
383 - * Set options.
384 - *
385 - * @param boolean $ajax The ajax save.
386 - *
387 - * @return mixed
388 - */
389 - public function set_options( $ajax = false ) {
291 + // set options.
292 + public function set_options() {
390 293
391 - // XSS ok.
392 - // No worries, This "POST" requests is sanitizing in the below foreach. see #L380 - #L384.
393 - $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' ) ) {
394 295
395 - // Set variables.
396 - $data = array();
397 - $noncekey = 'spf_options_nonce' . $this->unique;
398 - $nonce = ( ! empty( $response[ $noncekey ] ) ) ? $response[ $noncekey ] : '';
399 - $options = ( ! empty( $response[ $this->unique ] ) ) ? $response[ $this->unique ] : array();
400 - $transient = ( ! empty( $response['spf_transient'] ) ) ? $response['spf_transient'] : array();
401 -
402 - if ( wp_verify_nonce( $nonce, 'spf_options_nonce' ) ) {
403 -
404 - $importing = false;
296 + $request = spf_get_var( $this->unique, array() );
297 + $transient = spf_get_var( 'spf_transient' );
405 298 $section_id = ( ! empty( $transient['section'] ) ) ? $transient['section'] : '';
406 299
407 300 // import data.
408 - if ( ! $ajax && ! empty( $response['spf_import_data'] ) ) {
301 + if ( ! empty( $transient['spf_import_data'] ) ) {
409 302
410 - // XSS ok.
411 - // No worries, This "POST" requests is sanitizing in the below foreach. see #L380 - #L384.
412 - $import_data = json_decode( wp_unslash( trim( $response['spf_import_data'] ) ), true );
413 - $options = ( is_array( $import_data ) && ! empty( $import_data ) ) ? $import_data : array();
414 - $importing = true;
415 - $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();
416 305
417 - }
306 + $this->notice = esc_html__( 'Success. Imported backup options.', 'smart-post-show' );
418 307
419 - if ( ! empty( $transient['reset'] ) ) {
308 + } elseif ( ! empty( $transient['reset'] ) ) {
420 309
421 310 foreach ( $this->pre_fields as $field ) {
422 311 if ( ! empty( $field['id'] ) ) {
423 - $data[ $field['id'] ] = $this->get_default( $field );
312 + $request[ $field['id'] ] = $this->get_default( $field );
424 313 }
425 314 }
426 315
427 - $this->notice = esc_html__( 'Default options restored.', 'post-carousel' );
316 + $this->notice = esc_html__( 'Default options restored.', 'smart-post-show' );
428 317
429 318 } elseif ( ! empty( $transient['reset_section'] ) && ! empty( $section_id ) ) {
430 319
431 320 if ( ! empty( $this->pre_sections[ $section_id - 1 ]['fields'] ) ) {
@@ -431,15 +320,14 @@
431 320 if ( ! empty( $this->pre_sections[ $section_id - 1 ]['fields'] ) ) {
432 321
433 322 foreach ( $this->pre_sections[ $section_id - 1 ]['fields'] as $field ) {
434 323 if ( ! empty( $field['id'] ) ) {
435 - $data[ $field['id'] ] = $this->get_default( $field );
324 + $request[ $field['id'] ] = $this->get_default( $field );
436 325 }
437 326 }
438 327 }
439 328
440 - $data = wp_parse_args( $data, $this->options );
441 - $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' );
442 330
443 331 } else {
444 332
445 333 // sanitize and validate.
@@ -446,104 +334,87 @@
446 334 foreach ( $this->pre_fields as $field ) {
447 335
448 336 if ( ! empty( $field['id'] ) ) {
449 337
450 - $field_id = $field['id'];
451 - $field_value = isset( $options[ $field_id ] ) ? $options[ $field_id ] : '';
452 -
453 - // Ajax and Importing doing wp_unslash already.
454 - if ( ! $ajax && ! $importing ) {
455 - $field_value = wp_unslash( $field_value );
456 - }
457 -
458 338 // sanitize.
459 - if ( ! isset( $field['sanitize'] ) ) {
460 - if ( is_array( $field_value ) ) {
339 + if ( ! empty( $field['sanitize'] ) ) {
461 340
462 - $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 );
463 344
464 - } else {
465 -
466 - $data[ $field_id ] = wp_kses_post( $field_value );
467 - }
468 - } elseif ( isset( $field['sanitize'] ) && is_callable( $field['sanitize'] ) ) {
469 -
470 - $data[ $field_id ] = call_user_func( $field['sanitize'], $field_value );
471 -
472 - } else {
473 - $data[ $field_id ] = $field_value;
474 -
475 345 }
476 346
477 - // Validate "post" request of field.
478 - if ( isset( $field['validate'] ) && is_callable( $field['validate'] ) ) {
347 + // validate.
348 + if ( ! empty( $field['validate'] ) ) {
479 349
480 - $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 );
481 352
482 353 if ( ! empty( $has_validated ) ) {
483 - $data[ $field_id ] = ( isset( $this->options[ $field_id ] ) ) ? $this->options[ $field_id ] : '';
484 - $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;
485 356 }
486 357 }
358 +
359 + // auto sanitize.
360 + if ( ! isset( $request[ $field['id'] ] ) || is_null( $request[ $field['id'] ] ) ) {
361 + $request[ $field['id'] ] = '';
362 + }
487 363 }
488 364 }
489 365 }
490 366
491 - $data = apply_filters( "spf_{$this->unique}_save", $data, $this );
367 + // ignore nonce requests.
368 + if ( isset( $request['_nonce'] ) ) {
369 + unset( $request['_nonce'] ); }
492 370
493 - do_action( "spf_{$this->unique}_save_before", $data, $this );
371 + $request = wp_unslash( $request );
494 372
495 - $this->options = $data;
373 + $request = apply_filters( "spf_{$this->unique}_save", $request, $this );
496 374
497 - $this->save_options( $data );
375 + do_action( "spf_{$this->unique}_save_before", $request, $this );
498 376
499 - do_action( "spf_{$this->unique}_save_after", $data, $this );
377 + $this->options = $request;
500 378
379 + $this->save_options( $request );
380 +
381 + do_action( "spf_{$this->unique}_save_after", $request, $this );
382 +
501 383 if ( empty( $this->notice ) ) {
502 - $this->notice = esc_html__( 'Settings saved.', 'post-carousel' );
384 + $this->notice = esc_html__( 'Settings saved.', 'smart-post-show' );
503 385 }
504 -
505 - return true;
506 386 }
507 387
508 - return false;
388 + return true;
509 389
510 390 }
511 391
512 - /**
513 - * Save options database.
514 - *
515 - * @param array $data The options values.
516 - * @return void
517 - */
518 - public function save_options( $data ) {
392 + // save options database.
393 + public function save_options( $request ) {
519 394
520 - if ( 'transient' === $this->args['database'] ) {
521 - set_transient( $this->unique, $data, $this->args['transient_time'] );
522 - } elseif ( 'theme_mod' === $this->args['database'] ) {
523 - set_theme_mod( $this->unique, $data );
524 - } elseif ( 'network' === $this->args['database'] ) {
525 - 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 );
526 401 } else {
527 - update_option( $this->unique, $data );
402 + update_option( $this->unique, $request );
528 403 }
529 404
530 - do_action( "spf_{$this->unique}_saved", $data, $this );
405 + do_action( "spf_{$this->unique}_saved", $request, $this );
531 406
532 407 }
533 408
534 - /**
535 - * Get options from database.
536 - *
537 - * @return mixed
538 - */
409 + // get options from database.
539 410 public function get_options() {
540 411
541 - if ( 'transient' === $this->args['database'] ) {
412 + if ( $this->args['database'] === 'transient' ) {
542 413 $this->options = get_transient( $this->unique );
543 - } elseif ( 'theme_mod' === $this->args['database'] ) {
414 + } elseif ( $this->args['database'] === 'theme_mod' ) {
544 415 $this->options = get_theme_mod( $this->unique );
545 - } elseif ( 'network' === $this->args['database'] ) {
416 + } elseif ( $this->args['database'] === 'network' ) {
546 417 $this->options = get_site_option( $this->unique );
547 418 } else {
548 419 $this->options = get_option( $this->unique );
549 420 }
@@ -556,17 +427,15 @@
556 427
557 428 }
558 429
559 430 /**
560 - * WP api – admin menu.
431 + * wp api: admin menu.
561 432 */
562 433 public function add_admin_menu() {
563 - // Show plugin setting menu as per user role. – ShapedPlugin
564 - // Use the hook 'sp_pc_dashboard_capability' to change user capability.
565 - $menu_capability = apply_filters( 'sp_pc_dashboard_capability', 'manage_options' );
434 +
566 435 extract( $this->args );
567 436
568 - if ( 'submenu' === $menu_type ) {
437 + if ( $menu_type === 'submenu' ) {
569 438
570 439 $menu_page = call_user_func( 'add_submenu_page', $menu_parent, $menu_title, $menu_title, $menu_capability, $menu_slug, array( &$this, 'add_options_html' ) );
571 440
572 441 } else {
@@ -668,10 +537,8 @@
668 537 public function add_options_html() {
669 538
670 539 $has_nav = ( count( $this->pre_tabs ) > 1 ) ? true : false;
671 540 $show_all = ( ! $has_nav ) ? ' spf-show-all' : '';
672 - $show_buttons = isset( $this->args['show_buttons'] ) ? $this->args['show_buttons'] : true;
673 - $menu_slug = isset( $this->args['menu_slug'] ) ? $this->args['menu_slug'] : '';
674 541 $ajax_class = ( $this->args['ajax_save'] ) ? ' spf-save-ajax' : '';
675 542 $sticky_class = ( $this->args['sticky_header'] ) ? ' spf-sticky-header' : '';
676 543 $wrapper_class = ( $this->args['framework_class'] ) ? ' ' . $this->args['framework_class'] : '';
677 544 $theme = ( $this->args['theme'] ) ? ' spf-theme-' . $this->args['theme'] : '';
@@ -676,25 +543,22 @@
676 543 $wrapper_class = ( $this->args['framework_class'] ) ? ' ' . $this->args['framework_class'] : '';
677 544 $theme = ( $this->args['theme'] ) ? ' spf-theme-' . $this->args['theme'] : '';
678 545 $class = ( $this->args['class'] ) ? ' ' . $this->args['class'] : '';
679 546
680 - if ( 'pcp_replace_layout' === $menu_slug ) {
681 - 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>';
682 - }
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 . '">';
683 549
684 - 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 ) . '">';
685 -
686 550 $notice_class = ( ! empty( $this->notice ) ) ? ' spf-form-show' : '';
687 551 $notice_text = ( ! empty( $this->notice ) ) ? $this->notice : '';
688 552
689 - // 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>';
690 554
691 555 $error_class = ( ! empty( $this->errors ) ) ? ' spf-form-show' : '';
692 556
693 - 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 . '">';
694 558 if ( ! empty( $this->errors ) ) {
695 559 foreach ( $this->errors as $error ) {
696 - echo '<i class="spf-label-error">!</i> ' . esc_html( $error ) . '<br />';
560 + echo '<i class="spf-label-error">!</i> ' . $error . '<br />';
697 561 }
698 562 }
699 563 echo '</div>';
700 564
@@ -708,41 +572,30 @@
708 572 echo '<div class="spf-header' . esc_attr( $sticky_class ) . '">';
709 573 echo '<div class="spf-header-inner">';
710 574
711 575 echo '<div class="spf-header-left">';
712 - if ( 'pcp_replace_layout' === $menu_slug ) {
713 - 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">
714 - <style type="text/css">
715 - .st0{fill:#D64224;}
716 - </style>
717 - <path class="st0" d="M0,69.3V0h69.4v18.6H18.6v50.7L0,69.3L0,69.3z M100,100H30.6V30.7H100V100z"/>
718 - </svg>' . esc_html__( 'Replace Layout', 'post-carousel' ) . '</h1>';
719 - } elseif ( $show_buttons ) {
720 - 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>';
721 - } else {
722 - 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>';
723 - }
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>';
724 577 echo '</div>';
725 578
726 579 echo '<div class="spf-header-right">';
727 580
728 - 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>' : '';
729 582
730 - 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>' : '';
731 - if ( $show_buttons ) {
732 - echo '<div class="spf-buttons">';
733 - 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' ) . '">';
734 - 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' ) . '">' : '';
735 - 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' ) . '">' : '';
736 - echo '</div>';
737 - }
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' ) . '">' : '';
738 589 echo '</div>';
739 590
591 + echo '</div>';
592 +
740 593 echo '<div class="clear"></div>';
741 594 echo '</div>';
742 595 echo '</div>';
743 596
744 - echo '<div class="spf-wrapper' . esc_attr( $show_all ) . '">';
597 + echo '<div class="spf-wrapper' . $show_all . '">';
745 598
746 599 if ( $has_nav ) {
747 600 echo '<div class="spf-nav spf-nav-options">';
748 601
@@ -758,9 +611,9 @@
758 611 if ( ! empty( $tab['subs'] ) ) {
759 612
760 613 echo '<li class="spf-tab-depth-0">';
761 614
762 - 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>';
763 616
764 617 echo '<ul>';
765 618
766 619 foreach ( $tab['subs'] as $sub ) {
@@ -767,9 +620,9 @@
767 620
768 621 $sub_error = $this->error_check( $sub );
769 622 $sub_icon = ( ! empty( $sub['icon'] ) ) ? '<i class="' . $sub['icon'] . '"></i>' : '';
770 623
771 - 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>';
772 625
773 626 $tab_key++;
774 627 }
775 628
@@ -778,9 +631,9 @@
778 631 echo '</li>';
779 632
780 633 } else {
781 634
782 - 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>';
783 636
784 637 $tab_key++;
785 638 }
786 639 }
@@ -801,11 +654,11 @@
801 654
802 655 $onload = ( ! $has_nav ) ? ' spf-onload' : '';
803 656 $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class="spf-icon ' . $section['icon'] . '"></i>' : '';
804 657
805 - echo '<div id="spf-section-' . esc_attr( $section_key ) . '" class="spf-section' . esc_attr( $onload ) . '">';
806 - echo ( $has_nav ) ? '<div class="spf-section-title"><h3>' . wp_kses_post( $section_icon ) . esc_html( $section['title'] ) . '</h3></div>' : '';
807 - 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>' : '';
808 661
809 662 if ( ! empty( $section['fields'] ) ) {
810 663
811 664 foreach ( $section['fields'] as $field ) {
@@ -822,9 +675,9 @@
822 675
823 676 }
824 677 } else {
825 678
826 - 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>';
827 680
828 681 }
829 682
830 683 echo '</div>';
@@ -846,14 +699,14 @@
846 699
847 700 echo '<div class="spf-footer">';
848 701
849 702 echo '<div class="spf-buttons">';
850 - 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' ) . '">';
851 - 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' ) . '">' : '';
852 - 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' ) . '">' : '';
853 706 echo '</div>';
854 707
855 - 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>' : '';
856 709
857 710 echo '<div class="clear"></div>';
858 711 echo '</div>';
859 712
@@ -864,9 +717,9 @@
864 717 echo '</div>';
865 718
866 719 echo '<div class="clear"></div>';
867 720
868 - echo ( ! empty( $this->args['footer_after'] ) ) ? wp_kses_post( $this->args['footer_after'] ) : '';
721 + echo ( ! empty( $this->args['footer_after'] ) ) ? $this->args['footer_after'] : '';
869 722
870 723 echo '</div>';
871 724
872 725 }