Ultimate FAQ - Version 1.8.12

Version Description

  • Added a skip button to the tutorial that shows when the plugin is first activated
  • Added in a few missing images in the plugin admin area
  • Corrected issue that was causing the review request to pop back up even after a review had been left or feedback sent.
Download this release

Release Info

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

Code changes from version 1.8.11 to 1.8.12

Functions/EWD_UFAQ_Deactivation_Survey.php CHANGED
@@ -1,66 +1,69 @@
1
- <?php
2
- add_action('current_screen', 'EWD_UFAQ_Deactivation_Survey');
3
- function EWD_UFAQ_Deactivation_Survey() {
4
- if (in_array(get_current_screen()->id, array( 'plugins', 'plugins-network' ), true)) {
5
- add_action('admin_enqueue_scripts', 'EWD_UFAQ_Enqueue_Deactivation_Scripts');
6
- add_action( 'admin_footer', 'EWD_UFAQ_Deactivation_Survey_HTML');
7
- }
8
- }
9
-
10
- function EWD_UFAQ_Enqueue_Deactivation_Scripts() {
11
- wp_enqueue_style('ewd-ufaq-deactivation-css', EWD_UFAQ_CD_PLUGIN_URL . 'css/ewd-ufaq-plugin-deactivation.css');
12
- wp_enqueue_script('ewd-ufaq-deactivation-js', EWD_UFAQ_CD_PLUGIN_URL . 'js/ewd-ufaq-plugin-deactivation.js', array('jquery'));
13
-
14
- wp_localize_script('ewd-ufaq-deactivation-js', 'ewd_ufaq_deactivation_data', array('site_url' => site_url()));
15
- }
16
-
17
- function EWD_UFAQ_Deactivation_Survey_HTML() {
18
- $options = array(
19
- 1 => array(
20
- 'title' => esc_html__( 'I no longer need the plugin', 'ultimate-faqs' ),
21
- ),
22
- 2 => array(
23
- 'title' => esc_html__( 'I\'m switching to a different plugin', 'ultimate-faqs' ),
24
- 'details' => esc_html__( 'Please share which plugin', 'ultimate-faqs' ),
25
- ),
26
- 3 => array(
27
- 'title' => esc_html__( 'I couldn\'t get the plugin to work', 'ultimate-faqs' ),
28
- ),
29
- 4 => array(
30
- 'title' => esc_html__( 'It\'s a temporary deactivation', 'ultimate-faqs' ),
31
- ),
32
- 5 => array(
33
- 'title' => esc_html__( 'Other', 'ultimate-faqs' ),
34
- 'details' => esc_html__( 'Please share the reason', 'ultimate-faqs' ),
35
- ),
36
- );
37
- ?>
38
- <div class="ewd-ufaq-deactivate-survey-modal" id="ewd-ufaq-deactivate-survey-ultimate-faqs">
39
- <div class="ewd-ufaq-deactivate-survey-wrap">
40
- <form class="ewd-ufaq-deactivate-survey" method="post">
41
- <span class="ewd-ufaq-deactivate-survey-title"><span class="dashicons dashicons-testimonial"></span><?php echo ' ' . __( 'Quick Feedback', 'ultimate-faqs' ); ?></span>
42
- <span class="ewd-ufaq-deactivate-survey-desc"><?php echo __('If you have a moment, please share why you are deactivating Ultimate FAQs:', 'ultimate-faqs' ); ?></span>
43
- <div class="ewd-ufaq-deactivate-survey-options">
44
- <?php foreach ( $options as $id => $option ) : ?>
45
- <div class="ewd-ufaq-deactivate-survey-option">
46
- <label for="ewd-ufaq-deactivate-survey-option-ultimate-faqs-<?php echo $id; ?>" class="ewd-ufaq-deactivate-survey-option-label">
47
- <input id="ewd-ufaq-deactivate-survey-option-ultimate-faqs-<?php echo $id; ?>" class="ewd-ufaq-deactivate-survey-option-input" type="radio" name="code" value="<?php echo $id; ?>" />
48
- <span class="ewd-ufaq-deactivate-survey-option-reason"><?php echo $option['title']; ?></span>
49
- </label>
50
- <?php if ( ! empty( $option['details'] ) ) : ?>
51
- <input class="ewd-ufaq-deactivate-survey-option-details" type="text" placeholder="<?php echo $option['details']; ?>" />
52
- <?php endif; ?>
53
- </div>
54
- <?php endforeach; ?>
55
- </div>
56
- <div class="ewd-ufaq-deactivate-survey-footer">
57
- <button type="submit" class="ewd-ufaq-deactivate-survey-submit button button-primary button-large"><?php _e('Submit and Deactivate', 'ultimate-faqs' ); ?></button>
58
- <a href="#" class="ewd-ufaq-deactivate-survey-deactivate"><?php _e('Skip and Deactivate', 'ultimate-faqs' ); ?></a>
59
- </div>
60
- </form>
61
- </div>
62
- </div>
63
- <?php
64
- }
65
-
 
 
 
66
  ?>
1
+ <?php
2
+ add_action('current_screen', 'EWD_UFAQ_Deactivation_Survey');
3
+ function EWD_UFAQ_Deactivation_Survey() {
4
+ if (in_array(get_current_screen()->id, array( 'plugins', 'plugins-network' ), true)) {
5
+ add_action('admin_enqueue_scripts', 'EWD_UFAQ_Enqueue_Deactivation_Scripts');
6
+ add_action( 'admin_footer', 'EWD_UFAQ_Deactivation_Survey_HTML');
7
+ }
8
+ }
9
+
10
+ function EWD_UFAQ_Enqueue_Deactivation_Scripts() {
11
+ wp_enqueue_style('ewd-ufaq-deactivation-css', EWD_UFAQ_CD_PLUGIN_URL . 'css/ewd-ufaq-plugin-deactivation.css');
12
+ wp_enqueue_script('ewd-ufaq-deactivation-js', EWD_UFAQ_CD_PLUGIN_URL . 'js/ewd-ufaq-plugin-deactivation.js', array('jquery'));
13
+
14
+ wp_localize_script('ewd-ufaq-deactivation-js', 'ewd_ufaq_deactivation_data', array('site_url' => site_url()));
15
+ }
16
+
17
+ function EWD_UFAQ_Deactivation_Survey_HTML() {
18
+ $Install_Time = get_option("EWD_UFAQ_Install_Time");
19
+
20
+ $options = array(
21
+ 1 => array(
22
+ 'title' => esc_html__( 'I no longer need the plugin', 'ultimate-faqs' ),
23
+ ),
24
+ 2 => array(
25
+ 'title' => esc_html__( 'I\'m switching to a different plugin', 'ultimate-faqs' ),
26
+ 'details' => esc_html__( 'Please share which plugin', 'ultimate-faqs' ),
27
+ ),
28
+ 3 => array(
29
+ 'title' => esc_html__( 'I couldn\'t get the plugin to work', 'ultimate-faqs' ),
30
+ 'details' => esc_html__( 'Please share what wasn\'t working', 'ultimate-faqs' ),
31
+ ),
32
+ 4 => array(
33
+ 'title' => esc_html__( 'It\'s a temporary deactivation', 'ultimate-faqs' ),
34
+ ),
35
+ 5 => array(
36
+ 'title' => esc_html__( 'Other', 'ultimate-faqs' ),
37
+ 'details' => esc_html__( 'Please share the reason', 'ultimate-faqs' ),
38
+ ),
39
+ );
40
+ ?>
41
+ <div class="ewd-ufaq-deactivate-survey-modal" id="ewd-ufaq-deactivate-survey-ultimate-faqs">
42
+ <div class="ewd-ufaq-deactivate-survey-wrap">
43
+ <form class="ewd-ufaq-deactivate-survey" method="post" data-installtime="<?php echo $Install_Time; ?>">
44
+ <span class="ewd-ufaq-deactivate-survey-title"><span class="dashicons dashicons-testimonial"></span><?php echo ' ' . __( 'Quick Feedback', 'ultimate-faqs' ); ?></span>
45
+ <span class="ewd-ufaq-deactivate-survey-desc"><?php echo __('If you have a moment, please share why you are deactivating Ultimate FAQs:', 'ultimate-faqs' ); ?></span>
46
+ <div class="ewd-ufaq-deactivate-survey-options">
47
+ <?php foreach ( $options as $id => $option ) : ?>
48
+ <div class="ewd-ufaq-deactivate-survey-option">
49
+ <label for="ewd-ufaq-deactivate-survey-option-ultimate-faqs-<?php echo $id; ?>" class="ewd-ufaq-deactivate-survey-option-label">
50
+ <input id="ewd-ufaq-deactivate-survey-option-ultimate-faqs-<?php echo $id; ?>" class="ewd-ufaq-deactivate-survey-option-input" type="radio" name="code" value="<?php echo $id; ?>" />
51
+ <span class="ewd-ufaq-deactivate-survey-option-reason"><?php echo $option['title']; ?></span>
52
+ </label>
53
+ <?php if ( ! empty( $option['details'] ) ) : ?>
54
+ <input class="ewd-ufaq-deactivate-survey-option-details" type="text" placeholder="<?php echo $option['details']; ?>" />
55
+ <?php endif; ?>
56
+ </div>
57
+ <?php endforeach; ?>
58
+ </div>
59
+ <div class="ewd-ufaq-deactivate-survey-footer">
60
+ <button type="submit" class="ewd-ufaq-deactivate-survey-submit button button-primary button-large"><?php _e('Submit and Deactivate', 'ultimate-faqs' ); ?></button>
61
+ <a href="#" class="ewd-ufaq-deactivate-survey-deactivate"><?php _e('Skip and Deactivate', 'ultimate-faqs' ); ?></a>
62
+ </div>
63
+ </form>
64
+ </div>
65
+ </div>
66
+ <?php
67
+ }
68
+
69
  ?>
Functions/EWD_UFAQ_Help_Pointers.php CHANGED
@@ -5,7 +5,7 @@ function UFAQ_Return_Pointers() {
5
 
6
  $pointers['tutorial-one'] = array(
7
  'title' => "<h3>" . 'Ultimate FAQ Intro' . "</h3>",
8
- 'content' => "<div><p>Thanks for installing UFAQ! These 6 slides will help get you started using the plugin.</p></div><div class='ufaq-pointer-count'><p>1 of 6</p></div>",
9
  'anchor_id' => '.Header',
10
  'edge' => 'top',
11
  'align' => 'left',
@@ -16,7 +16,7 @@ function UFAQ_Return_Pointers() {
16
 
17
  $pointers['tutorial-two'] = array(
18
  'title' => "<h3>" . 'Create FAQs' . "</h3>",
19
- 'content' => "<div><p>Click 'Add New' to create FAQs for your visitors to view. Enter the FAQ question in the title area and the FAQ answer in the main post content area. Set the author name using the 'Author Display Name' field under the main post content area. Select and/or create FAQ categories and FAQ tags in the right-side menu.</p></div><div class='ufaq-pointer-count'><p>2 of 6</p></div>",
20
  'anchor_id' => '#FAQs_Menu',
21
  'edge' => 'top',
22
  'align' => 'left',
@@ -27,7 +27,7 @@ function UFAQ_Return_Pointers() {
27
 
28
  $pointers['tutorial-three'] = array(
29
  'title' => "<h3>" . 'Set Up Categories' . "</h3>",
30
- 'content' => "<div><p>Categories help organize your FAQs. You can assign FAQs to categories and optionally choose to group your FAQ page by category.</p></div><div class='ufaq-pointer-count'><p>3 of 6</p></div>",
31
  'anchor_id' => '#FAQ_Categories_Menu',
32
  'edge' => 'top',
33
  'align' => 'left',
@@ -38,7 +38,7 @@ function UFAQ_Return_Pointers() {
38
 
39
  $pointers['tutorial-four'] = array(
40
  'title' => "<h3>" . 'Display FAQs' . "</h3>",
41
- 'content' => "<div><p>Place the [ultimate-faqs] shortcode in the content area of any page you've created and it will display your FAQs</p></div><div class='ufaq-pointer-count'><p>4 of 6</p></div>",
42
  'anchor_id' => '#menu-pages',
43
  'edge' => 'top',
44
  'align' => 'left',
@@ -49,7 +49,7 @@ function UFAQ_Return_Pointers() {
49
 
50
  $pointers['tutorial-five'] = array(
51
  'title' => "<h3>" . 'Customize Options' . "</h3>",
52
- 'content' => "<div><p>The FAQ settings area has options to help customize the plugin perfectly for your site, including:</p><ul><li>Toggle and accordion modes</li><li>FAQ comments</li><li>Many styling options and more!</li></ul></div><div class='ufaq-pointer-count'><p>5 of 6</p></div>",
53
  'anchor_id' => '#Options_Menu',
54
  'edge' => 'top',
55
  'align' => 'left',
5
 
6
  $pointers['tutorial-one'] = array(
7
  'title' => "<h3>" . 'Ultimate FAQ Intro' . "</h3>",
8
+ 'content' => "<div><p>Thanks for installing UFAQ! These 6 slides will help get you started using the plugin.</p></div><div class='ufaq-pointer-count'><p>1 of 6 - <span class='ufaq-skip-all-tutorial-pop-ups'>Skip All</span></p></div>",
9
  'anchor_id' => '.Header',
10
  'edge' => 'top',
11
  'align' => 'left',
16
 
17
  $pointers['tutorial-two'] = array(
18
  'title' => "<h3>" . 'Create FAQs' . "</h3>",
19
+ 'content' => "<div><p>Click 'Add New' to create FAQs for your visitors to view. Enter the FAQ question in the title area and the FAQ answer in the main post content area. Set the author name using the 'Author Display Name' field under the main post content area. Select and/or create FAQ categories and FAQ tags in the right-side menu.</p></div><div class='ufaq-pointer-count'><p>2 of 6 - <span class='ufaq-skip-all-tutorial-pop-ups'>Skip All</span></p></div>",
20
  'anchor_id' => '#FAQs_Menu',
21
  'edge' => 'top',
22
  'align' => 'left',
27
 
28
  $pointers['tutorial-three'] = array(
29
  'title' => "<h3>" . 'Set Up Categories' . "</h3>",
30
+ 'content' => "<div><p>Categories help organize your FAQs. You can assign FAQs to categories and optionally choose to group your FAQ page by category.</p></div><div class='ufaq-pointer-count'><p>3 of 6 - <span class='ufaq-skip-all-tutorial-pop-ups'>Skip All</span></p></div>",
31
  'anchor_id' => '#FAQ_Categories_Menu',
32
  'edge' => 'top',
33
  'align' => 'left',
38
 
39
  $pointers['tutorial-four'] = array(
40
  'title' => "<h3>" . 'Display FAQs' . "</h3>",
41
+ 'content' => "<div><p>Place the [ultimate-faqs] shortcode in the content area of any page you've created and it will display your FAQs</p></div><div class='ufaq-pointer-count'><p>4 of 6 - <span class='ufaq-skip-all-tutorial-pop-ups'>Skip All</span></p></div>",
42
  'anchor_id' => '#menu-pages',
43
  'edge' => 'top',
44
  'align' => 'left',
49
 
50
  $pointers['tutorial-five'] = array(
51
  'title' => "<h3>" . 'Customize Options' . "</h3>",
52
+ 'content' => "<div><p>The FAQ settings area has options to help customize the plugin perfectly for your site, including:</p><ul><li>Toggle and accordion modes</li><li>FAQ comments</li><li>Many styling options and more!</li></ul></div><div class='ufaq-pointer-count'><p>5 of 6 - <span class='ufaq-skip-all-tutorial-pop-ups'>Skip All</span></p></div>",
53
  'anchor_id' => '#Options_Menu',
54
  'edge' => 'top',
55
  'align' => 'left',
Functions/EWD_UFAQ_Rewrite_Rules.php CHANGED
@@ -2,6 +2,8 @@
2
  function EWD_UFAQ_Rewrite_Rules() {
3
  global $wp_rewrite;
4
 
 
 
5
  $frontpage_id = get_option('page_on_front');
6
 
7
  add_rewrite_tag('%single_faq%','([^&]+)');
@@ -15,7 +17,9 @@ function EWD_UFAQ_Rewrite_Rules() {
15
  add_rewrite_rule("faq-tag/([^?]*)/?$", "index.php?page_id=". $frontpage_id . "&ufaq_tag_slug=\$matches[1]", 'top');
16
  add_rewrite_rule("(.?.+?)/faq-tag/([^?]*)/?$", "index.php?pagename=\$matches[1]&ufaq_tag_slug=\$matches[2]", 'top');
17
 
18
- flush_rewrite_rules();
 
 
19
  }
20
 
21
  function EWD_UFAQ_add_query_vars_filter( $vars ){
2
  function EWD_UFAQ_Rewrite_Rules() {
3
  global $wp_rewrite;
4
 
5
+ $UFAQ_Rules = get_option('rewrite_rules');
6
+
7
  $frontpage_id = get_option('page_on_front');
8
 
9
  add_rewrite_tag('%single_faq%','([^&]+)');
17
  add_rewrite_rule("faq-tag/([^?]*)/?$", "index.php?page_id=". $frontpage_id . "&ufaq_tag_slug=\$matches[1]", 'top');
18
  add_rewrite_rule("(.?.+?)/faq-tag/([^?]*)/?$", "index.php?pagename=\$matches[1]&ufaq_tag_slug=\$matches[2]", 'top');
19
 
20
+ if (!isset($UFAQ_Rules['(.?.+?)/single-faq/([^&]*)/?$'])) {
21
+ flush_rewrite_rules();
22
+ }
23
  }
24
 
25
  function EWD_UFAQ_add_query_vars_filter( $vars ){
Functions/Error_Notices.php CHANGED
@@ -19,35 +19,41 @@ function EWD_UFAQ_Error_Notices(){
19
  $Ask_Review_Date = get_option('EWD_UFAQ_Ask_Review_Date');
20
  if ($Ask_Review_Date == "") {$Ask_Review_Date = get_option("EWD_UFAQ_Install_Time") + 3600*24*4;}
21
 
22
- if ($Ask_Review_Date < time() and get_option("EWD_UFAQ_Install_Time") < time() - 3600*24*4) { ?>
23
-
24
- <div class='notice notice-info is-dismissible ewd-ufaq-main-dashboard-review-ask' style='display:none'>
25
- <div class='ewd-ufaq-review-ask-plugin-icon'></div>
26
- <div class='ewd-ufaq-review-ask-text'>
27
- <p class='ewd-ufaq-review-ask-starting-text'>Enjoying using the Ultimate FAQs plugin?</p>
28
- <p class='ewd-ufaq-review-ask-feedback-text ufaq-hidden'>Help us make the plugin better! Please take a minute to rate the plugin. Thanks!</p>
29
- <p class='ewd-ufaq-review-ask-review-text ufaq-hidden'>Please let us know what we could do to make the plugin better!<br /><span>(If you would like a response, please include your email address.)</span></p>
30
- <p class='ewd-ufaq-review-ask-thank-you-text ufaq-hidden'>Thank you for taking the time to help us!</p>
31
- </div>
32
- <div class='ewd-ufaq-review-ask-actions'>
33
- <div class='ewd-ufaq-review-ask-action ewd-ufaq-review-ask-not-really ewd-ufaq-review-ask-white'>Not Really</div>
34
- <div class='ewd-ufaq-review-ask-action ewd-ufaq-review-ask-yes ewd-ufaq-review-ask-green'>Yes!</div>
35
- <div class='ewd-ufaq-review-ask-action ewd-ufaq-review-ask-no-thanks ewd-ufaq-review-ask-white ufaq-hidden'>No Thanks</div>
36
- <a href='https://wordpress.org/support/plugin/ultimate-faqs/reviews/?filter=5' target='_blank'>
37
- <div class='ewd-ufaq-review-ask-action ewd-ufaq-review-ask-review ewd-ufaq-review-ask-green ufaq-hidden'>OK, Sure</div>
38
- </a>
39
- </div>
40
- <div class='ewd-ufaq-review-ask-feedback-form ufaq-hidden'>
41
- <div class='ewd-ufaq-review-ask-feedback-explanation'>
42
- <textarea></textarea>
43
  </div>
44
- <div class='ewd-ufaq-review-ask-send-feedback ewd-ufaq-review-ask-action ewd-ufaq-review-ask-green'>Send Feedback</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  </div>
46
- <div class='ewd-ufaq-clear'></div>
47
- </div>
48
 
49
- <?php
 
50
  }
51
  }
52
 
53
- ?>
19
  $Ask_Review_Date = get_option('EWD_UFAQ_Ask_Review_Date');
20
  if ($Ask_Review_Date == "") {$Ask_Review_Date = get_option("EWD_UFAQ_Install_Time") + 3600*24*4;}
21
 
22
+ if ($Ask_Review_Date < time() and get_option("EWD_UFAQ_Install_Time") < time() - 3600*24*4) {
23
+
24
+ global $pagenow;
25
+ if($pagenow != 'post.php' && $pagenow != 'post-new.php'){ ?>
26
+
27
+ <div class='notice notice-info is-dismissible ewd-ufaq-main-dashboard-review-ask' style='display:none'>
28
+ <div class='ewd-ufaq-review-ask-plugin-icon'></div>
29
+ <div class='ewd-ufaq-review-ask-text'>
30
+ <p class='ewd-ufaq-review-ask-starting-text'>Enjoying using the Ultimate FAQs plugin?</p>
31
+ <p class='ewd-ufaq-review-ask-feedback-text ufaq-hidden'>Help us make the plugin better! Please take a minute to rate the plugin. Thanks!</p>
32
+ <p class='ewd-ufaq-review-ask-review-text ufaq-hidden'>Please let us know what we could do to make the plugin better!<br /><span>(If you would like a response, please include your email address.)</span></p>
33
+ <p class='ewd-ufaq-review-ask-thank-you-text ufaq-hidden'>Thank you for taking the time to help us!</p>
 
 
 
 
 
 
 
 
 
34
  </div>
35
+ <div class='ewd-ufaq-review-ask-actions'>
36
+ <div class='ewd-ufaq-review-ask-action ewd-ufaq-review-ask-not-really ewd-ufaq-review-ask-white'>Not Really</div>
37
+ <div class='ewd-ufaq-review-ask-action ewd-ufaq-review-ask-yes ewd-ufaq-review-ask-green'>Yes!</div>
38
+ <div class='ewd-ufaq-review-ask-action ewd-ufaq-review-ask-no-thanks ewd-ufaq-review-ask-white ufaq-hidden'>No Thanks</div>
39
+ <a href='https://wordpress.org/support/plugin/ultimate-faqs/reviews/?filter=5' target='_blank'>
40
+ <div class='ewd-ufaq-review-ask-action ewd-ufaq-review-ask-review ewd-ufaq-review-ask-green ufaq-hidden'>OK, Sure</div>
41
+ </a>
42
+ </div>
43
+ <div class='ewd-ufaq-review-ask-feedback-form ufaq-hidden'>
44
+ <div class='ewd-ufaq-review-ask-feedback-explanation'>
45
+ <textarea></textarea>
46
+ <br>
47
+ <input type="email" name="feedback_email_address" placeholder="<?php _e('Email Address', 'ultimate-faqs'); ?>">
48
+ </div>
49
+ <div class='ewd-ufaq-review-ask-send-feedback ewd-ufaq-review-ask-action ewd-ufaq-review-ask-green'>Send Feedback</div>
50
+ </div>
51
+ <div class='ewd-ufaq-clear'></div>
52
  </div>
 
 
53
 
54
+ <?php
55
+ }
56
  }
57
  }
58
 
59
+
Functions/Process_Ajax.php CHANGED
@@ -148,17 +148,40 @@ add_action('wp_ajax_ewd_ufaq_wc_faq_category','EWD_UFAQ_WC_FAQ_Category');
148
  function EWD_UFAQ_Hide_Review_Ask() {
149
  $Ask_Review_Date = sanitize_text_field($_POST['Ask_Review_Date']);
150
 
151
- update_option('EWD_UFAQ_Ask_Review_Date', time()+3600*24*$Ask_Review_Date);
 
 
152
 
153
  die();
154
  }
155
  add_action('wp_ajax_ewd_ufaq_hide_review_ask','EWD_UFAQ_Hide_Review_Ask');
156
 
157
  function EWD_UFAQ_Send_Feedback() {
 
158
  $Feedback = sanitize_text_field($_POST['Feedback']);
 
 
159
 
160
- wp_mail('contact@etoilewebdesign.com', 'UFAQ Feedback - Dashboard Form', $Feedback);
161
 
162
  die();
163
  }
164
- add_action('wp_ajax_ewd_ufaq_send_feedback','EWD_UFAQ_Send_Feedback');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  function EWD_UFAQ_Hide_Review_Ask() {
149
  $Ask_Review_Date = sanitize_text_field($_POST['Ask_Review_Date']);
150
 
151
+ if (get_option('EWD_UFAQ_Ask_Review_Date') < time()+3600*24*$Ask_Review_Date) {
152
+ update_option('EWD_UFAQ_Ask_Review_Date', time()+3600*24*$Ask_Review_Date);
153
+ }
154
 
155
  die();
156
  }
157
  add_action('wp_ajax_ewd_ufaq_hide_review_ask','EWD_UFAQ_Hide_Review_Ask');
158
 
159
  function EWD_UFAQ_Send_Feedback() {
160
+ $headers = 'Content-type: text/html;charset=utf-8' . "\r\n";
161
  $Feedback = sanitize_text_field($_POST['Feedback']);
162
+ $Feedback .= '<br /><br />Email Address: ';
163
+ $Feedback .= sanitize_text_field($_POST['EmailAddress']);
164
 
165
+ wp_mail('contact@etoilewebdesign.com', 'UFAQ Feedback - Dashboard Form', $Feedback, $headers);
166
 
167
  die();
168
  }
169
+ add_action('wp_ajax_ewd_ufaq_send_feedback','EWD_UFAQ_Send_Feedback');
170
+
171
+ function EWD_UFAQ_Dismiss_Pointers() {
172
+ $uid = get_current_user_id();
173
+ $pointers = explode( ',', (string) get_user_meta( $uid, 'dismissed_wp_pointers', TRUE ) );
174
+
175
+ $pointers[] = 'ewd_ufaq_admin_pointers_tutorial-one';
176
+ $pointers[] = 'ewd_ufaq_admin_pointers_tutorial-two';
177
+ $pointers[] = 'ewd_ufaq_admin_pointers_tutorial-three';
178
+ $pointers[] = 'ewd_ufaq_admin_pointers_tutorial-four';
179
+ $pointers[] = 'ewd_ufaq_admin_pointers_tutorial-five';
180
+ $pointers[] = 'ewd_ufaq_admin_pointers_tutorial-six';
181
+
182
+ $unique_pointers = array_unique($pointers);
183
+ update_usermeta($uid, 'dismissed_wp_pointers', implode(",", $unique_pointers));
184
+
185
+ die();
186
+ }
187
+ add_action('wp_ajax_ufaq-dismiss-wp-pointers','EWD_UFAQ_Dismiss_Pointers');
Main.php CHANGED
@@ -1,397 +1,397 @@
1
- <?php
2
- /*
3
- Plugin Name: Ultimate FAQ
4
- Plugin URI: http://www.EtoileWebDesign.com/wordpress-plugins/
5
- Description: FAQ plugin that lets you easily create, order and publicize FAQs using shortcodes, with many unique styles, WooCommerce FAQs and AJAX FAQ search
6
- Author: Etoile Web Design
7
- Author URI: http://www.EtoileWebDesign.com/wordpress-plugins/
8
- Terms and Conditions: http://www.etoilewebdesign.com/plugin-terms-and-conditions/
9
- Text Domain: ultimate-faqs
10
- Version: 1.8.11
11
- */
12
-
13
- global $ewd_ufaq_message;
14
- global $UFAQ_Full_Version;
15
- global $EWD_UFAQ_Version;
16
-
17
- $EWD_UFAQ_Version = '1.8.0c';
18
-
19
- define( 'EWD_UFAQ_CD_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
20
- define( 'EWD_UFAQ_CD_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
21
-
22
- //define('WP_DEBUG', true);
23
-
24
- register_activation_hook(__FILE__,'Set_EWD_UFAQ_Options');
25
- register_activation_hook(__FILE__,'Run_UFAQ_Tutorial');
26
- register_activation_hook(__FILE__,'EWD_UFAQ_Show_Dashboard_Link');
27
- add_filter('upgrader_post_install', 'Set_EWD_UFAQ_Options');
28
-
29
- /* Hooks neccessary admin tasks */
30
- if ( is_admin() ){
31
- add_action('widgets_init', 'Update_EWD_UFAQ_Content');
32
- add_action('admin_notices', 'EWD_UFAQ_Error_Notices');
33
- add_action('admin_enqueue_scripts', 'Add_EWD_UFAQ_Scripts', 10, 1);
34
- add_action('admin_head', 'EWD_UFAQ_Admin_Options');
35
- }
36
-
37
- function EWD_UFAQ_Enable_Sub_Menu() {
38
- global $submenu;
39
-
40
- $Admin_Approval = get_option("EWD_UFAQ_Admin_Approval");
41
- $Access_Role = get_option("UPCP_Access_Role");
42
-
43
- if ($Access_Role == "") {$Access_Role = "edit_posts";}
44
-
45
- remove_menu_page('edit.php?post_type=ufaq');
46
-
47
- add_menu_page( 'Ultimate FAQs', 'FAQs', $Access_Role, 'EWD-UFAQ-Options', 'EWD_UFAQ_Output_Pages', 'dashicons-format-chat', '49.1' );
48
- add_submenu_page('EWD-UFAQ-Options', 'FAQ Options', 'FAQ Settings', $Access_Role, 'EWD-UFAQ-Options&DisplayPage=Options', 'EWD_UFAQ_Output_Pages');
49
- if ($Admin_Approval == "Yes") {
50
- $submenu['EWD-UFAQ-Options'][6] = $submenu['EWD-UFAQ-Options'][1];
51
- $submenu['EWD-UFAQ-Options'][1] = array( 'Approved FAQs', $Access_Role, "edit.php?post_type=ufaq&post_status=publish", "Approved FAQs" );
52
- $submenu['EWD-UFAQ-Options'][2] = array( 'Awaiting Approval', $Access_Role, "edit.php?post_type=ufaq&post_status=draft", "Awaiting Approval" );
53
- $submenu['EWD-UFAQ-Options'][3] = array( 'Add New', $Access_Role, "post-new.php?post_type=ufaq", "Add New" );
54
- $submenu['EWD-UFAQ-Options'][4] = array( 'FAQ Categories', $Access_Role, "edit-tags.php?taxonomy=ufaq-category&post_type=ufaq", "FAQ Categories" );
55
- $submenu['EWD-UFAQ-Options'][5] = array( 'FAQ Tags', $Access_Role, "edit-tags.php?taxonomy=ufaq-tag&post_type=ufaq", "FAQ Tags" );
56
- }
57
- else {
58
- $submenu['EWD-UFAQ-Options'][5] = $submenu['EWD-UFAQ-Options'][1];
59
- $submenu['EWD-UFAQ-Options'][1] = array( 'FAQs', $Access_Role, "edit.php?post_type=ufaq", "FAQs" );
60
- $submenu['EWD-UFAQ-Options'][2] = array( 'Add New', $Access_Role, "post-new.php?post_type=ufaq", "Add New" );
61
- $submenu['EWD-UFAQ-Options'][3] = array( 'FAQ Categories', $Access_Role, "edit-tags.php?taxonomy=ufaq-category&post_type=ufaq", "FAQ Categories" );
62
- $submenu['EWD-UFAQ-Options'][4] = array( 'FAQ Tags', $Access_Role, "edit-tags.php?taxonomy=ufaq-tag&post_type=ufaq", "FAQ Tags" );
63
- }
64
- add_submenu_page('EWD-UFAQ-Options', 'FAQ Export', 'FAQ Export', $Access_Role, 'EWD-UFAQ-Options&DisplayPage=Export', 'EWD_UFAQ_Output_Pages');
65
- add_submenu_page('EWD-UFAQ-Options', 'FAQ Import', 'FAQ Import', $Access_Role, 'EWD-UFAQ-Options&DisplayPage=ImportPosts', 'EWD_UFAQ_Output_Pages');
66
-
67
- $submenu['EWD-UFAQ-Options'][0][0] = "Dashboard";
68
- ksort($submenu['EWD-UFAQ-Options']);
69
- }
70
- add_action('admin_menu' , 'EWD_UFAQ_Enable_Sub_Menu', 1);
71
-
72
- function EWD_UFAQ_Add_Header_Bar($Called = "No") {
73
- global $pagenow, $post;
74
-
75
- if ($Called != "Yes" and (!isset($_GET['post_type']) or $_GET['post_type'] != "ufaq") and (!is_object($post) or $post->post_type != 'ufaq')) {return;}
76
-
77
- $Admin_Approval = get_option("EWD_UFAQ_Admin_Approval"); ?>
78
-
79
- <div class="EWD_UFAQ_Menu">
80
- <h2 class="nav-tab-wrapper">
81
- <a id="ewd-ufaq-dash-mobile-menu-open" href="#" class="MenuTab nav-tab"><?php _e("MENU", 'ultimate-faqs'); ?><span id="ewd-ufaq-dash-mobile-menu-down-caret">&nbsp;&nbsp;&#9660;</span><span id="ewd-ufaq-dash-mobile-menu-up-caret">&nbsp;&nbsp;&#9650;</span></a>
82
- <a id="Dashboard_Menu" href='admin.php?page=EWD-UFAQ-Options' class="MenuTab nav-tab <?php if (!isset($_GET['post_type']) and (isset($_GET['DisplayPage']) and ($_GET['DisplayPage'] == '' or $_GET['DisplayPage'] == 'Dashboard'))) {echo 'nav-tab-active';}?>"><?php _e("Dashboard", 'ultimate-faqs'); ?></a>
83
- <?php if ($Admin_Approval == "Yes") { ?>
84
- <a id="Approved_FAQs_Menu" href='edit.php?post_type=ufaq&post_status=publish' class="MenuTab nav-tab <?php if (isset($_GET['post_type']) and $_GET['post_type'] == 'ufaq' and $pagenow == 'edit.php' and (!isset($_GET['post_status']) or $_GET['post_status'] == 'publish')) {echo 'nav-tab-active';}?>"><?php _e("Approved FAQs", 'ultimate-faqs'); ?></a>
85
- <a id="FAQs_Awaiting_Approval_Menu" href='edit.php?post_type=ufaq&post_status=draft' class="MenuTab nav-tab <?php if (isset($_GET['post_type']) and $_GET['post_type'] == 'ufaq' and $pagenow == 'edit.php' and $_GET['post_status'] == 'draft') {echo 'nav-tab-active';}?>"><?php _e("Awaiting Approval", 'ultimate-faqs'); ?></a>
86
- <?php } else { ?>
87
- <a id="FAQs_Menu" href='edit.php?post_type=ufaq' class="MenuTab nav-tab <?php if (isset($_GET['post_type']) and $_GET['post_type'] == 'ufaq' and $pagenow == 'edit.php') {echo 'nav-tab-active';}?>"><?php _e("FAQs", 'ultimate-faqs'); ?></a>
88
- <?php } ?>
89
- <a id="Add_New_Menu" href='post-new.php?post_type=ufaq' class="MenuTab nav-tab <?php if (isset($_GET['post_type']) and $_GET['post_type'] == 'ufaq' and $pagenow == 'post-new.php') {echo 'nav-tab-active';}?>"><?php _e("Add New", 'ultimate-faqs'); ?></a>
90
- <a id="FAQ_Categories_Menu" href='edit-tags.php?taxonomy=ufaq-category&post_type=ufaq' class="MenuTab nav-tab <?php if (isset($_GET['post_type']) and $_GET['post_type'] == 'ufaq' and $pagenow == 'edit-tags.php' and $_GET['taxonomy'] == "ufaq-category") {echo 'nav-tab-active';}?>"><?php _e("Categories", 'ultimate-faqs'); ?></a>
91
- <a id="FAQ_Categories_Menu" href='edit-tags.php?taxonomy=ufaq-tag&post_type=ufaq' class="MenuTab nav-tab <?php if (isset($_GET['post_type']) and $_GET['post_type'] == 'ufaq' and $pagenow == 'edit-tags.php' and $_GET['taxonomy'] == "ufaq-tag") {echo 'nav-tab-active';}?>"><?php _e("Tags", 'ultimate-faqs'); ?></a>
92
- <a id="Options_Menu" href='admin.php?page=EWD-UFAQ-Options&DisplayPage=Options' class="MenuTab nav-tab <?php if (!isset($_GET['post_type']) and isset($_GET['DisplayPage']) and $_GET['DisplayPage'] == 'Options') {echo 'nav-tab-active';}?>"><?php _e("Options", 'ultimate-faqs'); ?></a>
93
- <a id="WooCommerce_Import_Menu" href='admin.php?page=EWD-UFAQ-Options&DisplayPage=Export' class="MenuTab nav-tab <?php if (!isset($_GET['post_type']) and isset($_GET['DisplayPage']) and $_GET['DisplayPage'] == 'Export') {echo 'nav-tab-active';}?>"><?php _e("Export", 'ultimate-faqs'); ?></a>
94
- <a id="WooCommerce_Import_Menu" href='admin.php?page=EWD-UFAQ-Options&DisplayPage=ImportPosts' class="MenuTab nav-tab <?php if (!isset($_GET['post_type']) and isset($_GET['DisplayPage']) and $_GET['DisplayPage'] == 'ImportPosts') {echo 'nav-tab-active';}?>"><?php _e("Import", 'ultimate-faqs'); ?></a>
95
- </h2>
96
- </div>
97
- <?php }
98
- add_action('admin_notices', 'EWD_UFAQ_Add_Header_Bar');
99
-
100
- /* Add localization support */
101
- function EWD_UFAQ_localization_setup() {
102
- load_plugin_textdomain('ultimate-faqs', false, dirname(plugin_basename(__FILE__)) . '/lang/');
103
- }
104
- add_action('after_setup_theme', 'EWD_UFAQ_localization_setup');
105
-
106
- // Add settings link on plugin page
107
- function EWD_UFAQ_plugin_settings_link($links) {
108
- $settings_link = '<a href="admin.php?page=EWD-UFAQ-Options">Settings</a>';
109
- array_unshift($links, $settings_link);
110
- return $links;
111
- }
112
- $plugin = plugin_basename(__FILE__);
113
- add_filter("plugin_action_links_$plugin", 'EWD_UFAQ_plugin_settings_link' );
114
-
115
- function Add_EWD_UFAQ_Scripts($hook) {
116
- global $post, $EWD_UFAQ_Version;
117
-
118
- wp_enqueue_script('ewd-ufaq-review-ask', plugins_url("js/ewd-ufaq-dashboard-review-ask.js", __FILE__), array('jquery'), $EWD_UFAQ_Version);
119
-
120
- if ((isset($_GET['post_type']) && $_GET['post_type'] == 'ufaq') or
121
- (isset($_GET['page']) && $_GET['page'] == 'EWD-UFAQ-Options')) {
122
- $url_one = plugins_url("ultimate-faqs/js/sorttable.js");
123
- $url_two = plugins_url("ultimate-faqs/js/Admin.js");
124
- $url_three = plugins_url("ultimate-faqs/js/spectrum.js");
125
-
126
- wp_enqueue_script('jquery-ui-sortable');
127
- wp_enqueue_script('sortable', $url_one, array('jquery'));
128
- wp_enqueue_script('UFAQ Admin', $url_two, array('jquery'), $EWD_UFAQ_Version);
129
- wp_enqueue_script('spectrum', $url_three, array('jquery'));
130
- }
131
-
132
- if ($hook == 'edit.php' or $hook == 'post-new.php' or $hook == 'post.php') {
133
- if (isset($post->post_type) and $post->post_type == 'product') {
134
- wp_enqueue_script('ewd-ufaq-wc-admin', plugins_url("js/ewd-ufaq-wc-admin.js", __FILE__), array('jquery'), $EWD_UFAQ_Version);
135
- }
136
- }
137
- }
138
-
139
- function EWD_UFAQ_Admin_Options() {
140
- global $EWD_UFAQ_Version;
141
-
142
- wp_enqueue_style( 'ewd-ufaq-admin', plugins_url("ultimate-faqs/css/Admin.css"), array(), $EWD_UFAQ_Version);
143
- wp_enqueue_style( 'ewd-ufaq-spectrum', plugins_url("ultimate-faqs/css/spectrum.css"));
144
- }
145
-
146
- add_action( 'wp_enqueue_scripts', 'Add_EWD_UFAQ_FrontEnd_Scripts' );
147
- function Add_EWD_UFAQ_FrontEnd_Scripts() {
148
- global $EWD_UFAQ_Version;
149
-
150
- wp_register_script('ewd-ufaq-js', plugins_url( '/js/ewd-ufaq-js.js' , __FILE__ ), array( 'jquery' ), $EWD_UFAQ_Version);
151
-
152
- $Highlight_Search_Term = get_option("EWD_UFAQ_Highlight_Search_Term");
153
-
154
- $Retrieving_Results = get_option("EWD_UFAQ_Retrieving_Results");
155
- if ($Retrieving_Results == "") {$Retrieving_Results = __("Retrieving Results", 'ultimate-faqs') . "...";}
156
-
157
- $ewd_ufaq_php_data = array(
158
- 'retrieving_results' => $Retrieving_Results,
159
- 'highlight_search_term' => $Highlight_Search_Term
160
- );
161
-
162
- wp_localize_script('ewd-ufaq-js', 'ewd_ufaq_php_data', $ewd_ufaq_php_data );
163
- }
164
-
165
-
166
- add_action( 'wp_enqueue_scripts', 'EWD_UFAQ_Add_Stylesheet' );
167
- function EWD_UFAQ_Add_Stylesheet() {
168
- global $EWD_UFAQ_Version;
169
-
170
- wp_register_style( 'ewd-ufaq-style', plugins_url('css/ewd-ufaq-styles.css', __FILE__) );
171
- wp_enqueue_style( 'ewd-ufaq-style', $EWD_UFAQ_Version );
172
-
173
- wp_register_style( 'ewd-ufaq-rrssb', plugins_url('css/rrssb-min.css', __FILE__) );
174
- wp_enqueue_style( 'ewd-ufaq-rrssb' );
175
- }
176
-
177
- //add_action('activated_plugin','save_ufaq_error');
178
- function save_ufaq_error(){
179
- update_option('plugin_error', ob_get_contents());
180
- file_put_contents("Error.txt", ob_get_contents());
181
- }
182
-
183
- function Set_EWD_UFAQ_Options() {
184
- if (get_option("EWD_UFAQ_Toggle") == "") {update_option("EWD_UFAQ_Toggle", "Yes");}
185
- if (get_option("EWD_UFAQ_Category_Toggle") == "") {update_option("EWD_UFAQ_Category_Toggle", "No");}
186
- if (get_option("EWD_UFAQ_Category_Accordion") == "") {update_option("EWD_UFAQ_Category_Accordion", "No");}
187
- if (get_option("EWD_UFAQ_Expand_Collapse_All") == "") {update_option("EWD_UFAQ_Expand_Collapse_All", "No");}
188
- if (get_option("EWD_UFAQ_FAQ_Accordion") == "") {update_option("EWD_UFAQ_FAQ_Accordion", "No");}
189
- if (get_option("EWD_UFAQ_Hide_Categories") == "") {update_option("EWD_UFAQ_Hide_Categories", "No");}
190
- if (get_option("EWD_UFAQ_Hide_Tags") == "") {update_option("EWD_UFAQ_Hide_Tags", "No");}
191
- if (get_option("EWD_UFAQ_Scroll_To_Top") == "") {update_option("EWD_UFAQ_Scroll_To_Top", "Yes");}
192
- if (get_option("EWD_UFAQ_Display_All_Answers") == "") {update_option("EWD_UFAQ_Display_All_Answers", "No");}
193
- if (get_option("EWD_UFAQ_Display_Author") == "") {update_option("EWD_UFAQ_Display_Author", "Yes");}
194
- if (get_option("EWD_UFAQ_Display_Date") == "") {update_option("EWD_UFAQ_Display_Date", "Yes");}
195
- if (get_option("EWD_UFAQ_Display_Back_To_Top") == "") {update_option("EWD_UFAQ_Display_Back_To_Top", "No");}
196
- if (get_option("EWD_UFAQ_Include_Permalink") == "") {update_option("EWD_UFAQ_Include_Permalink", "Yes");}
197
- if (get_option("EWD_UFAQ_Permalink_Type") == "") {update_option("EWD_UFAQ_Permalink_Type", "SamePage");}
198
- if (get_option("EWD_UFAQ_Show_TinyMCE") == "") {update_option("EWD_UFAQ_Show_TinyMCE", "Yes");}
199
- if (get_option("EWD_UFAQ_Comments_On") == "") {update_option("EWD_UFAQ_Comments_On", "Yes");}
200
- if (get_option("EWD_UFAQ_Access_Role") == "") {update_option("EWD_UFAQ_Access_Role", "edit_posts");}
201
-
202
- if (get_option("EWD_UFAQ_Display_Style") == "") {update_option("EWD_UFAQ_Display_Style", "Default");}
203
- if (get_option("EWD_UFAQ_FAQ_Number_Of_Columns") == "") {update_option("EWD_UFAQ_Display_Style", "One");}
204
- if (get_option("EWD_UFAQ_Color_Block_Shape") == "") {update_option("EWD_UFAQ_Color_Block_Shape", "Square");}
205
- if (get_option("EWD_UFAQ_Page_Type") == "") {update_option("EWD_UFAQ_Page_Type", "Load_More");}
206
- if (get_option("EWD_UFAQ_FAQ_Ratings") == "") {update_option("EWD_UFAQ_FAQ_Ratings", "No");}
207
- if (get_option("EWD_UFAQ_WooCommerce_FAQs") == "") {update_option("EWD_UFAQ_WooCommerce_FAQs", "No");}
208
- if (get_option("EWD_UFAQ_Use_Product") == "") {update_option("EWD_UFAQ_Use_Product", "Yes");}
209
- if (get_option("EWD_UFAQ_Reveal_Effect") == "") {update_option("EWD_UFAQ_Reveal_Effect", "none");}
210
- if (get_option("EWD_UFAQ_Pretty_Permalinks") == "") {update_option("EWD_UFAQ_Pretty_Permalinks", "No");}
211
- if (get_option("EWD_UFAQ_Allow_Proposed_Answer") == "") {update_option("EWD_UFAQ_Allow_Proposed_Answer", "No");}
212
- if (get_option("EWD_UFAQ_Submit_Custom_Fields") == "") {update_option("EWD_UFAQ_Submit_Custom_Fields", "No");}
213
- if (get_option("EWD_UFAQ_Submit_Question_Captcha") == "") {update_option("EWD_UFAQ_Submit_Question_Captcha", "No");}
214
- if (get_option("EWD_UFAQ_Admin_Question_Notification") == "") {update_option("EWD_UFAQ_Admin_Question_Notification", "No");}
215
- if (get_option("EWD_UFAQ_Submit_FAQ_Email") == "") {update_option("EWD_UFAQ_Submit_FAQ_Email", 0);}
216
- if (get_option("EWD_UFAQ_Auto_Complete_Titles") == "") {update_option("EWD_UFAQ_Auto_Complete_Titles", "Yes");}
217
- if (get_option("EWD_UFAQ_Highlight_Search_Term") == "") {update_option("EWD_UFAQ_Highlight_Search_Term", "No");}
218
- if (get_option("EWD_UFAQ_Slug_Base") == "") {update_option("EWD_UFAQ_Slug_Base", "ufaqs");}
219
-
220
- if (get_option("EWD_UFAQ_FAQ_Elements") == "") {
221
- $FAQ_Elements = array();
222
- $FAQ_Elements[0] = "Author_Date";
223
- $FAQ_Elements[1] = "Body";
224
- $FAQ_Elements[2] = "Custom_Fields";
225
- $FAQ_Elements[3] = "Categories";
226
- $FAQ_Elements[4] = "Tags";
227
- $FAQ_Elements[5] = "Ratings";
228
- $FAQ_Elements[6] = "Social_Media";
229
- $FAQ_Elements[7] = "Permalink";
230
- $FAQ_Elements[8] = "Comments";
231
- $FAQ_Elements[9] = "Back_To_Top";
232
-
233
- update_option("EWD_UFAQ_FAQ_Elements", $FAQ_Elements);
234
- }
235
-
236
- if (get_option("EWD_UFAQ_Group_By_Category") == "") {update_option("EWD_UFAQ_Group_By_Category", "No");}
237
- if (get_option("EWD_UFAQ_Group_By_Category_Count") == "") {update_option("EWD_UFAQ_Group_By_Category_Count", "No");}
238
- if (get_option("EWD_UFAQ_Group_By_Order_By") == "") {update_option("EWD_UFAQ_Group_By_Order_By", "name");}
239
- if (get_option("EWD_UFAQ_Group_By_Order") == "") {update_option("EWD_UFAQ_Group_By_Order", "ASC");}
240
- if (get_option("EWD_UFAQ_Order_By") == "") {update_option("EWD_UFAQ_Order_By", "date");}
241
- if (get_option("EWD_UFAQ_Order") == "") {update_option("EWD_UFAQ_Order", "DESC");}
242
-
243
- if (get_option("EWD_UFAQ_Hide_Blank_Fields") == "") {update_option("EWD_UFAQ_Hide_Blank_Fields", "Yes");}
244
-
245
- if (get_option("EWD_UFAQ_Styling_Category_Heading_Type") == "") {update_option("EWD_UFAQ_Styling_Category_Heading_Type", "h4");}
246
- if (get_option("EWD_UFAQ_Styling_FAQ_Heading_Type") == "") {update_option("EWD_UFAQ_Styling_FAQ_Heading_Type", "h4");}
247
- if (get_option("EWD_UFAQ_Toggle_Symbol") == "") {update_option("EWD_UFAQ_Toggle_Symbol", "A");}
248
-
249
- if (get_option("EWD_UFAQ_Full_Version") == "") {update_option("EWD_UFAQ_Full_Version", "No");}
250
- if (get_option("EWD_UFAQ_Install_Flag") == "") {update_option("EWD_UFAQ_Update_Flag", "Yes");}
251
- if (get_option("EWD_UFAQ_Install_Flag") == "") {update_option("EWD_UFAQ_Install_Flag", "Yes");}
252
-
253
- if (get_option("EWD_UFAQ_Install_Version") == "") {update_option("EWD_UFAQ_Install_Version", 1.6);}
254
- if (get_option("EWD_UFAQ_Install_Time") == "") {update_option("EWD_UFAQ_Install_Time", time());}
255
- }
256
-
257
- $UFAQ_Full_Version = get_option("EWD_UFAQ_Full_Version");
258
- if (isset($_GET['post_type']) and $_GET['post_type'] == 'ufaq' and isset($_POST['EWD_UFAQ_Upgrade_To_Full']) and $UFAQ_Full_Version == "Yes") {add_action("admin_notices", "EWD_UFAQ_Upgrade_Notice");}
259
-
260
- $PrettyLinks = get_option("EWD_UFAQ_Pretty_Permalinks");
261
- if ($PrettyLinks == "Yes") {
262
- add_filter( 'query_vars', 'EWD_UFAQ_add_query_vars_filter' );
263
- add_filter('init', 'EWD_UFAQ_Rewrite_Rules');
264
- update_option("EWD_UFAQ_Update_RR_Rules", "No");
265
- }
266
-
267
- if (isset($_POST['EWD_UFAQ_Upgrade_To_Full'])) {
268
- add_action('admin_init', 'EWD_UFAQ_Upgrade_To_Full');
269
- }
270
-
271
- $Show_TinyMCE = get_option("EWD_UFAQ_Show_TinyMCE");
272
- if ($Show_TinyMCE == "Yes") {
273
- add_filter( 'mce_buttons', 'EWD_UFAQ_Register_TinyMCE_Buttons' );
274
- add_filter( 'mce_external_plugins', 'EWD_UFAQ_Register_TinyMCE_Javascript' );
275
- add_action('admin_head', 'EWD_UFAQ_Output_TinyMCE_Vars');
276
- }
277
-
278
- function EWD_UFAQ_Register_TinyMCE_Buttons( $buttons ) {
279
- array_push( $buttons, 'separator', 'UFAQ_Shortcodes' );
280
- return $buttons;
281
- }
282
-
283
- function EWD_UFAQ_Register_TinyMCE_Javascript( $plugin_array ) {
284
- $plugin_array['UFAQ_Shortcodes'] = plugins_url( '/js/tinymce-plugin.js',__FILE__ );
285
-
286
- return $plugin_array;
287
- }
288
-
289
- function EWD_UFAQ_Output_TinyMCE_Vars() {
290
- global $UFAQ_Full_Version;
291
- $UFAQ_Categories = get_terms('ufaq-category');
292
-
293
- echo "<script type='text/javascript'>";
294
- echo "var ufaq_premium = '" . $UFAQ_Full_Version . "';\n";
295
- echo "var ufaq_categories = " . json_encode($UFAQ_Categories) . ";\n";
296
- echo "</script>";
297
- }
298
-
299
- function Run_UFAQ_Tutorial() {
300
- update_option("UFAQ_Run_Tutorial", "Yes");
301
- }
302
-
303
- if (get_option("UFAQ_Run_Tutorial") == "Yes" and isset($_GET['page']) and $_GET['page'] == 'EWD-UFAQ-Options') {
304
- add_action( 'admin_enqueue_scripts', 'UFAQ_Set_Pointers', 10, 1);
305
- }
306
-
307
- function UFAQ_Set_Pointers($page) {
308
- $Pointers = UFAQ_Return_Pointers();
309
-
310
- //Arguments: pointers php file, version (dots will be replaced), prefix
311
- $manager = new UFAQPointersManager( $Pointers, '1.0', 'ufaq_admin_pointers' );
312
- $manager->parse();
313
- $pointers = $manager->filter( $page );
314
- if ( empty( $pointers ) ) { // nothing to do if no pointers pass the filter
315
- return;
316
- }
317
- wp_enqueue_style( 'wp-pointer' );
318
- $js_url = plugins_url( 'js/ewd-ufaq-pointers.js', __FILE__ );
319
- wp_enqueue_script( 'ufaq_admin_pointers', $js_url, array('wp-pointer'), NULL, TRUE );
320
- //data to pass to javascript
321
- $data = array(
322
- 'next_label' => __( 'Next' ),
323
- 'close_label' => __('Close'),
324
- 'pointers' => $pointers
325
- );
326
- wp_localize_script( 'ufaq_admin_pointers', 'MyAdminPointers', $data );
327
- //update_option("UFAQ_Run_Tutorial", "No");
328
- }
329
-
330
- function EWD_UFAQ_Show_Dashboard_Link() {
331
- set_transient('ewd-ufaq-admin-install-notice', true, 5);
332
- }
333
-
334
- function UFAQ_Leave_Reply_Text($translation, $text, $domain) {
335
- global $post;
336
- if ($text == 'Leave a Reply' and (is_object($post) and $post->post_type == 'ufaq')) {
337
- $translations = &get_translations_for_domain( $domain);
338
- return $translations->translate( 'Comment on this FAQ' );
339
- }
340
- return $translation;
341
- }
342
- add_filter('gettext', 'UFAQ_Leave_Reply_Text', 10, 4);
343
-
344
-
345
- function UFAQ_Post_Edit_Styles( $hook_suffix ){
346
- $cpt = 'ufaq';
347
- if( in_array( $hook_suffix, array('post.php', 'post-new.php') ) ){
348
- $screen = get_current_screen();
349
- if( is_object( $screen ) && $cpt == $screen->post_type ){
350
- wp_enqueue_style( 'ewd-ufaq-post-edit-styles', plugins_url("ultimate-faqs/css/ewd-ufaq-post-edit-styles.css"), $EWD_UFAQ_Version );
351
- }
352
- }
353
- }
354
- add_action('admin_enqueue_scripts', 'UFAQ_Post_Edit_Styles');
355
-
356
- include "blocks/ewd-ufaq-blocks.php";
357
- include "Functions/Error_Notices.php";
358
- include "Functions/EWD_UFAQ_Add_Social_Media_Buttons.php";
359
- include "Functions/EWD_UFAQ_Add_Views_Column.php";
360
- include "Functions/EWD_UFAQ_Captcha.php";
361
- include "Functions/EWD_UFAQ_Deactivation_Survey.php";
362
- include "Functions/EWD_UFAQ_Export.php";
363
- include "Functions/EWD_UFAQ_Help_Pointers.php";
364
- include "Functions/EWD_UFAQ_Import.php";
365
- include "Functions/EWD_UFAQ_Meta_Boxes.php";
366
- include "Functions/EWD_UFAQ_Styling.php";
367
- include "Functions/EWD_UFAQ_Output_Pages.php";
368
- include "Functions/EWD_UFAQ_Pointers_Manager_Interface.php";
369
- include "Functions/EWD_UFAQ_Pointers_Manager_Class.php";
370
- include "Functions/EWD_UFAQ_Rewrite_Rules.php";
371
- include "Functions/EWD_UFAQ_Submit_Question.php";
372
- include "Functions/EWD_UFAQ_Upgrade_Box.php";
373
- include "Functions/EWD_UFAQ_Version_Reversion.php";
374
- include "Functions/EWD_UFAQ_Version_Update.php";
375
- include "Functions/EWD_UFAQ_Widgets.php";
376
- include "Functions/EWD_UFAQ_WooCommerce_Tab.php";
377
- include "Functions/FrontEndAjaxUrl.php";
378
- include "Functions/Full_Upgrade.php";
379
- include "Functions/Process_Ajax.php";
380
- include "Functions/Register_EWD_UFAQ_Posts_Taxonomies.php";
381
- include "Functions/Update_Admin_Databases.php";
382
- include "Functions/Update_EWD_UFAQ_Content.php";
383
-
384
- include "Shortcodes/DisplayFAQs.php";
385
- include "Shortcodes/Display_FAQ_Search.php";
386
- include "Shortcodes/Display_Popular_FAQs.php";
387
- include "Shortcodes/Display_Recent_FAQs.php";
388
- include "Shortcodes/Display_Top_Rated_FAQs.php";
389
- include "Shortcodes/SelectFAQ.php";
390
- include "Shortcodes/SubmitFAQ.php";
391
-
392
- if ($EWD_UFAQ_Version != get_option('EWD_UFAQ_Version')) {
393
- Set_EWD_UFAQ_Options();
394
- EWD_UFAQ_Version_Update();
395
- }
396
-
397
- ?>
1
+ <?php
2
+ /*
3
+ Plugin Name: Ultimate FAQ
4
+ Plugin URI: http://www.EtoileWebDesign.com/wordpress-plugins/
5
+ Description: FAQ plugin that lets you easily create, order and publicize FAQs using shortcodes, with many unique styles, WooCommerce FAQs and AJAX FAQ search
6
+ Author: Etoile Web Design
7
+ Author URI: http://www.EtoileWebDesign.com/wordpress-plugins/
8
+ Terms and Conditions: http://www.etoilewebdesign.com/plugin-terms-and-conditions/
9
+ Text Domain: ultimate-faqs
10
+ Version: 1.8.12
11
+ */
12
+
13
+ global $ewd_ufaq_message;
14
+ global $UFAQ_Full_Version;
15
+ global $EWD_UFAQ_Version;
16
+
17
+ $EWD_UFAQ_Version = '1.8.0d';
18
+
19
+ define( 'EWD_UFAQ_CD_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
20
+ define( 'EWD_UFAQ_CD_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
21
+
22
+ //define('WP_DEBUG', true);
23
+
24
+ register_activation_hook(__FILE__,'Set_EWD_UFAQ_Options');
25
+ register_activation_hook(__FILE__,'Run_UFAQ_Tutorial');
26
+ register_activation_hook(__FILE__,'EWD_UFAQ_Show_Dashboard_Link');
27
+ add_filter('upgrader_post_install', 'Set_EWD_UFAQ_Options');
28
+
29
+ /* Hooks neccessary admin tasks */
30
+ if ( is_admin() ){
31
+ add_action('widgets_init', 'Update_EWD_UFAQ_Content');
32
+ add_action('admin_notices', 'EWD_UFAQ_Error_Notices');
33
+ add_action('admin_enqueue_scripts', 'Add_EWD_UFAQ_Scripts', 10, 1);
34
+ add_action('admin_head', 'EWD_UFAQ_Admin_Options');
35
+ }
36
+
37
+ function EWD_UFAQ_Enable_Sub_Menu() {
38
+ global $submenu;
39
+
40
+ $Admin_Approval = get_option("EWD_UFAQ_Admin_Approval");
41
+ $Access_Role = get_option("UPCP_Access_Role");
42
+
43
+ if ($Access_Role == "") {$Access_Role = "edit_posts";}
44
+
45
+ remove_menu_page('edit.php?post_type=ufaq');
46
+
47
+ add_menu_page( 'Ultimate FAQs', 'FAQs', $Access_Role, 'EWD-UFAQ-Options', 'EWD_UFAQ_Output_Pages', 'dashicons-format-chat', '49.1' );
48
+ add_submenu_page('EWD-UFAQ-Options', 'FAQ Options', 'FAQ Options', $Access_Role, 'EWD-UFAQ-Options&DisplayPage=Options', 'EWD_UFAQ_Output_Pages');
49
+ if ($Admin_Approval == "Yes") {
50
+ $submenu['EWD-UFAQ-Options'][6] = $submenu['EWD-UFAQ-Options'][1];
51
+ $submenu['EWD-UFAQ-Options'][1] = array( 'Approved FAQs', $Access_Role, "edit.php?post_type=ufaq&post_status=publish", "Approved FAQs" );
52
+ $submenu['EWD-UFAQ-Options'][2] = array( 'Awaiting Approval', $Access_Role, "edit.php?post_type=ufaq&post_status=draft", "Awaiting Approval" );
53
+ $submenu['EWD-UFAQ-Options'][3] = array( 'Add New', $Access_Role, "post-new.php?post_type=ufaq", "Add New" );
54
+ $submenu['EWD-UFAQ-Options'][4] = array( 'FAQ Categories', $Access_Role, "edit-tags.php?taxonomy=ufaq-category&post_type=ufaq", "FAQ Categories" );
55
+ $submenu['EWD-UFAQ-Options'][5] = array( 'FAQ Tags', $Access_Role, "edit-tags.php?taxonomy=ufaq-tag&post_type=ufaq", "FAQ Tags" );
56
+ }
57
+ else {
58
+ $submenu['EWD-UFAQ-Options'][5] = $submenu['EWD-UFAQ-Options'][1];
59
+ $submenu['EWD-UFAQ-Options'][1] = array( 'FAQs', $Access_Role, "edit.php?post_type=ufaq", "FAQs" );
60
+ $submenu['EWD-UFAQ-Options'][2] = array( 'Add New', $Access_Role, "post-new.php?post_type=ufaq", "Add New" );
61
+ $submenu['EWD-UFAQ-Options'][3] = array( 'FAQ Categories', $Access_Role, "edit-tags.php?taxonomy=ufaq-category&post_type=ufaq", "FAQ Categories" );
62
+ $submenu['EWD-UFAQ-Options'][4] = array( 'FAQ Tags', $Access_Role, "edit-tags.php?taxonomy=ufaq-tag&post_type=ufaq", "FAQ Tags" );
63
+ }
64
+ add_submenu_page('EWD-UFAQ-Options', 'FAQ Export', 'FAQ Export', $Access_Role, 'EWD-UFAQ-Options&DisplayPage=Export', 'EWD_UFAQ_Output_Pages');
65
+ add_submenu_page('EWD-UFAQ-Options', 'FAQ Import', 'FAQ Import', $Access_Role, 'EWD-UFAQ-Options&DisplayPage=ImportPosts', 'EWD_UFAQ_Output_Pages');
66
+
67
+ $submenu['EWD-UFAQ-Options'][0][0] = "Dashboard";
68
+ ksort($submenu['EWD-UFAQ-Options']);
69
+ }
70
+ add_action('admin_menu' , 'EWD_UFAQ_Enable_Sub_Menu', 1);
71
+
72
+ function EWD_UFAQ_Add_Header_Bar($Called = "No") {
73
+ global $pagenow, $post;
74
+
75
+ if ($Called != "Yes" and (!isset($_GET['post_type']) or $_GET['post_type'] != "ufaq") and (!is_object($post) or $post->post_type != 'ufaq')) {return;}
76
+
77
+ $Admin_Approval = get_option("EWD_UFAQ_Admin_Approval"); ?>
78
+
79
+ <div class="EWD_UFAQ_Menu">
80
+ <h2 class="nav-tab-wrapper">
81
+ <a id="ewd-ufaq-dash-mobile-menu-open" href="#" class="MenuTab nav-tab"><?php _e("MENU", 'ultimate-faqs'); ?><span id="ewd-ufaq-dash-mobile-menu-down-caret">&nbsp;&nbsp;&#9660;</span><span id="ewd-ufaq-dash-mobile-menu-up-caret">&nbsp;&nbsp;&#9650;</span></a>
82
+ <a id="Dashboard_Menu" href='admin.php?page=EWD-UFAQ-Options' class="MenuTab nav-tab <?php if (!isset($_GET['post_type']) and (isset($_GET['DisplayPage']) and ($_GET['DisplayPage'] == '' or $_GET['DisplayPage'] == 'Dashboard'))) {echo 'nav-tab-active';}?>"><?php _e("Dashboard", 'ultimate-faqs'); ?></a>
83
+ <?php if ($Admin_Approval == "Yes") { ?>
84
+ <a id="Approved_FAQs_Menu" href='edit.php?post_type=ufaq&post_status=publish' class="MenuTab nav-tab <?php if (isset($_GET['post_type']) and $_GET['post_type'] == 'ufaq' and $pagenow == 'edit.php' and (!isset($_GET['post_status']) or $_GET['post_status'] == 'publish')) {echo 'nav-tab-active';}?>"><?php _e("Approved FAQs", 'ultimate-faqs'); ?></a>
85
+ <a id="FAQs_Awaiting_Approval_Menu" href='edit.php?post_type=ufaq&post_status=draft' class="MenuTab nav-tab <?php if (isset($_GET['post_type']) and $_GET['post_type'] == 'ufaq' and $pagenow == 'edit.php' and $_GET['post_status'] == 'draft') {echo 'nav-tab-active';}?>"><?php _e("Awaiting Approval", 'ultimate-faqs'); ?></a>
86
+ <?php } else { ?>
87
+ <a id="FAQs_Menu" href='edit.php?post_type=ufaq' class="MenuTab nav-tab <?php if (isset($_GET['post_type']) and $_GET['post_type'] == 'ufaq' and $pagenow == 'edit.php') {echo 'nav-tab-active';}?>"><?php _e("FAQs", 'ultimate-faqs'); ?></a>
88
+ <?php } ?>
89
+ <a id="Add_New_Menu" href='post-new.php?post_type=ufaq' class="MenuTab nav-tab <?php if (isset($_GET['post_type']) and $_GET['post_type'] == 'ufaq' and $pagenow == 'post-new.php') {echo 'nav-tab-active';}?>"><?php _e("Add New", 'ultimate-faqs'); ?></a>
90
+ <a id="FAQ_Categories_Menu" href='edit-tags.php?taxonomy=ufaq-category&post_type=ufaq' class="MenuTab nav-tab <?php if (isset($_GET['post_type']) and $_GET['post_type'] == 'ufaq' and $pagenow == 'edit-tags.php' and $_GET['taxonomy'] == "ufaq-category") {echo 'nav-tab-active';}?>"><?php _e("Categories", 'ultimate-faqs'); ?></a>
91
+ <a id="FAQ_Categories_Menu" href='edit-tags.php?taxonomy=ufaq-tag&post_type=ufaq' class="MenuTab nav-tab <?php if (isset($_GET['post_type']) and $_GET['post_type'] == 'ufaq' and $pagenow == 'edit-tags.php' and $_GET['taxonomy'] == "ufaq-tag") {echo 'nav-tab-active';}?>"><?php _e("Tags", 'ultimate-faqs'); ?></a>
92
+ <a id="Options_Menu" href='admin.php?page=EWD-UFAQ-Options&DisplayPage=Options' class="MenuTab nav-tab <?php if (!isset($_GET['post_type']) and isset($_GET['DisplayPage']) and $_GET['DisplayPage'] == 'Options') {echo 'nav-tab-active';}?>"><?php _e("Options", 'ultimate-faqs'); ?></a>
93
+ <a id="WooCommerce_Import_Menu" href='admin.php?page=EWD-UFAQ-Options&DisplayPage=Export' class="MenuTab nav-tab <?php if (!isset($_GET['post_type']) and isset($_GET['DisplayPage']) and $_GET['DisplayPage'] == 'Export') {echo 'nav-tab-active';}?>"><?php _e("Export", 'ultimate-faqs'); ?></a>
94
+ <a id="WooCommerce_Import_Menu" href='admin.php?page=EWD-UFAQ-Options&DisplayPage=ImportPosts' class="MenuTab nav-tab <?php if (!isset($_GET['post_type']) and isset($_GET['DisplayPage']) and $_GET['DisplayPage'] == 'ImportPosts') {echo 'nav-tab-active';}?>"><?php _e("Import", 'ultimate-faqs'); ?></a>
95
+ </h2>
96
+ </div>
97
+ <?php }
98
+ add_action('admin_notices', 'EWD_UFAQ_Add_Header_Bar');
99
+
100
+ /* Add localization support */
101
+ function EWD_UFAQ_localization_setup() {
102
+ load_plugin_textdomain('ultimate-faqs', false, dirname(plugin_basename(__FILE__)) . '/lang/');
103
+ }
104
+ add_action('after_setup_theme', 'EWD_UFAQ_localization_setup');
105
+
106
+ // Add settings link on plugin page
107
+ function EWD_UFAQ_plugin_settings_link($links) {
108
+ $settings_link = '<a href="admin.php?page=EWD-UFAQ-Options">Settings</a>';
109
+ array_unshift($links, $settings_link);
110
+ return $links;
111
+ }
112
+ $plugin = plugin_basename(__FILE__);
113
+ add_filter("plugin_action_links_$plugin", 'EWD_UFAQ_plugin_settings_link' );
114
+
115
+ function Add_EWD_UFAQ_Scripts($hook) {
116
+ global $post, $EWD_UFAQ_Version;
117
+
118
+ wp_enqueue_script('ewd-ufaq-review-ask', plugins_url("js/ewd-ufaq-dashboard-review-ask.js", __FILE__), array('jquery'), $EWD_UFAQ_Version);
119
+
120
+ if ((isset($_GET['post_type']) && $_GET['post_type'] == 'ufaq') or
121
+ (isset($_GET['page']) && $_GET['page'] == 'EWD-UFAQ-Options')) {
122
+ $url_one = plugins_url("ultimate-faqs/js/sorttable.js");
123
+ $url_two = plugins_url("ultimate-faqs/js/Admin.js");
124
+ $url_three = plugins_url("ultimate-faqs/js/spectrum.js");
125
+
126
+ wp_enqueue_script('jquery-ui-sortable');
127
+ wp_enqueue_script('sortable', $url_one, array('jquery'));
128
+ wp_enqueue_script('UFAQ Admin', $url_two, array('jquery'), $EWD_UFAQ_Version);
129
+ wp_enqueue_script('spectrum', $url_three, array('jquery'));
130
+ }
131
+
132
+ if ($hook == 'edit.php' or $hook == 'post-new.php' or $hook == 'post.php') {
133
+ if (isset($post->post_type) and $post->post_type == 'product') {
134
+ wp_enqueue_script('ewd-ufaq-wc-admin', plugins_url("js/ewd-ufaq-wc-admin.js", __FILE__), array('jquery'), $EWD_UFAQ_Version);
135
+ }
136
+ }
137
+ }
138
+
139
+ function EWD_UFAQ_Admin_Options() {
140
+ global $EWD_UFAQ_Version;
141
+
142
+ wp_enqueue_style( 'ewd-ufaq-admin', plugins_url("ultimate-faqs/css/Admin.css"), array(), $EWD_UFAQ_Version);
143
+ wp_enqueue_style( 'ewd-ufaq-spectrum', plugins_url("ultimate-faqs/css/spectrum.css"));
144
+ }
145
+
146
+ add_action( 'wp_enqueue_scripts', 'Add_EWD_UFAQ_FrontEnd_Scripts' );
147
+ function Add_EWD_UFAQ_FrontEnd_Scripts() {
148
+ global $EWD_UFAQ_Version;
149
+
150
+ wp_register_script('ewd-ufaq-js', plugins_url( '/js/ewd-ufaq-js.js' , __FILE__ ), array( 'jquery' ), $EWD_UFAQ_Version);
151
+
152
+ $Highlight_Search_Term = get_option("EWD_UFAQ_Highlight_Search_Term");
153
+
154
+ $Retrieving_Results = get_option("EWD_UFAQ_Retrieving_Results");
155
+ if ($Retrieving_Results == "") {$Retrieving_Results = __("Retrieving Results", 'ultimate-faqs') . "...";}
156
+
157
+ $ewd_ufaq_php_data = array(
158
+ 'retrieving_results' => $Retrieving_Results,
159
+ 'highlight_search_term' => $Highlight_Search_Term
160
+ );
161
+
162
+ wp_localize_script('ewd-ufaq-js', 'ewd_ufaq_php_data', $ewd_ufaq_php_data );
163
+ }
164
+
165
+
166
+ add_action( 'wp_enqueue_scripts', 'EWD_UFAQ_Add_Stylesheet' );
167
+ function EWD_UFAQ_Add_Stylesheet() {
168
+ global $EWD_UFAQ_Version;
169
+
170
+ wp_register_style( 'ewd-ufaq-style', plugins_url('css/ewd-ufaq-styles.css', __FILE__) );
171
+ wp_enqueue_style( 'ewd-ufaq-style', $EWD_UFAQ_Version );
172
+
173
+ wp_register_style( 'ewd-ufaq-rrssb', plugins_url('css/rrssb-min.css', __FILE__) );
174
+ wp_enqueue_style( 'ewd-ufaq-rrssb' );
175
+ }
176
+
177
+ //add_action('activated_plugin','save_ufaq_error');
178
+ function save_ufaq_error(){
179
+ update_option('plugin_error', ob_get_contents());
180
+ file_put_contents("Error.txt", ob_get_contents());
181
+ }
182
+
183
+ function Set_EWD_UFAQ_Options() {
184
+ if (get_option("EWD_UFAQ_Toggle") == "") {update_option("EWD_UFAQ_Toggle", "Yes");}
185
+ if (get_option("EWD_UFAQ_Category_Toggle") == "") {update_option("EWD_UFAQ_Category_Toggle", "No");}
186
+ if (get_option("EWD_UFAQ_Category_Accordion") == "") {update_option("EWD_UFAQ_Category_Accordion", "No");}
187
+ if (get_option("EWD_UFAQ_Expand_Collapse_All") == "") {update_option("EWD_UFAQ_Expand_Collapse_All", "No");}
188
+ if (get_option("EWD_UFAQ_FAQ_Accordion") == "") {update_option("EWD_UFAQ_FAQ_Accordion", "No");}
189
+ if (get_option("EWD_UFAQ_Hide_Categories") == "") {update_option("EWD_UFAQ_Hide_Categories", "No");}
190
+ if (get_option("EWD_UFAQ_Hide_Tags") == "") {update_option("EWD_UFAQ_Hide_Tags", "No");}
191
+ if (get_option("EWD_UFAQ_Scroll_To_Top") == "") {update_option("EWD_UFAQ_Scroll_To_Top", "Yes");}
192
+ if (get_option("EWD_UFAQ_Display_All_Answers") == "") {update_option("EWD_UFAQ_Display_All_Answers", "No");}
193
+ if (get_option("EWD_UFAQ_Display_Author") == "") {update_option("EWD_UFAQ_Display_Author", "Yes");}
194
+ if (get_option("EWD_UFAQ_Display_Date") == "") {update_option("EWD_UFAQ_Display_Date", "Yes");}
195
+ if (get_option("EWD_UFAQ_Display_Back_To_Top") == "") {update_option("EWD_UFAQ_Display_Back_To_Top", "No");}
196
+ if (get_option("EWD_UFAQ_Include_Permalink") == "") {update_option("EWD_UFAQ_Include_Permalink", "Yes");}
197
+ if (get_option("EWD_UFAQ_Permalink_Type") == "") {update_option("EWD_UFAQ_Permalink_Type", "SamePage");}
198
+ if (get_option("EWD_UFAQ_Show_TinyMCE") == "") {update_option("EWD_UFAQ_Show_TinyMCE", "Yes");}
199
+ if (get_option("EWD_UFAQ_Comments_On") == "") {update_option("EWD_UFAQ_Comments_On", "Yes");}
200
+ if (get_option("EWD_UFAQ_Access_Role") == "") {update_option("EWD_UFAQ_Access_Role", "edit_posts");}
201
+
202
+ if (get_option("EWD_UFAQ_Display_Style") == "") {update_option("EWD_UFAQ_Display_Style", "Default");}
203
+ if (get_option("EWD_UFAQ_FAQ_Number_Of_Columns") == "") {update_option("EWD_UFAQ_Display_Style", "One");}
204
+ if (get_option("EWD_UFAQ_Color_Block_Shape") == "") {update_option("EWD_UFAQ_Color_Block_Shape", "Square");}
205
+ if (get_option("EWD_UFAQ_Page_Type") == "") {update_option("EWD_UFAQ_Page_Type", "Load_More");}
206
+ if (get_option("EWD_UFAQ_FAQ_Ratings") == "") {update_option("EWD_UFAQ_FAQ_Ratings", "No");}
207
+ if (get_option("EWD_UFAQ_WooCommerce_FAQs") == "") {update_option("EWD_UFAQ_WooCommerce_FAQs", "No");}
208
+ if (get_option("EWD_UFAQ_Use_Product") == "") {update_option("EWD_UFAQ_Use_Product", "Yes");}
209
+ if (get_option("EWD_UFAQ_Reveal_Effect") == "") {update_option("EWD_UFAQ_Reveal_Effect", "none");}
210
+ if (get_option("EWD_UFAQ_Pretty_Permalinks") == "") {update_option("EWD_UFAQ_Pretty_Permalinks", "No");}
211
+ if (get_option("EWD_UFAQ_Allow_Proposed_Answer") == "") {update_option("EWD_UFAQ_Allow_Proposed_Answer", "No");}
212
+ if (get_option("EWD_UFAQ_Submit_Custom_Fields") == "") {update_option("EWD_UFAQ_Submit_Custom_Fields", "No");}
213
+ if (get_option("EWD_UFAQ_Submit_Question_Captcha") == "") {update_option("EWD_UFAQ_Submit_Question_Captcha", "No");}
214
+ if (get_option("EWD_UFAQ_Admin_Question_Notification") == "") {update_option("EWD_UFAQ_Admin_Question_Notification", "No");}
215
+ if (get_option("EWD_UFAQ_Submit_FAQ_Email") == "") {update_option("EWD_UFAQ_Submit_FAQ_Email", 0);}
216
+ if (get_option("EWD_UFAQ_Auto_Complete_Titles") == "") {update_option("EWD_UFAQ_Auto_Complete_Titles", "Yes");}
217
+ if (get_option("EWD_UFAQ_Highlight_Search_Term") == "") {update_option("EWD_UFAQ_Highlight_Search_Term", "No");}
218
+ if (get_option("EWD_UFAQ_Slug_Base") == "") {update_option("EWD_UFAQ_Slug_Base", "ufaqs");}
219
+
220
+ if (get_option("EWD_UFAQ_FAQ_Elements") == "") {
221
+ $FAQ_Elements = array();
222
+ $FAQ_Elements[0] = "Author_Date";
223
+ $FAQ_Elements[1] = "Body";
224
+ $FAQ_Elements[2] = "Custom_Fields";
225
+ $FAQ_Elements[3] = "Categories";
226
+ $FAQ_Elements[4] = "Tags";
227
+ $FAQ_Elements[5] = "Ratings";
228
+ $FAQ_Elements[6] = "Social_Media";
229
+ $FAQ_Elements[7] = "Permalink";
230
+ $FAQ_Elements[8] = "Comments";
231
+ $FAQ_Elements[9] = "Back_To_Top";
232
+
233
+ update_option("EWD_UFAQ_FAQ_Elements", $FAQ_Elements);
234
+ }
235
+
236
+ if (get_option("EWD_UFAQ_Group_By_Category") == "") {update_option("EWD_UFAQ_Group_By_Category", "No");}
237
+ if (get_option("EWD_UFAQ_Group_By_Category_Count") == "") {update_option("EWD_UFAQ_Group_By_Category_Count", "No");}
238
+ if (get_option("EWD_UFAQ_Group_By_Order_By") == "") {update_option("EWD_UFAQ_Group_By_Order_By", "name");}
239
+ if (get_option("EWD_UFAQ_Group_By_Order") == "") {update_option("EWD_UFAQ_Group_By_Order", "ASC");}
240
+ if (get_option("EWD_UFAQ_Order_By") == "") {update_option("EWD_UFAQ_Order_By", "date");}
241
+ if (get_option("EWD_UFAQ_Order") == "") {update_option("EWD_UFAQ_Order", "DESC");}
242
+
243
+ if (get_option("EWD_UFAQ_Hide_Blank_Fields") == "") {update_option("EWD_UFAQ_Hide_Blank_Fields", "Yes");}
244
+
245
+ if (get_option("EWD_UFAQ_Styling_Category_Heading_Type") == "") {update_option("EWD_UFAQ_Styling_Category_Heading_Type", "h4");}
246
+ if (get_option("EWD_UFAQ_Styling_FAQ_Heading_Type") == "") {update_option("EWD_UFAQ_Styling_FAQ_Heading_Type", "h4");}
247
+ if (get_option("EWD_UFAQ_Toggle_Symbol") == "") {update_option("EWD_UFAQ_Toggle_Symbol", "A");}
248
+
249
+ if (get_option("EWD_UFAQ_Full_Version") == "") {update_option("EWD_UFAQ_Full_Version", "No");}
250
+ if (get_option("EWD_UFAQ_Install_Flag") == "") {update_option("EWD_UFAQ_Update_Flag", "Yes");}
251
+ if (get_option("EWD_UFAQ_Install_Flag") == "") {update_option("EWD_UFAQ_Install_Flag", "Yes");}
252
+
253
+ if (get_option("EWD_UFAQ_Install_Version") == "") {update_option("EWD_UFAQ_Install_Version", 1.6);}
254
+ if (get_option("EWD_UFAQ_Install_Time") == "") {update_option("EWD_UFAQ_Install_Time", time());}
255
+ }
256
+
257
+ $UFAQ_Full_Version = get_option("EWD_UFAQ_Full_Version");
258
+ if (isset($_GET['post_type']) and $_GET['post_type'] == 'ufaq' and isset($_POST['EWD_UFAQ_Upgrade_To_Full']) and $UFAQ_Full_Version == "Yes") {add_action("admin_notices", "EWD_UFAQ_Upgrade_Notice");}
259
+
260
+ $PrettyLinks = get_option("EWD_UFAQ_Pretty_Permalinks");
261
+ if ($PrettyLinks == "Yes") {
262
+ add_filter( 'query_vars', 'EWD_UFAQ_add_query_vars_filter' );
263
+ add_filter('init', 'EWD_UFAQ_Rewrite_Rules');
264
+ update_option("EWD_UFAQ_Update_RR_Rules", "No");
265
+ }
266
+
267
+ if (isset($_POST['EWD_UFAQ_Upgrade_To_Full'])) {
268
+ add_action('admin_init', 'EWD_UFAQ_Upgrade_To_Full');
269
+ }
270
+
271
+ $Show_TinyMCE = get_option("EWD_UFAQ_Show_TinyMCE");
272
+ if ($Show_TinyMCE == "Yes") {
273
+ add_filter( 'mce_buttons', 'EWD_UFAQ_Register_TinyMCE_Buttons' );
274
+ add_filter( 'mce_external_plugins', 'EWD_UFAQ_Register_TinyMCE_Javascript' );
275
+ add_action('admin_head', 'EWD_UFAQ_Output_TinyMCE_Vars');
276
+ }
277
+
278
+ function EWD_UFAQ_Register_TinyMCE_Buttons( $buttons ) {
279
+ array_push( $buttons, 'separator', 'UFAQ_Shortcodes' );
280
+ return $buttons;
281
+ }
282
+
283
+ function EWD_UFAQ_Register_TinyMCE_Javascript( $plugin_array ) {
284
+ $plugin_array['UFAQ_Shortcodes'] = plugins_url( '/js/tinymce-plugin.js',__FILE__ );
285
+
286
+ return $plugin_array;
287
+ }
288
+
289
+ function EWD_UFAQ_Output_TinyMCE_Vars() {
290
+ global $UFAQ_Full_Version;
291
+ $UFAQ_Categories = get_terms('ufaq-category');
292
+
293
+ echo "<script type='text/javascript'>";
294
+ echo "var ufaq_premium = '" . $UFAQ_Full_Version . "';\n";
295
+ echo "var ufaq_categories = " . json_encode($UFAQ_Categories) . ";\n";
296
+ echo "</script>";
297
+ }
298
+
299
+ function Run_UFAQ_Tutorial() {
300
+ update_option("UFAQ_Run_Tutorial", "Yes");
301
+ }
302
+
303
+ if (get_option("UFAQ_Run_Tutorial") == "Yes" and isset($_GET['page']) and $_GET['page'] == 'EWD-UFAQ-Options') {
304
+ add_action( 'admin_enqueue_scripts', 'UFAQ_Set_Pointers', 10, 1);
305
+ }
306
+
307
+ function UFAQ_Set_Pointers($page) {
308
+ $Pointers = UFAQ_Return_Pointers();
309
+
310
+ //Arguments: pointers php file, version (dots will be replaced), prefix
311
+ $manager = new UFAQPointersManager( $Pointers, '1.0', 'ufaq_admin_pointers' );
312
+ $manager->parse();
313
+ $pointers = $manager->filter( $page );
314
+ if ( empty( $pointers ) ) { // nothing to do if no pointers pass the filter
315
+ return;
316
+ }
317
+ wp_enqueue_style( 'wp-pointer' );
318
+ $js_url = plugins_url( 'js/ewd-ufaq-pointers.js', __FILE__ );
319
+ wp_enqueue_script( 'ufaq_admin_pointers', $js_url, array('wp-pointer'), NULL, TRUE );
320
+ //data to pass to javascript
321
+ $data = array(
322
+ 'next_label' => __( 'Next' ),
323
+ 'close_label' => __('Close'),
324
+ 'pointers' => $pointers
325
+ );
326
+ wp_localize_script( 'ufaq_admin_pointers', 'MyAdminPointers', $data );
327
+ //update_option("UFAQ_Run_Tutorial", "No");
328
+ }
329
+
330
+ function EWD_UFAQ_Show_Dashboard_Link() {
331
+ set_transient('ewd-ufaq-admin-install-notice', true, 5);
332
+ }
333
+
334
+ function UFAQ_Leave_Reply_Text($translation, $text, $domain) {
335
+ global $post;
336
+ if ($text == 'Leave a Reply' and (is_object($post) and $post->post_type == 'ufaq')) {
337
+ $translations = &get_translations_for_domain( $domain);
338
+ return $translations->translate( 'Comment on this FAQ' );
339
+ }
340
+ return $translation;
341
+ }
342
+ add_filter('gettext', 'UFAQ_Leave_Reply_Text', 10, 4);
343
+
344
+
345
+ function UFAQ_Post_Edit_Styles( $hook_suffix ){
346
+ $cpt = 'ufaq';
347
+ if( in_array( $hook_suffix, array('post.php', 'post-new.php') ) ){
348
+ $screen = get_current_screen();
349
+ if( is_object( $screen ) && $cpt == $screen->post_type ){
350
+ wp_enqueue_style( 'ewd-ufaq-post-edit-styles', plugins_url("ultimate-faqs/css/ewd-ufaq-post-edit-styles.css"), $EWD_UFAQ_Version );
351
+ }
352
+ }
353
+ }
354
+ add_action('admin_enqueue_scripts', 'UFAQ_Post_Edit_Styles');
355
+
356
+ include "blocks/ewd-ufaq-blocks.php";
357
+ include "Functions/Error_Notices.php";
358
+ include "Functions/EWD_UFAQ_Add_Social_Media_Buttons.php";
359
+ include "Functions/EWD_UFAQ_Add_Views_Column.php";
360
+ include "Functions/EWD_UFAQ_Captcha.php";
361
+ include "Functions/EWD_UFAQ_Deactivation_Survey.php";
362
+ include "Functions/EWD_UFAQ_Export.php";
363
+ include "Functions/EWD_UFAQ_Help_Pointers.php";
364
+ include "Functions/EWD_UFAQ_Import.php";
365
+ include "Functions/EWD_UFAQ_Meta_Boxes.php";
366
+ include "Functions/EWD_UFAQ_Styling.php";
367
+ include "Functions/EWD_UFAQ_Output_Pages.php";
368
+ include "Functions/EWD_UFAQ_Pointers_Manager_Interface.php";
369
+ include "Functions/EWD_UFAQ_Pointers_Manager_Class.php";
370
+ include "Functions/EWD_UFAQ_Rewrite_Rules.php";
371
+ include "Functions/EWD_UFAQ_Submit_Question.php";
372
+ include "Functions/EWD_UFAQ_Upgrade_Box.php";
373
+ include "Functions/EWD_UFAQ_Version_Reversion.php";
374
+ include "Functions/EWD_UFAQ_Version_Update.php";
375
+ include "Functions/EWD_UFAQ_Widgets.php";
376
+ include "Functions/EWD_UFAQ_WooCommerce_Tab.php";
377
+ include "Functions/FrontEndAjaxUrl.php";
378
+ include "Functions/Full_Upgrade.php";
379
+ include "Functions/Process_Ajax.php";
380
+ include "Functions/Register_EWD_UFAQ_Posts_Taxonomies.php";
381
+ include "Functions/Update_Admin_Databases.php";
382
+ include "Functions/Update_EWD_UFAQ_Content.php";
383
+
384
+ include "Shortcodes/DisplayFAQs.php";
385
+ include "Shortcodes/Display_FAQ_Search.php";
386
+ include "Shortcodes/Display_Popular_FAQs.php";
387
+ include "Shortcodes/Display_Recent_FAQs.php";
388
+ include "Shortcodes/Display_Top_Rated_FAQs.php";
389
+ include "Shortcodes/SelectFAQ.php";
390
+ include "Shortcodes/SubmitFAQ.php";
391
+
392
+ if ($EWD_UFAQ_Version != get_option('EWD_UFAQ_Version')) {
393
+ Set_EWD_UFAQ_Options();
394
+ EWD_UFAQ_Version_Update();
395
+ }
396
+
397
+ ?>
blocks/ewd-ufaq-blocks.php CHANGED
@@ -1,10 +1,10 @@
1
- <?php
2
- add_filter( 'block_categories', 'ewd_ufaq_add_block_category' );
3
- function ewd_ufaq_add_block_category( $categories ) {
4
- $categories[] = array(
5
- 'slug' => 'ewd-ufaq-blocks',
6
- 'title' => __( 'Ultimate FAQs', 'ultimate-faqs' ),
7
- );
8
- return $categories;
9
- }
10
-
1
+ <?php
2
+ add_filter( 'block_categories', 'ewd_ufaq_add_block_category' );
3
+ function ewd_ufaq_add_block_category( $categories ) {
4
+ $categories[] = array(
5
+ 'slug' => 'ewd-ufaq-blocks',
6
+ 'title' => __( 'Ultimate FAQs', 'ultimate-faqs' ),
7
+ );
8
+ return $categories;
9
+ }
10
+
css/Admin.css CHANGED
@@ -1979,6 +1979,31 @@ body.post-type-ufaq .EWD_UFAQ_Menu {
1979
 
1980
 
1981
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1982
 
1983
 
1984
  /************************
@@ -2681,6 +2706,10 @@ input.ewd-ufaq-admin-font-size {
2681
  font-weight: 600;
2682
  font-size: 20px;
2683
  }
 
 
 
 
2684
  .ewd-ufaq-review-ask-action {
2685
  width: 90px;
2686
  padding: 6px;
1979
 
1980
 
1981
 
1982
+ /***********************************************************************************
1983
+ * POINTERS
1984
+ ***********************************************************************************/
1985
+
1986
+ .wp-pointer-content ul {
1987
+ list-style: disc;
1988
+ padding-left: 40px;
1989
+ }
1990
+
1991
+ .wp-pointer-content iframe {
1992
+ margin-top:18px;
1993
+ }
1994
+
1995
+ .ewd-feup-pointer-count {
1996
+ margin-top: 40px;
1997
+ margin-bottom: -40px;
1998
+ }
1999
+
2000
+ .ufaq-skip-all-tutorial-pop-ups {
2001
+ cursor: pointer;
2002
+ color: #0073aa;
2003
+ }
2004
+
2005
+ /* Color Pickers */
2006
+ .ewd-feup-spectrum {margin-bottom: 6px;}
2007
 
2008
 
2009
  /************************
2706
  font-weight: 600;
2707
  font-size: 20px;
2708
  }
2709
+ .ewd-ufaq-review-ask-review-text span {
2710
+ font-size: .8em;
2711
+ font-weight: normal;
2712
+ }
2713
  .ewd-ufaq-review-ask-action {
2714
  width: 90px;
2715
  padding: 6px;
html/AdminHeader.php CHANGED
@@ -1,5 +1,5 @@
1
  <div class="wrap">
2
- <div class="Header"><h2><?php _e("Ultimate FAQ Settings", 'ultimate-faqs') ?></h2></div>
3
 
4
 
5
  <?php if ($UFAQ_Full_Version != "Yes" or get_option("EWD_UFAQ_Trial_Happening") == "Yes") { ?>
1
  <div class="wrap">
2
+ <div class="Header"><h2><?php _e("Ultimate FAQ Options", 'ultimate-faqs') ?></h2></div>
3
 
4
 
5
  <?php if ($UFAQ_Full_Version != "Yes" or get_option("EWD_UFAQ_Trial_Happening") == "Yes") { ?>
html/ExportPage.php CHANGED
@@ -8,7 +8,7 @@
8
  <div id="icon-options-general" class="icon32"><br /></div><h2>Export</h2>
9
 
10
  <?php if ($UFAQ_Full_Version != "Yes") { ?>
11
- <div class='ewd-ufaq-upgrade notice'>Upgrade to the premium version to use these features</div>
12
  <?php } ?>
13
 
14
  <form method="post" action="admin.php?page=EWD-UFAQ-Options&DisplayPage=Export&Action=EWD_UFAQ_ExportToPDF">
8
  <div id="icon-options-general" class="icon32"><br /></div><h2>Export</h2>
9
 
10
  <?php if ($UFAQ_Full_Version != "Yes") { ?>
11
+ <div class='ewd-ufaq-upgrade'>Upgrade to the premium version to use these features</div>
12
  <?php } ?>
13
 
14
  <form method="post" action="admin.php?page=EWD-UFAQ-Options&DisplayPage=Export&Action=EWD_UFAQ_ExportToPDF">
html/OptionsPage.php CHANGED
@@ -980,49 +980,50 @@
980
  <div id="posttype-page" class="posttypediv">-->
981
  <div id="tabs-panel-posttype-page-most-recent" class="tabs-panel tabs-panel-active">
982
 
983
- <table class="wp-list-table widefat tags sorttable ewd-ufaq-list">
984
- <thead>
985
- <tr>
986
- <th><?php _e("Question", 'ultimate-faqs') ?></th>
987
- <th><?php _e("Views", 'ultimate-faqs') ?></th>
988
- <th><?php _e("Categories", 'ultimate-faqs') ?></th>
989
- <th><?php _e("Tags", 'ultimate-faqs') ?></th>
990
- </tr>
991
- </thead>
992
- <tbody>
993
- <?php
994
- $params = array(
995
- 'post_type' => 'ufaq',
996
- 'posts_per_page' => -1,
997
- 'meta_key' => 'ufaq_order',
998
- 'orderby' => 'meta_value_num',
999
- 'order' => 'ASC'
1000
- );
1001
- $FAQs = get_posts($params);
1002
- if (empty($FAQs)) { echo "<div class='ewd-ufaq-row list-item'><p>No FAQs have been created<p/></div>"; }
1003
- else {
1004
- foreach ($FAQs as $FAQ) {
1005
- $FAQ_Views = get_post_meta($FAQ->ID, 'ufaq_view_count', true);
1006
- $FAQ_Categories = get_the_term_list($FAQ->ID, 'ufaq-category', '', ', ', '');
1007
- $FAQ_Tags = get_the_term_list($FAQ->ID, 'ufaq-tag', '', ', ', '');
1008
- echo "<tr id='ewd-ufaq-item-" . $FAQ->ID . "' class='ewd-ufaq-item'>";
1009
- echo "<td class='ufaq-title'>" . $FAQ->post_title . "</td>";
1010
- echo "<td class='ufaq-title'>" . $FAQ_Views . "</td>";
1011
- echo "<td class='ufaq-title'>" . $FAQ_Categories . "</td>";
1012
- echo "<td class='ufaq-title'>" . $FAQ_Tags . "</td>";
1013
- echo "</tr>";
1014
- }
1015
- }?>
1016
- </tbody>
1017
- <tfoot>
1018
- <tr>
1019
- <th><?php _e("Question", 'ultimate-faqs') ?></th>
1020
- <th><?php _e("Views", 'ultimate-faqs') ?></th>
1021
- <th><?php _e("Categories", 'ultimate-faqs') ?></th>
1022
- <th><?php _e("Tags", 'ultimate-faqs') ?></th>
1023
- </tr>
1024
- </tfoot>
1025
- </table>
 
1026
  </div>
1027
 
1028
  </div> <!-- ewd-ufaq-admin-styling-subsection -->
980
  <div id="posttype-page" class="posttypediv">-->
981
  <div id="tabs-panel-posttype-page-most-recent" class="tabs-panel tabs-panel-active">
982
 
983
+ <table class="wp-list-table widefat tags sorttable ewd-ufaq-list">
984
+ <thead>
985
+ <tr>
986
+ <th><?php _e("Question", 'ultimate-faqs') ?></th>
987
+ <th><?php _e("Views", 'ultimate-faqs') ?></th>
988
+ <th><?php _e("Categories", 'ultimate-faqs') ?></th>
989
+ <th><?php _e("Tags", 'ultimate-faqs') ?></th>
990
+ </tr>
991
+ </thead>
992
+ <tbody>
993
+ <?php
994
+ $params = array(
995
+ 'post_type' => 'ufaq',
996
+ 'posts_per_page' => -1,
997
+ 'meta_key' => 'ufaq_order',
998
+ 'orderby' => 'meta_value_num',
999
+ 'order' => 'ASC'
1000
+ );
1001
+ $FAQs = get_posts($params);
1002
+ if (empty($FAQs)) { echo "<div class='ewd-ufaq-row list-item'><p>No FAQs have been created<p/></div>"; }
1003
+ else {
1004
+ foreach ($FAQs as $FAQ) {
1005
+ $FAQ_Views = get_post_meta($FAQ->ID, 'ufaq_view_count', true);
1006
+ $FAQ_Categories = get_the_term_list($FAQ->ID, 'ufaq-category', '', ', ', '');
1007
+ $FAQ_Tags = get_the_term_list($FAQ->ID, 'ufaq-tag', '', ', ', '');
1008
+ echo "<tr id='ewd-ufaq-item-" . $FAQ->ID . "' class='ewd-ufaq-item'>";
1009
+ echo "<td class='ufaq-title'>" . $FAQ->post_title . "</td>";
1010
+ echo "<td class='ufaq-title'>" . $FAQ_Views . "</td>";
1011
+ echo "<td class='ufaq-title'>" . $FAQ_Categories . "</td>";
1012
+ echo "<td class='ufaq-title'>" . $FAQ_Tags . "</td>";
1013
+ echo "</tr>";
1014
+ }
1015
+ }?>
1016
+ </tbody>
1017
+ <tfoot>
1018
+ <tr>
1019
+ <th><?php _e("Question", 'ultimate-faqs') ?></th>
1020
+ <th><?php _e("Views", 'ultimate-faqs') ?></th>
1021
+ <th><?php _e("Categories", 'ultimate-faqs') ?></th>
1022
+ <th><?php _e("Tags", 'ultimate-faqs') ?></th>
1023
+ </tr>
1024
+ </tfoot>
1025
+ </table>
1026
+ </div>
1027
  </div>
1028
 
1029
  </div> <!-- ewd-ufaq-admin-styling-subsection -->
js/ewd-ufaq-dashboard-review-ask.js CHANGED
@@ -1,63 +1,64 @@
1
- jQuery(document).ready(function($) {
2
- jQuery('.ewd-ufaq-main-dashboard-review-ask').css('display', 'block');
3
-
4
- jQuery('.ewd-ufaq-main-dashboard-review-ask').on('click', function(event) {
5
- if (jQuery(event.srcElement).hasClass('notice-dismiss')) {
6
- var data = 'Ask_Review_Date=3&action=ewd_ufaq_hide_review_ask';
7
- jQuery.post(ajaxurl, data, function() {});
8
- }
9
- });
10
-
11
- jQuery('.ewd-ufaq-review-ask-yes').on('click', function() {
12
- jQuery('.ewd-ufaq-review-ask-feedback-text').removeClass('ufaq-hidden');
13
- jQuery('.ewd-ufaq-review-ask-starting-text').addClass('ufaq-hidden');
14
-
15
- jQuery('.ewd-ufaq-review-ask-no-thanks').removeClass('ufaq-hidden');
16
- jQuery('.ewd-ufaq-review-ask-review').removeClass('ufaq-hidden');
17
-
18
- jQuery('.ewd-ufaq-review-ask-not-really').addClass('ufaq-hidden');
19
- jQuery('.ewd-ufaq-review-ask-yes').addClass('ufaq-hidden');
20
-
21
- var data = 'Ask_Review_Date=7&action=ewd_ufaq_hide_review_ask';
22
- jQuery.post(ajaxurl, data, function() {});
23
- });
24
-
25
- jQuery('.ewd-ufaq-review-ask-not-really').on('click', function() {
26
- jQuery('.ewd-ufaq-review-ask-review-text').removeClass('ufaq-hidden');
27
- jQuery('.ewd-ufaq-review-ask-starting-text').addClass('ufaq-hidden');
28
-
29
- jQuery('.ewd-ufaq-review-ask-feedback-form').removeClass('ufaq-hidden');
30
- jQuery('.ewd-ufaq-review-ask-actions').addClass('ufaq-hidden');
31
-
32
- var data = 'Ask_Review_Date=7&action=ewd_ufaq_hide_review_ask';
33
- jQuery.post(ajaxurl, data, function() {});
34
- });
35
-
36
- jQuery('.ewd-ufaq-review-ask-no-thanks').on('click', function() {
37
- var data = 'Ask_Review_Date=1000&action=ewd_ufaq_hide_review_ask';
38
- jQuery.post(ajaxurl, data, function() {});
39
-
40
- jQuery('.ewd-ufaq-main-dashboard-review-ask').css('display', 'none');
41
- });
42
-
43
- jQuery('.ewd-ufaq-review-ask-review').on('click', function() {
44
- jQuery('.ewd-ufaq-review-ask-feedback-text').addClass('ufaq-hidden');
45
- jQuery('.ewd-ufaq-review-ask-thank-you-text').removeClass('ufaq-hidden');
46
-
47
- var data = 'Ask_Review_Date=1000&action=ewd_ufaq_hide_review_ask';
48
- jQuery.post(ajaxurl, data, function() {});
49
- });
50
-
51
- jQuery('.ewd-ufaq-review-ask-send-feedback').on('click', function() {
52
- var Feedback = jQuery('.ewd-ufaq-review-ask-feedback-explanation textarea').val();
53
- var data = 'Feedback=' + Feedback + '&action=ewd_ufaq_send_feedback';
54
- jQuery.post(ajaxurl, data, function() {});
55
-
56
- var data = 'Ask_Review_Date=1000&action=ewd_ufaq_hide_review_ask';
57
- jQuery.post(ajaxurl, data, function() {});
58
-
59
- jQuery('.ewd-ufaq-review-ask-feedback-form').addClass('ufaq-hidden');
60
- jQuery('.ewd-ufaq-review-ask-review-text').addClass('ufaq-hidden');
61
- jQuery('.ewd-ufaq-review-ask-thank-you-text').removeClass('ufaq-hidden');
62
- });
 
63
  });
1
+ jQuery(document).ready(function($) {
2
+ jQuery('.ewd-ufaq-main-dashboard-review-ask').css('display', 'block');
3
+
4
+ jQuery('.ewd-ufaq-main-dashboard-review-ask').on('click', function(event) {
5
+ if (jQuery(event.srcElement).hasClass('notice-dismiss')) {
6
+ var data = 'Ask_Review_Date=3&action=ewd_ufaq_hide_review_ask';
7
+ jQuery.post(ajaxurl, data, function() {});
8
+ }
9
+ });
10
+
11
+ jQuery('.ewd-ufaq-review-ask-yes').on('click', function() {
12
+ jQuery('.ewd-ufaq-review-ask-feedback-text').removeClass('ufaq-hidden');
13
+ jQuery('.ewd-ufaq-review-ask-starting-text').addClass('ufaq-hidden');
14
+
15
+ jQuery('.ewd-ufaq-review-ask-no-thanks').removeClass('ufaq-hidden');
16
+ jQuery('.ewd-ufaq-review-ask-review').removeClass('ufaq-hidden');
17
+
18
+ jQuery('.ewd-ufaq-review-ask-not-really').addClass('ufaq-hidden');
19
+ jQuery('.ewd-ufaq-review-ask-yes').addClass('ufaq-hidden');
20
+
21
+ var data = 'Ask_Review_Date=7&action=ewd_ufaq_hide_review_ask';
22
+ jQuery.post(ajaxurl, data, function() {});
23
+ });
24
+
25
+ jQuery('.ewd-ufaq-review-ask-not-really').on('click', function() {
26
+ jQuery('.ewd-ufaq-review-ask-review-text').removeClass('ufaq-hidden');
27
+ jQuery('.ewd-ufaq-review-ask-starting-text').addClass('ufaq-hidden');
28
+
29
+ jQuery('.ewd-ufaq-review-ask-feedback-form').removeClass('ufaq-hidden');
30
+ jQuery('.ewd-ufaq-review-ask-actions').addClass('ufaq-hidden');
31
+
32
+ var data = 'Ask_Review_Date=1000&action=ewd_ufaq_hide_review_ask';
33
+ jQuery.post(ajaxurl, data, function() {});
34
+ });
35
+
36
+ jQuery('.ewd-ufaq-review-ask-no-thanks').on('click', function() {
37
+ var data = 'Ask_Review_Date=1000&action=ewd_ufaq_hide_review_ask';
38
+ jQuery.post(ajaxurl, data, function() {});
39
+
40
+ jQuery('.ewd-ufaq-main-dashboard-review-ask').css('display', 'none');
41
+ });
42
+
43
+ jQuery('.ewd-ufaq-review-ask-review').on('click', function() {
44
+ jQuery('.ewd-ufaq-review-ask-feedback-text').addClass('ufaq-hidden');
45
+ jQuery('.ewd-ufaq-review-ask-thank-you-text').removeClass('ufaq-hidden');
46
+
47
+ var data = 'Ask_Review_Date=1000&action=ewd_ufaq_hide_review_ask';
48
+ jQuery.post(ajaxurl, data, function() {});
49
+ });
50
+
51
+ jQuery('.ewd-ufaq-review-ask-send-feedback').on('click', function() {
52
+ var Feedback = jQuery('.ewd-ufaq-review-ask-feedback-explanation textarea').val();
53
+ var EmailAddress = jQuery('.ewd-ufaq-review-ask-feedback-explanation input[name="feedback_email_address"]').val();
54
+ var data = 'Feedback=' + Feedback + '&EmailAddress=' + EmailAddress + '&action=ewd_ufaq_send_feedback';
55
+ jQuery.post(ajaxurl, data, function() {});
56
+
57
+ var data = 'Ask_Review_Date=1000&action=ewd_ufaq_hide_review_ask';
58
+ jQuery.post(ajaxurl, data, function() {});
59
+
60
+ jQuery('.ewd-ufaq-review-ask-feedback-form').addClass('ufaq-hidden');
61
+ jQuery('.ewd-ufaq-review-ask-review-text').addClass('ufaq-hidden');
62
+ jQuery('.ewd-ufaq-review-ask-thank-you-text').removeClass('ufaq-hidden');
63
+ });
64
  });
js/ewd-ufaq-plugin-deactivation.js CHANGED
@@ -1,52 +1,53 @@
1
- jQuery(function($){
2
- var $deactivateLink = $('#the-list').find('[data-slug="ultimate-faqs"] span.deactivate a'),
3
- $overlay = $('#ewd-ufaq-deactivate-survey-ultimate-faqs'),
4
- $form = $overlay.find('form'),
5
- formOpen = false;
6
- // Plugin listing table deactivate link.
7
- $deactivateLink.on('click', function(event) {
8
- event.preventDefault();
9
- $overlay.css('display', 'table');
10
- formOpen = true;
11
- $form.find('.ewd-ufaq-deactivate-survey-option:first-of-type input[type=radio]').focus();
12
- });
13
- // Survey radio option selected.
14
- $form.on('change', 'input[type=radio]', function(event) {
15
- event.preventDefault();
16
- $form.find('input[type=text], .error').hide();
17
- $form.find('.ewd-ufaq-deactivate-survey-option').removeClass('selected');
18
- $(this).closest('.ewd-ufaq-deactivate-survey-option').addClass('selected').find('input[type=text]').show();
19
- });
20
- // Survey Skip & Deactivate.
21
- $form.on('click', '.ewd-ufaq-deactivate-survey-deactivate', function(event) {
22
- event.preventDefault();
23
- location.href = $deactivateLink.attr('href');
24
- });
25
- // Survey submit.
26
- $form.submit(function(event) {
27
- event.preventDefault();
28
- if (! $form.find('input[type=radio]:checked').val()) {
29
- $form.find('.ewd-ufaq-deactivate-survey-footer').prepend('<span class="error">Please select an option below</span>');
30
- return;
31
- }
32
- var data = {
33
- code: $form.find('.selected input[type=radio]').val(),
34
- reason: $form.find('.selected .ewd-ufaq-deactivate-survey-option-reason').text(),
35
- details: $form.find('.selected input[type=text]').val(),
36
- site: ewd_ufaq_deactivation_data.site_url,
37
- plugin: 'Ultimate FAQs'
38
- }
39
- var submitSurvey = $.post('https://www.etoilewebdesign.com/UPCP-Key-Check/Deactivation_Surveys.php', data);
40
- submitSurvey.always(function() {
41
- location.href = $deactivateLink.attr('href');
42
- });
43
- });
44
- // Exit key closes survey when open.
45
- $(document).keyup(function(event) {
46
- if (27 === event.keyCode && formOpen) {
47
- $overlay.hide();
48
- formOpen = false;
49
- $deactivateLink.focus();
50
- }
51
- });
 
52
  });
1
+ jQuery(function($){
2
+ var $deactivateLink = $('#the-list').find('[data-slug="ultimate-faqs"] span.deactivate a'),
3
+ $overlay = $('#ewd-ufaq-deactivate-survey-ultimate-faqs'),
4
+ $form = $overlay.find('form'),
5
+ formOpen = false;
6
+ // Plugin listing table deactivate link.
7
+ $deactivateLink.on('click', function(event) {
8
+ event.preventDefault();
9
+ $overlay.css('display', 'table');
10
+ formOpen = true;
11
+ $form.find('.ewd-ufaq-deactivate-survey-option:first-of-type input[type=radio]').focus();
12
+ });
13
+ // Survey radio option selected.
14
+ $form.on('change', 'input[type=radio]', function(event) {
15
+ event.preventDefault();
16
+ $form.find('input[type=text], .error').hide();
17
+ $form.find('.ewd-ufaq-deactivate-survey-option').removeClass('selected');
18
+ $(this).closest('.ewd-ufaq-deactivate-survey-option').addClass('selected').find('input[type=text]').show();
19
+ });
20
+ // Survey Skip & Deactivate.
21
+ $form.on('click', '.ewd-ufaq-deactivate-survey-deactivate', function(event) {
22
+ event.preventDefault();
23
+ location.href = $deactivateLink.attr('href');
24
+ });
25
+ // Survey submit.
26
+ $form.submit(function(event) {
27
+ event.preventDefault();
28
+ if (! $form.find('input[type=radio]:checked').val()) {
29
+ $form.find('.ewd-ufaq-deactivate-survey-footer').prepend('<span class="error">Please select an option below</span>');
30
+ return;
31
+ }
32
+ var data = {
33
+ code: $form.find('.selected input[type=radio]').val(),
34
+ install_time: $form.data('installtime'),
35
+ reason: $form.find('.selected .ewd-ufaq-deactivate-survey-option-reason').text(),
36
+ details: $form.find('.selected input[type=text]').val(),
37
+ site: ewd_ufaq_deactivation_data.site_url,
38
+ plugin: 'Ultimate FAQs'
39
+ }
40
+ var submitSurvey = $.post('https://www.etoilewebdesign.com/UPCP-Key-Check/Deactivation_Surveys.php', data);
41
+ submitSurvey.always(function() {
42
+ location.href = $deactivateLink.attr('href');
43
+ });
44
+ });
45
+ // Exit key closes survey when open.
46
+ $(document).keyup(function(event) {
47
+ if (27 === event.keyCode && formOpen) {
48
+ $overlay.hide();
49
+ formOpen = false;
50
+ $deactivateLink.focus();
51
+ }
52
+ });
53
  });
js/ewd-ufaq-pointers.js CHANGED
@@ -133,4 +133,19 @@ jQuery(document).ready(function() {
133
  }
134
  });
135
 
136
- } )(jQuery, MyAdminPointers); // MyAdminPointers is passed by `wp_localize_script`
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  }
134
  });
135
 
136
+ } )(jQuery, MyAdminPointers); // MyAdminPointers is passed by `wp_localize_script`
137
+
138
+
139
+ function UFAQ_Dismiss_Pointers() {
140
+ jQuery('.ufaq-skip-all-tutorial-pop-ups').on('click', function() {
141
+ jQuery.post( ajaxurl, { action: 'ufaq-dismiss-wp-pointers'});
142
+ pointers_dismissed = true;
143
+ $pointer.pointer( 'close' );
144
+ });
145
+ }
146
+
147
+ jQuery(document).ready(function($) {
148
+ jQuery('body').on('DOMNodeInserted', function(event) {
149
+ if (jQuery(event.target).hasClass('ewd-ufaq-pointer-count')) {UFAQ_Dismiss_Pointers();}
150
+ });
151
+ });
readme.txt CHANGED
@@ -274,6 +274,11 @@ Video 3 - FAQs Ordering
274
 
275
 
276
  == Changelog ==
 
 
 
 
 
277
  = 1.8.11 =
278
  - Corrected issue with Gutenberg blocks not displaying in new WordPress 5.0
279
 
274
 
275
 
276
  == Changelog ==
277
+ = 1.8.12 =
278
+ - Added a skip button to the tutorial that shows when the plugin is first activated
279
+ - Added in a few missing images in the plugin admin area
280
+ - Corrected issue that was causing the review request to pop back up even after a review had been left or feedback sent.
281
+
282
  = 1.8.11 =
283
  - Corrected issue with Gutenberg blocks not displaying in new WordPress 5.0
284