Ultimate FAQ - Version 2.1.10

Version Description

(2022-02-23) = - Updated WPForms integration, so you can now specify a minimum character count before matching FAQs show. - Removed Gutenberg block code from the output of the post body in the structured data. - Fix for structured data not output on FAQ search page. - Fix for issue in which, when using the ordering table, editing the FAQ that was at the top would send it to the bottom.

Download this release

Release Info

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

Code changes from version 2.1.9 to 2.1.10

assets/js/ewd-ufaq.js CHANGED
@@ -432,7 +432,7 @@ function UFAQWPFormsHandler() {
432
 
433
  var search_string = jQuery( this ).val();
434
 
435
- if ( search_string.length > 12 ) {
436
 
437
  jQuery( '.ewd-ufaq-wpforms-faq-results' ).removeClass( 'ewd-ufaq-hidden' );
438
  jQuery( '.ewd-ufaq-wpforms-label' ).removeClass( 'ewd-ufaq-hidden' );
432
 
433
  var search_string = jQuery( this ).val();
434
 
435
+ if ( search_string.length >= wpforms_integration.ufaq_minimum_characters ) {
436
 
437
  jQuery( '.ewd-ufaq-wpforms-faq-results' ).removeClass( 'ewd-ufaq-hidden' );
438
  jQuery( '.ewd-ufaq-wpforms-label' ).removeClass( 'ewd-ufaq-hidden' );
includes/Ajax.class.php CHANGED
@@ -166,7 +166,7 @@ if ( !class_exists( 'ewdufaqAJAX' ) ) {
166
 
167
  foreach ( $_POST['ewd-ufaq-item'] as $key => $id ) {
168
 
169
- update_post_meta( intval( $id ), 'ufaq_order', intval( $key ) );
170
  }
171
 
172
  die();
166
 
167
  foreach ( $_POST['ewd-ufaq-item'] as $key => $id ) {
168
 
169
+ update_post_meta( intval( $id ), 'ufaq_order', intval( $key ) + 1 );
170
  }
171
 
172
  die();
includes/Settings.class.php CHANGED
@@ -62,7 +62,8 @@ class ewdufaqSettings {
62
  )
63
  ),
64
 
65
- 'wpforms-faq-location' => 'above',
 
66
 
67
  'faq-fields' => array(),
68
 
62
  )
63
  ),
64
 
65
+ 'wpforms-faq-location' => 'above',
66
+ 'wpforms-minimum-characters' => 12,
67
 
68
  'faq-fields' => array(),
69
 
includes/WPForms.class.php CHANGED
@@ -94,9 +94,10 @@ if ( !class_exists( 'ewdufaqWPForms' ) ) {
94
  $target_field = $this->get_target_field( $form_data );
95
 
96
  $args = array(
97
- 'ufaq_enabled' => isset ( $form_data['settings']['ufaq_enabled'] ) ? $form_data['settings']['ufaq_enabled'] : 'enabled',
98
- 'ufaq_selected_field' => $target_field,
99
- 'form_id' => $form_data['id']
 
100
  );
101
 
102
  $ewd_ufaq_controller->add_front_end_php_data( 'ewd-ufaq-js', 'wpforms_integration', $args );
94
  $target_field = $this->get_target_field( $form_data );
95
 
96
  $args = array(
97
+ 'ufaq_enabled' => isset ( $form_data['settings']['ufaq_enabled'] ) ? $form_data['settings']['ufaq_enabled'] : 'enabled',
98
+ 'ufaq_selected_field' => $target_field,
99
+ 'ufaq_minimum_characters' => $ewd_ufaq_controller->settings->get_setting( 'wpforms-minimum-characters' ),
100
+ 'form_id' => $form_data['id']
101
  );
102
 
103
  $ewd_ufaq_controller->add_front_end_php_data( 'ewd-ufaq-js', 'wpforms_integration', $args );
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.9
6
- Stable tag: 2.1.9
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -267,6 +267,12 @@ Video 3 - FAQs Ordering
267
 
268
  == Changelog ==
269
 
 
 
 
 
 
 
270
  = 2.1.9 (2022-02-01) =
271
  - Fixed compatibility issue when using block-based themes.
272
 
3
  Tags: faq, faqs, accordion, woocommerce faq, gutenberg faq, faq block
4
  Requires at least: 5.0
5
  Tested up to: 5.9
6
+ Stable tag: 2.1.10
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
267
 
268
  == Changelog ==
269
 
270
+ = 2.1.10 (2022-02-23) =
271
+ - Updated WPForms integration, so you can now specify a minimum character count before matching FAQs show.
272
+ - Removed Gutenberg block code from the output of the post body in the structured data.
273
+ - Fix for structured data not output on FAQ search page.
274
+ - Fix for issue in which, when using the ordering table, editing the FAQ that was at the top would send it to the bottom.
275
+
276
  = 2.1.9 (2022-02-01) =
277
  - Fixed compatibility issue when using block-based themes.
278
 
ultimate-faqs.php CHANGED
@@ -6,9 +6,9 @@ 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.9
10
  WC requires at least: 3.0
11
- WC tested up to: 6.1
12
  */
13
 
14
  if ( ! defined( 'ABSPATH' ) )
@@ -17,6 +17,9 @@ if ( ! defined( 'ABSPATH' ) )
17
  if ( ! class_exists( 'ewdufaqInit' ) ) {
18
  class ewdufaqInit {
19
 
 
 
 
20
  public $schema_faq_data = array();
21
 
22
  /**
@@ -43,7 +46,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.9' );
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.10
10
  WC requires at least: 3.0
11
+ WC tested up to: 6.2
12
  */
13
 
14
  if ( ! defined( 'ABSPATH' ) )
17
  if ( ! class_exists( 'ewdufaqInit' ) ) {
18
  class ewdufaqInit {
19
 
20
+ // Any data that needs to be passed from PHP to our JS files
21
+ public $front_end_php_js_data = array();
22
+
23
  public $schema_faq_data = array();
24
 
25
  /**
46
  define( 'EWD_UFAQ_PLUGIN_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
47
  define( 'EWD_UFAQ_PLUGIN_FNAME', plugin_basename( __FILE__ ) );
48
  define( 'EWD_UFAQ_TEMPLATE_DIR', 'ewd-ufaq-templates' );
49
+ define( 'EWD_UFAQ_VERSION', '2.1.10' );
50
 
51
  define( 'EWD_UFAQ_FAQ_POST_TYPE', 'ufaq' );
52
  define( 'EWD_UFAQ_FAQ_CATEGORY_TAXONOMY', 'ufaq-category' );
views/View.FAQSearch.class.php CHANGED
@@ -17,7 +17,12 @@ class ewdufaqViewFAQSearch extends ewdufaqViewFAQs {
17
  // Add any dependent stylesheets or javascript
18
  $this->enqueue_assets();
19
 
20
- if ( empty( $this->show_on_load ) ) { $this->faqs = array(); }
 
 
 
 
 
21
 
22
  $this->set_faqs_options();
23
 
17
  // Add any dependent stylesheets or javascript
18
  $this->enqueue_assets();
19
 
20
+ if ( empty( $this->show_on_load ) ) {
21
+ $this->faqs = array();
22
+ }
23
+ else {
24
+ $this->add_schema_data();
25
+ }
26
 
27
  $this->set_faqs_options();
28
 
views/View.FAQs.class.php CHANGED
@@ -254,40 +254,6 @@ class ewdufaqViewFAQs extends ewdufaqView {
254
  }
255
  }
256
 
257
- /**
258
- * Adds schema data about the FAQs being displayed
259
- *
260
- * @since 2.0.0
261
- */
262
- public function add_schema_data() {
263
- global $ewd_ufaq_controller;
264
-
265
- if ( $ewd_ufaq_controller->settings->get_setting( 'disable-microdata' ) ) { return; }
266
-
267
- foreach ( $this->faqs as $faq ) {
268
-
269
- $schema_object = array(
270
- '@type' => 'Question',
271
- 'name' => $faq->question,
272
- 'acceptedAnswer' => array(
273
- '@type' => 'Answer',
274
- 'text' => $faq->answer
275
- )
276
- );
277
-
278
- if ( ! empty( $faq->up_votes ) ) { $schema_object['acceptedAnswer']['upvoteCount'] = $faq->up_votes; }
279
- if ( ! empty( $faq->down_votes ) ) { $schema_object['acceptedAnswer']['downvoteCount'] = $faq->down_votes; }
280
- if ( ! empty( $faq->faq_author ) ) {
281
- $schema_object['acceptedAnswer']['author'] = array(
282
- '@type' => 'Person',
283
- 'name' => $faq->faq_author
284
- );
285
- }
286
-
287
- $ewd_ufaq_controller->schema_faq_data[] = $schema_object;
288
- }
289
- }
290
-
291
  /**
292
  * Replace the list header placeholder with the FAQ list
293
  *
254
  }
255
  }
256
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
257
  /**
258
  * Replace the list header placeholder with the FAQ list
259
  *
views/View.class.php CHANGED
@@ -210,4 +210,43 @@ class ewdufaqView extends ewdufaqBase {
210
  }
211
  }
212
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  }
210
  }
211
  }
212
 
213
+ /**
214
+ * Adds schema data about the FAQs being displayed
215
+ *
216
+ * @since 2.0.0
217
+ */
218
+ public function add_schema_data() {
219
+ global $ewd_ufaq_controller;
220
+
221
+ if ( $ewd_ufaq_controller->settings->get_setting( 'disable-microdata' ) ) { return; }
222
+
223
+ foreach ( $this->faqs as $faq ) {
224
+
225
+ $schema_object = array(
226
+ '@type' => 'Question',
227
+ 'name' => $faq->question,
228
+ '@type' => 'Answer',
229
+ 'text' => wp_strip_all_tags( $faq->answer ),
230
+ 'acceptedAnswer' => array()
231
+ );
232
+
233
+ if ( ! empty( $faq->up_votes ) ) {
234
+ $schema_object['acceptedAnswer']['upvoteCount'] = $faq->up_votes;
235
+ }
236
+
237
+ if ( ! empty( $faq->down_votes ) ) {
238
+ $schema_object['acceptedAnswer']['downvoteCount'] = $faq->down_votes;
239
+ }
240
+
241
+ if ( ! empty( $faq->faq_author ) ) {
242
+ $schema_object['acceptedAnswer']['author'] = array(
243
+ '@type' => 'Person',
244
+ 'name' => $faq->faq_author
245
+ );
246
+ }
247
+
248
+ $ewd_ufaq_controller->schema_faq_data[] = $schema_object;
249
+ }
250
+ }
251
+
252
  }