Ultimate FAQ - Version 2.1.7

Version Description

(2022-01-19) = - Added a new filter (ewd_ufaq_kses_allowed_html) to specify allowed tags for the FAQ answer/body.

Download this release

Release Info

Developer Rustaurius
Plugin Icon 128x128 Ultimate FAQ
Version 2.1.7
Comparing to
See all releases

Code changes from version 2.1.6 to 2.1.7

includes/Dashboard.class.php CHANGED
@@ -81,30 +81,12 @@ class ewdufaqDashboard {
81
 
82
  $premium_info = apply_filters( 'ewd_dashboard_top', $premium_info, 'UFAQ', 'https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1' );
83
 
84
- // This will allow us to disaply the form
85
- $tmp_fun = function( $tags ) {
86
- $tags = array_merge(
87
- $tags,
88
- [
89
- 'input' => [
90
- 'class' => true,
91
- 'name' => true,
92
- 'type' => true,
93
- 'value' => true,
94
- 'placeholder' => true
95
- ]
96
- ]
97
- );
98
- if(isset($tags['form'])) {
99
- $tags['form'] = array_merge($tags['form'], ['class' => true]);
100
- }
101
- return $tags;
102
- };
103
- add_filter( 'wp_kses_allowed_html', $tmp_fun, 10, 1);
104
- echo wp_kses_post( $premium_info );
105
- remove_filter( 'wp_kses_allowed_html', $tmp_fun, 10 );
106
  } ?>
107
-
108
  <div class="ewd-ufaq-dashboard-new-widget-box ewd-widget-box-full" id="ewd-ufaq-dashboard-support-widget-box">
109
  <div class="ewd-ufaq-dashboard-new-widget-box-top"><?php _e('Get Support', 'ultimate-faqs'); ?><span id="ewd-ufaq-dash-mobile-support-down-caret">&nbsp;&nbsp;&#9660;</span><span id="ewd-ufaq-dash-mobile-support-up-caret">&nbsp;&nbsp;&#9650;</span></div>
110
  <div class="ewd-ufaq-dashboard-new-widget-box-bottom">
81
 
82
  $premium_info = apply_filters( 'ewd_dashboard_top', $premium_info, 'UFAQ', 'https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1' );
83
 
84
+ echo wp_kses(
85
+ $premium_info,
86
+ apply_filters( 'ewd_dashboard_top_kses_allowed_tags', wp_kses_allowed_html( 'post' ) )
87
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  } ?>
89
+
90
  <div class="ewd-ufaq-dashboard-new-widget-box ewd-widget-box-full" id="ewd-ufaq-dashboard-support-widget-box">
91
  <div class="ewd-ufaq-dashboard-new-widget-box-top"><?php _e('Get Support', 'ultimate-faqs'); ?><span id="ewd-ufaq-dash-mobile-support-down-caret">&nbsp;&nbsp;&#9660;</span><span id="ewd-ufaq-dash-mobile-support-up-caret">&nbsp;&nbsp;&#9650;</span></div>
92
  <div class="ewd-ufaq-dashboard-new-widget-box-bottom">
includes/Helper.class.php CHANGED
@@ -23,10 +23,10 @@ class ewdufaqHelper {
23
  * The object is created from within the class itself
24
  * only if the class has no instance.
25
  */
26
- public static function getInstance()
27
- {
28
- if (self::$instance == null)
29
- {
30
  self::$instance = new ewdufaqHelper();
31
  }
32
 
@@ -47,8 +47,12 @@ class ewdufaqHelper {
47
  );
48
  }
49
 
50
- public static function bad_nonce_ajax()
51
- {
 
 
 
 
52
  wp_send_json_error(
53
  array(
54
  'error' => 'badnonce',
23
  * The object is created from within the class itself
24
  * only if the class has no instance.
25
  */
26
+ public static function getInstance() {
27
+
28
+ if ( self::$instance == null ) {
29
+
30
  self::$instance = new ewdufaqHelper();
31
  }
32
 
47
  );
48
  }
49
 
50
+ /**
51
+ * Handle ajax requests where an invalid nonce is passed with the request
52
+ * @since 2.1.1
53
+ */
54
+ public static function bad_nonce_ajax() {
55
+
56
  wp_send_json_error(
57
  array(
58
  'error' => 'badnonce',
includes/Settings.class.php CHANGED
@@ -626,12 +626,11 @@ class ewdufaqSettings {
626
  return false;
627
  }
628
 
629
- public function premium_info( $section_and_perm_type )
630
- {
631
  global $ewd_ufaq_controller;
632
 
633
  $is_premium_user = $ewd_ufaq_controller->permissions->check_permission( $section_and_perm_type );
634
- $is_helper_installed = defined('EWDPH_PLUGIN_FNAME') && is_plugin_active( EWDPH_PLUGIN_FNAME );
635
 
636
  if ( $is_premium_user || $is_helper_installed ) {
637
  return false;
@@ -658,7 +657,9 @@ class ewdufaqSettings {
658
  ';
659
 
660
  switch ( $section_and_perm_type ) {
 
661
  case 'premium':
 
662
  $content = '
663
  <div class="ewd-ufaq-settings-preview">
664
  <h2>' . __( 'Premium', 'ultimate-faqs' ) . '<span>' . __( 'Premium', 'ultimate-faqs' ) . '</span></h2>
@@ -670,8 +671,11 @@ class ewdufaqSettings {
670
  ' . $premium_features . '
671
  </div>
672
  ';
 
673
  break;
 
674
  case 'fields':
 
675
  $content = '
676
  <div class="ewd-ufaq-settings-preview">
677
  <h2>' . __( 'Fields', 'ultimate-faqs' ) . '<span>' . __( 'Premium', 'ultimate-faqs' ) . '</span></h2>
@@ -682,8 +686,11 @@ class ewdufaqSettings {
682
  ' . $premium_features . '
683
  </div>
684
  ';
 
685
  break;
 
686
  case 'labelling':
 
687
  $content = '
688
  <div class="ewd-ufaq-settings-preview">
689
  <h2>' . __( 'Labelling', 'ultimate-faqs' ) . '<span>' . __( 'Premium', 'ultimate-faqs' ) . '</span></h2>
@@ -695,8 +702,11 @@ class ewdufaqSettings {
695
  ' . $premium_features . '
696
  </div>
697
  ';
 
698
  break;
 
699
  case 'styling':
 
700
  $content = '
701
  <div class="ewd-ufaq-settings-preview">
702
  <h2>' . __( 'Styling', 'ultimate-faqs' ) . '<span>' . __( 'Premium', 'ultimate-faqs' ) . '</span></h2>
@@ -708,10 +718,12 @@ class ewdufaqSettings {
708
  ' . $premium_features . '
709
  </div>
710
  ';
 
711
  break;
712
  }
713
 
714
- return function() use( $content ) {
 
715
  echo wp_kses_post( $content );
716
  };
717
  }
626
  return false;
627
  }
628
 
629
+ public function premium_info( $section_and_perm_type ) {
 
630
  global $ewd_ufaq_controller;
631
 
632
  $is_premium_user = $ewd_ufaq_controller->permissions->check_permission( $section_and_perm_type );
633
+ $is_helper_installed = defined( 'EWDPH_PLUGIN_FNAME' ) && is_plugin_active( EWDPH_PLUGIN_FNAME );
634
 
635
  if ( $is_premium_user || $is_helper_installed ) {
636
  return false;
657
  ';
658
 
659
  switch ( $section_and_perm_type ) {
660
+
661
  case 'premium':
662
+
663
  $content = '
664
  <div class="ewd-ufaq-settings-preview">
665
  <h2>' . __( 'Premium', 'ultimate-faqs' ) . '<span>' . __( 'Premium', 'ultimate-faqs' ) . '</span></h2>
671
  ' . $premium_features . '
672
  </div>
673
  ';
674
+
675
  break;
676
+
677
  case 'fields':
678
+
679
  $content = '
680
  <div class="ewd-ufaq-settings-preview">
681
  <h2>' . __( 'Fields', 'ultimate-faqs' ) . '<span>' . __( 'Premium', 'ultimate-faqs' ) . '</span></h2>
686
  ' . $premium_features . '
687
  </div>
688
  ';
689
+
690
  break;
691
+
692
  case 'labelling':
693
+
694
  $content = '
695
  <div class="ewd-ufaq-settings-preview">
696
  <h2>' . __( 'Labelling', 'ultimate-faqs' ) . '<span>' . __( 'Premium', 'ultimate-faqs' ) . '</span></h2>
702
  ' . $premium_features . '
703
  </div>
704
  ';
705
+
706
  break;
707
+
708
  case 'styling':
709
+
710
  $content = '
711
  <div class="ewd-ufaq-settings-preview">
712
  <h2>' . __( 'Styling', 'ultimate-faqs' ) . '<span>' . __( 'Premium', 'ultimate-faqs' ) . '</span></h2>
718
  ' . $premium_features . '
719
  </div>
720
  ';
721
+
722
  break;
723
  }
724
 
725
+ return function() use ( $content ) {
726
+
727
  echo wp_kses_post( $content );
728
  };
729
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: Rustaurius, EtoileWebDesign
3
  Tags: faq, faqs, accordion, woocommerce faq, gutenberg faq, faq block
4
  Requires at least: 5.0
5
  Tested up to: 5.8
6
- Stable tag: 2.1.6
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -267,6 +267,9 @@ Video 3 - FAQs Ordering
267
 
268
  == Changelog ==
269
 
 
 
 
270
  = 2.1.6 (2022-01-05) =
271
  - Fixed an issue causing the YouTube block to not output on the front end in an FAQ post.
272
 
3
  Tags: faq, faqs, accordion, woocommerce faq, gutenberg faq, faq block
4
  Requires at least: 5.0
5
  Tested up to: 5.8
6
+ Stable tag: 2.1.7
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
267
 
268
  == Changelog ==
269
 
270
+ = 2.1.7 (2022-01-19) =
271
+ - Added a new filter (ewd_ufaq_kses_allowed_html) to specify allowed tags for the FAQ answer/body.
272
+
273
  = 2.1.6 (2022-01-05) =
274
  - Fixed an issue causing the YouTube block to not output on the front end in an FAQ post.
275
 
ultimate-faqs.php CHANGED
@@ -6,7 +6,7 @@ Description: FAQ and accordion plugin with easy to use Gutenberg blocks, shortco
6
  Author URI: https://www.etoilewebdesign.com/
7
  Terms and Conditions: https://www.etoilewebdesign.com/plugin-terms-and-conditions/
8
  Text Domain: ultimate-faqs
9
- Version: 2.1.6
10
  WC requires at least: 3.0
11
  WC tested up to: 6.0
12
  */
@@ -43,7 +43,7 @@ class ewdufaqInit {
43
  define( 'EWD_UFAQ_PLUGIN_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
44
  define( 'EWD_UFAQ_PLUGIN_FNAME', plugin_basename( __FILE__ ) );
45
  define( 'EWD_UFAQ_TEMPLATE_DIR', 'ewd-ufaq-templates' );
46
- define( 'EWD_UFAQ_VERSION', '2.1.6' );
47
 
48
  define( 'EWD_UFAQ_FAQ_POST_TYPE', 'ufaq' );
49
  define( 'EWD_UFAQ_FAQ_CATEGORY_TAXONOMY', 'ufaq-category' );
6
  Author URI: https://www.etoilewebdesign.com/
7
  Terms and Conditions: https://www.etoilewebdesign.com/plugin-terms-and-conditions/
8
  Text Domain: ultimate-faqs
9
+ Version: 2.1.7
10
  WC requires at least: 3.0
11
  WC tested up to: 6.0
12
  */
43
  define( 'EWD_UFAQ_PLUGIN_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
44
  define( 'EWD_UFAQ_PLUGIN_FNAME', plugin_basename( __FILE__ ) );
45
  define( 'EWD_UFAQ_TEMPLATE_DIR', 'ewd-ufaq-templates' );
46
+ define( 'EWD_UFAQ_VERSION', '2.1.7' );
47
 
48
  define( 'EWD_UFAQ_FAQ_POST_TYPE', 'ufaq' );
49
  define( 'EWD_UFAQ_FAQ_CATEGORY_TAXONOMY', 'ufaq-category' );
views/View.FAQ.class.php CHANGED
@@ -645,22 +645,22 @@ class ewdufaqViewFAQ extends ewdufaqView {
645
  return 'mailto:?subject=' . urlencode( $subject ) . "&amp;body=" . urlencode( $this->post->post_title ) . urlencode( ' | ' ) . urlencode( $this->permalink );
646
  }
647
 
648
- /**
649
- * Get the initial submit faq css classes
650
- * @since 2.1.6
651
- */
652
- public function get_allowed_faq_content_tags( $tags ) {
653
-
654
- $tags['iframe'] = array(
655
- 'src' => true,
656
- 'height' => true,
657
- 'width' => true,
658
- 'frameborder' => true,
659
- 'allowfullscreen' => true,
660
- );
661
 
662
- return $tags;
663
- }
664
 
665
  /**
666
  * Get the initial submit faq css classes
645
  return 'mailto:?subject=' . urlencode( $subject ) . "&amp;body=" . urlencode( $this->post->post_title ) . urlencode( ' | ' ) . urlencode( $this->permalink );
646
  }
647
 
648
+ /**
649
+ * Get the initial submit faq css classes
650
+ * @since 2.1.6
651
+ */
652
+ public function get_allowed_faq_content_tags( $tags ) {
653
+
654
+ $tags['iframe'] = array(
655
+ 'src' => true,
656
+ 'height' => true,
657
+ 'width' => true,
658
+ 'frameborder' => true,
659
+ 'allowfullscreen' => true,
660
+ );
661
 
662
+ return apply_filters( 'ewd_ufaq_kses_allowed_html', $tags );
663
+ }
664
 
665
  /**
666
  * Get the initial submit faq css classes