Strong Testimonials - Version 2.31

Version Description

  • May 15, 2018 =
  • Add [testimonial_average_rating] shortcode.
  • Add compatibility option for script controller.
  • Add compatibility option for lazy loading images.
  • Minor template style tweaks for small screens.
  • Use empty star icon instead of full icon in different color.
  • Change default message "Required field" to "Required".
  • Improve exception handling.
  • Improve Pjax compatibility.
  • Apply JavaScript coding standard.
  • Add console logging for slider when SCRIPT_DEBUG enabled.
  • Minor admin style tweaks.
Download this release

Release Info

Developer cdillon27
Plugin Icon 128x128 Strong Testimonials
Version 2.31
Comparing to
See all releases

Code changes from version 2.30.9 to 2.31

Files changed (44) hide show
  1. admin/about/about.php +2 -1
  2. admin/about/class-strong-testimonials-about.php +3 -7
  3. admin/about/how-to.php +0 -10
  4. admin/about/whats-new.php +13 -0
  5. admin/class-strong-testimonials-admin-scripts.php +11 -0
  6. admin/class-strong-testimonials-defaults.php +16 -3
  7. admin/class-strong-testimonials-help.php +3 -3
  8. admin/class-strong-testimonials-page-shortcodes.php +288 -0
  9. admin/class-strong-testimonials-updater.php +44 -30
  10. admin/class-strong-views-list-table.php +12 -2
  11. admin/css/admin-compat.css +131 -153
  12. admin/css/admin.css +21 -2
  13. admin/css/views.css +10 -1
  14. admin/js/admin-compat.js +16 -1
  15. admin/menu/class-strong-testimonials-menu-shortcodes.php +55 -0
  16. admin/partials/views/view-shortcode.php +1 -1
  17. admin/scss/admin-compat.scss +26 -1
  18. admin/scss/views.scss +13 -0
  19. admin/settings/class-strong-testimonials-settings-compat.php +616 -305
  20. admin/settings/partials/licenses.php +1 -0
  21. includes/class-strong-testimonials-render.php +2 -2
  22. includes/class-strong-testimonials-shortcode-average.php +338 -0
  23. includes/class-strong-testimonials-shortcode-count.php +72 -0
  24. includes/{class-strong-testimonials-shortcodes.php → class-strong-testimonials-shortcode.php} +6 -60
  25. includes/class-strong-view-display.php +14 -4
  26. includes/class-strong-view-slideshow.php +38 -9
  27. includes/class-strong-view.php +18 -18
  28. includes/functions-template-form.php +2 -2
  29. includes/functions-template.php +1 -1
  30. includes/functions.php +46 -1
  31. includes/scripts.php +6 -2
  32. public/css/rating-display.css +85 -33
  33. public/css/rating-form.css +18 -29
  34. public/js/controller.js +75 -31
  35. public/js/controller.min.js +1 -1
  36. public/js/lib/form-validation/form-validation.js +50 -50
  37. public/js/lib/form-validation/form-validation.min.js +1 -1
  38. public/js/lib/strongpager/jquery.strongpager.js +80 -80
  39. public/js/lib/strongslider/jquery.strongslider.js +561 -533
  40. public/js/lib/strongslider/jquery.strongslider.min.js +2 -2
  41. readme.txt +22 -7
  42. strong-testimonials.php +14 -7
  43. templates-scss/bold/content.scss +20 -7
  44. templates/bold/content.css +11 -6
admin/about/about.php CHANGED
@@ -1,5 +1,6 @@
1
  <h2><?php _e( 'Flexible Features. Strong Support.', 'strong-testimonials' ); ?></h2>
2
- <p class="lead-description"><?php _e( 'The highest-rated free testimonials plugin trusted by more than 50,000 people keeps getting better.', 'strong-testimonials' ); ?></p>
 
3
  <div class="feature-section one-col">
4
  <div class="col">
5
  <p><?php _e( 'Your site is unique, right? So are your testimonials. This plugin is designed from the ground up to simplify the process of customizing your testimonials or reviews.', 'strong-testimonials' ); ?></p>
1
  <h2><?php _e( 'Flexible Features. Strong Support.', 'strong-testimonials' ); ?></h2>
2
+ <?php /* translators: %s is a formatted number */ ?>
3
+ <p class="lead-description"><?php printf( __( 'The highest-rated free testimonials plugin trusted by more than %s people keeps getting better.', 'strong-testimonials' ), number_format_i18n( 50000 ) ); ?></p>
4
  <div class="feature-section one-col">
5
  <div class="col">
6
  <p><?php _e( 'Your site is unique, right? So are your testimonials. This plugin is designed from the ground up to simplify the process of customizing your testimonials or reviews.', 'strong-testimonials' ); ?></p>
admin/about/class-strong-testimonials-about.php CHANGED
@@ -13,12 +13,6 @@ class Strong_Testimonials_About {
13
  $this->add_actions();
14
  }
15
 
16
- /**
17
- * Initialize.
18
- */
19
- public function init() {
20
- }
21
-
22
  /**
23
  * Add actions and filters.
24
  */
@@ -63,11 +57,13 @@ class Strong_Testimonials_About {
63
  ?>
64
  <div class="wrap about-wrap">
65
 
 
66
  <h1><?php printf( __( 'Welcome to Strong Testimonials %s', 'strong-testimonials' ), $major_minor ); ?></h1>
67
 
68
  <p class="about-text">
69
  <?php _e( 'Thank you for updating to the latest version!' ); ?>
70
- <?php printf( 'Strong Testimonials %s offers improved view options.', $major_minor ); ?>
 
71
  </p>
72
 
73
  <div class="wp-badge strong-testimonials"><?php printf( __( 'Version %s' ), $major_minor ); ?></div>
13
  $this->add_actions();
14
  }
15
 
 
 
 
 
 
 
16
  /**
17
  * Add actions and filters.
18
  */
57
  ?>
58
  <div class="wrap about-wrap">
59
 
60
+ <?php /* translators: %s is the plugin version number */ ?>
61
  <h1><?php printf( __( 'Welcome to Strong Testimonials %s', 'strong-testimonials' ), $major_minor ); ?></h1>
62
 
63
  <p class="about-text">
64
  <?php _e( 'Thank you for updating to the latest version!' ); ?>
65
+ <?php /* translators: %s is the plugin version number */ ?>
66
+ <?php printf( 'Strong Testimonials %s includes a shortcode for your average rating and improves compatibility with lazy loading images.', $major_minor ); ?>
67
  </p>
68
 
69
  <div class="wp-badge strong-testimonials"><?php printf( __( 'Version %s' ), $major_minor ); ?></div>
admin/about/how-to.php CHANGED
@@ -52,16 +52,6 @@ $add_the_view = __( 'Add the view to a page or sidebar using its unique shortcod
52
  <p>3. <?php echo $add_the_view; ?></p>
53
  </div>
54
 
55
- <div class="col">
56
- <h3><?php _e( 'How to Display the Number of Testimonials', 'strong-testimonials' ); ?></h3>
57
- <p><?php printf( __( 'Use the %s shortcode.', 'strong-testimonials' ), '<code>&#91;testimonial_count&#93;</code>' ); ?>
58
- <?php _e( 'For example:', 'strong-testimonials' ); ?></p>
59
- <p><span class="code"><?php printf( __( 'Read some of our %s testimonials!', 'strong-testimonials' ), '&#91;testimonial_count&#93;' ); ?></span></p>
60
- <p><?php printf( __( 'To count for a specific category, add the %s attribute with the category slug.', 'strong-testimonials' ), '<code>category</code>' ); ?>
61
- <?php _e( 'For example:', 'strong-testimonials' ); ?></p>
62
- <p><span class="code"><?php printf( __( 'Here\'s what %s local clients say', 'strong-testimonials' ), '&#91;testimonial_count category="local"&#93;' ); ?></span></p>
63
- </div>
64
-
65
  <div class="col">
66
  <h3><?php _e( 'How to Translate', 'strong-testimonials' ); ?></h3>
67
  <p><?php _e( 'Strong Testimonials is compatible with WPML, Polylang and WP Globus.', 'strong-testimonials' ); ?></p>
52
  <p>3. <?php echo $add_the_view; ?></p>
53
  </div>
54
 
 
 
 
 
 
 
 
 
 
 
55
  <div class="col">
56
  <h3><?php _e( 'How to Translate', 'strong-testimonials' ); ?></h3>
57
  <p><?php _e( 'Strong Testimonials is compatible with WPML, Polylang and WP Globus.', 'strong-testimonials' ); ?></p>
admin/about/whats-new.php CHANGED
@@ -1,6 +1,18 @@
1
 
2
  <h2>Now Even Stronger</h2>
3
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  <p class="lead-description">Version 2.30 adds highly requested features, improves compatibility and fixes bugs.</p>
5
 
6
  <div class="feature-section one-col">
@@ -30,6 +42,7 @@
30
  <li>Version 2.30.6</li>
31
  <li>Version 2.30.7</li>
32
  <li>Version 2.30.8</li>
 
33
  </ul>
34
 
35
  </div>
1
 
2
  <h2>Now Even Stronger</h2>
3
 
4
+ <p class="lead-description">Version 2.31 adds a highly requested feature and two more compatibility options.</p>
5
+
6
+ <div class="feature-section one-col">
7
+ <div class="col">
8
+ <p>NEW: Display your average rating with the <code>&#91;testimonial_average_rating&#93;</code> shortcode. Finally!</p>
9
+ <p>NEW: Use the Load Event option to potentially fix problems with sliders and Masonry in complex themes.</p>
10
+ <p>NEW: Use the Lazy Loading option to potentially fix problems with testimonial images being cut off.</p>
11
+ <p>IMPROVED: The star ratings now use an empty star instead of a gray full star. This is the more popular approach.</p>
12
+ <p>IMPROVED: Minor style tweaks in both admin and in some templates for small screens.</p>
13
+ </div>
14
+ </div>
15
+
16
  <p class="lead-description">Version 2.30 adds highly requested features, improves compatibility and fixes bugs.</p>
17
 
18
  <div class="feature-section one-col">
42
  <li>Version 2.30.6</li>
43
  <li>Version 2.30.7</li>
44
  <li>Version 2.30.8</li>
45
+ <li>Version 2.30.9</li>
46
  </ul>
47
 
48
  </div>
admin/class-strong-testimonials-admin-scripts.php CHANGED
@@ -28,6 +28,7 @@ class Strong_Testimonials_Admin_Scripts {
28
  add_action( 'admin_print_styles-wpm-testimonial_page_testimonial-fields', array( __CLASS__, 'admin_fields' ) );
29
  add_action( 'admin_print_styles-wpm-testimonial_page_testimonial-settings', array( __CLASS__, 'admin_settings' ) );
30
  add_action( 'admin_print_styles-wpm-testimonial_page_about-strong-testimonials', array( __CLASS__, 'admin_about' ) );
 
31
 
32
  add_action( 'load-edit.php', array( __CLASS__, 'admin_load_edit' ) );
33
  add_action( 'load-post.php', array( __CLASS__, 'admin_load_post' ) );
@@ -313,6 +314,16 @@ class Strong_Testimonials_Admin_Scripts {
313
  wp_enqueue_style( 'wpmtst-about-style' );
314
  }
315
 
 
 
 
 
 
 
 
 
 
 
316
  /**
317
  * List table
318
  */
28
  add_action( 'admin_print_styles-wpm-testimonial_page_testimonial-fields', array( __CLASS__, 'admin_fields' ) );
29
  add_action( 'admin_print_styles-wpm-testimonial_page_testimonial-settings', array( __CLASS__, 'admin_settings' ) );
30
  add_action( 'admin_print_styles-wpm-testimonial_page_about-strong-testimonials', array( __CLASS__, 'admin_about' ) );
31
+ add_action( 'admin_print_styles-wpm-testimonial_page_testimonial-shortcodes', array( __CLASS__, 'admin_shortcodes' ) );
32
 
33
  add_action( 'load-edit.php', array( __CLASS__, 'admin_load_edit' ) );
34
  add_action( 'load-post.php', array( __CLASS__, 'admin_load_post' ) );
314
  wp_enqueue_style( 'wpmtst-about-style' );
315
  }
316
 
317
+ /**
318
+ * Shortcodes
319
+ *
320
+ * @since 2.31.0
321
+ */
322
+ public static function admin_shortcodes() {
323
+ wp_enqueue_style( 'wpmtst-admin-style' );
324
+ wp_enqueue_style( 'wpmtst-rating-display' );
325
+ }
326
+
327
  /**
328
  * List table
329
  */
admin/class-strong-testimonials-defaults.php CHANGED
@@ -389,8 +389,8 @@ class Strong_Testimonials_Defaults {
389
  'required-field' => array(
390
  'order' => 1,
391
  /* translators: Settings > Form > Messages tab */
392
- 'description' => _x( 'Required Field', 'setting description', 'strong-testimonials' ),
393
- 'text' => _x( 'Required field', 'Default message for required notice at top of form.', 'strong-testimonials' ),
394
  'enabled' => 1,
395
  ),
396
  'captcha' => array(
@@ -762,7 +762,8 @@ class Strong_Testimonials_Defaults {
762
  * Compatibility options.
763
  *
764
  * @since 2.28.0
765
- *
 
766
  * @return array
767
  */
768
  public static function get_compat_options() {
@@ -778,6 +779,18 @@ class Strong_Testimonials_Defaults {
778
  'event' => '',
779
  'script' => '',
780
  ),
 
 
 
 
 
 
 
 
 
 
 
 
781
  );
782
 
783
  return $options;
389
  'required-field' => array(
390
  'order' => 1,
391
  /* translators: Settings > Form > Messages tab */
392
+ 'description' => _x( 'Required', 'setting description', 'strong-testimonials' ),
393
+ 'text' => _x( 'Required', 'Default message for required notice at top of form.', 'strong-testimonials' ),
394
  'enabled' => 1,
395
  ),
396
  'captcha' => array(
762
  * Compatibility options.
763
  *
764
  * @since 2.28.0
765
+ * @since 2.31.0 controller
766
+ * @since 2.31.0 lazyload
767
  * @return array
768
  */
769
  public static function get_compat_options() {
779
  'event' => '',
780
  'script' => '',
781
  ),
782
+ 'controller' => array(
783
+ 'initialize_on' => 'documentReady', // or windowLoad
784
+ ),
785
+ 'lazyload' => array(
786
+ 'enabled' => '',
787
+ 'classes' => array( // may be multiple pairs
788
+ array(
789
+ 'start' => '',
790
+ 'finish' => '',
791
+ )
792
+ ),
793
+ ),
794
  );
795
 
796
  return $options;
admin/class-strong-testimonials-help.php CHANGED
@@ -122,12 +122,12 @@ class Strong_Testimonials_Help {
122
  <p><?php _e( 'For example, imagine you have five services, a sales page for each service, and a testimonial category for each service. To display the testimonials on each service page, you can create five duplicate views, one for each category.', 'strong-testimonials' ); ?>
123
  <p><?php _e( 'Or you can configure one view as a pattern and add it to each service page with the <code>category</code> attribute.', 'strong-testimonials' ); ?>
124
  <p>
125
- <?php _e( '<code>[testimonial_view id=1 category="service-1"]</code>', 'strong-testimonials' ); ?>,
126
- <?php _e( '<code>[testimonial_view id=1 category="service-2"]</code>', 'strong-testimonials' ); ?>, etc.
127
  </p>
128
  <p>
129
  <?php _e( 'Attributes may be used in combination. For example:', 'strong-testimonials' ); ?>
130
- <?php _e( '<code>[testimonial_view id=1 category="service-3" order="random" count="5"]</code>', 'strong-testimonials' ); ?>
131
  </p>
132
  <p><?php _e( 'Using <code>post_ids</code> is the most specific method and it will override category and count (whether settings or attributes).', 'strong-testimonials' ); ?></p>
133
  </div>
122
  <p><?php _e( 'For example, imagine you have five services, a sales page for each service, and a testimonial category for each service. To display the testimonials on each service page, you can create five duplicate views, one for each category.', 'strong-testimonials' ); ?>
123
  <p><?php _e( 'Or you can configure one view as a pattern and add it to each service page with the <code>category</code> attribute.', 'strong-testimonials' ); ?>
124
  <p>
125
+ <?php _e( '<code>[testimonial_view id="1" category="service-1"]</code>', 'strong-testimonials' ); ?>,
126
+ <?php _e( '<code>[testimonial_view id="1" category="service-2"]</code>', 'strong-testimonials' ); ?>, etc.
127
  </p>
128
  <p>
129
  <?php _e( 'Attributes may be used in combination. For example:', 'strong-testimonials' ); ?>
130
+ <?php _e( '<code>[testimonial_view id="1" category="service-3" order="random" count="5"]</code>', 'strong-testimonials' ); ?>
131
  </p>
132
  <p><?php _e( 'Using <code>post_ids</code> is the most specific method and it will override category and count (whether settings or attributes).', 'strong-testimonials' ); ?></p>
133
  </div>
admin/class-strong-testimonials-page-shortcodes.php ADDED
@@ -0,0 +1,288 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class Strong_Testimonials_Page_Shortcodes
5
+ *
6
+ * @since 2.31.0
7
+ */
8
+ class Strong_Testimonials_Page_Shortcodes {
9
+
10
+ /**
11
+ * Strong_Testimonials_Page_Shortcodes constructor.
12
+ */
13
+ private function __construct() {
14
+ }
15
+
16
+ /**
17
+ * Render the shortcode instructions page.
18
+ */
19
+ public static function render_page() {
20
+
21
+ $tags = array(
22
+ 'a' => array(
23
+ 'href' => array(),
24
+ 'target' => array(),
25
+ ),
26
+ );
27
+ ?>
28
+ <div class="wrap wpmtst shortcodes has-stars">
29
+
30
+ <h1><?php _e( 'Shortcodes', 'strong-testimonials' ); ?></h1>
31
+
32
+ <p><?php printf( wp_kses( __( 'Open a <a href="%s" target="_blank">support ticket</a> if you need help.', 'strong-testimonials' ), $tags ), esc_url( 'https://support.strongplugins.com/new-ticket/' ) ); ?></p>
33
+
34
+ <h2><?php _e( 'Testimonial Views', 'strong-testimonials' ); ?></h2>
35
+
36
+ <p>
37
+ <?php _e( 'Each view has a unique shortcode like <code>&#91;testimonial_view id="1"&#93;</code>.', 'strong-testimonials' ); ?>
38
+ <?php printf( '<a href="%s">%s</a>', esc_url( admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-views' ) ), __( 'Go to views', 'strong-testimonials' ) ); ?>
39
+ </p>
40
+
41
+ <h2><?php _e( 'Testimonial Count', 'strong-testimonials' ); ?></h2>
42
+
43
+ <p><?php printf( __( 'Use %s to display the number of testimonials.', 'strong-testimonials' ), '<code>&#91;testimonial_count&#93;</code>' ); ?></p>
44
+
45
+ <table class="form-table shortcodes">
46
+ <tr>
47
+ <td>
48
+ <p><?php _e( 'Default', 'strong-testimonials' ); ?></p>
49
+ </td>
50
+ <td class="shortcode">
51
+ <?php /* translators: %s is a shortcode */ ?>
52
+ <p>
53
+ <?php printf( __( 'Read some of our %s testimonials!', 'strong-testimonials' ), '&#91;testimonial_count&#93;' ); ?>
54
+ </p>
55
+ </td>
56
+ </tr>
57
+ <tr>
58
+ <td>
59
+ <?php /* translators: %s is a shortcode attribute */ ?>
60
+ <p><?php printf( __( 'To count for a specific category, add the %s attribute with the category slug.', 'strong-testimonials' ), '<code>category</code>' ); ?>
61
+ </td>
62
+ <td class="shortcode">
63
+ <?php /* translators: %s is a shortcode */ ?>
64
+ <p>
65
+ <?php printf( __( 'Here\'s what %s local clients say', 'strong-testimonials' ), '&#91;testimonial_count category="local"&#93;' ); ?>
66
+ </p>
67
+ </td>
68
+ </tr>
69
+ </table>
70
+
71
+ <h2><?php _e( 'Average Rating', 'strong-testimonials' ); ?></h2>
72
+
73
+ <p>
74
+ <?php /* translators: %s is a shortcode */ ?>
75
+ <?php printf( __( 'If using a <strong>single</strong> rating field, use %s to display the average rating.', 'strong-testimonials' ), '<code>&#91;testimonial_average_rating&#93;</code>' ); ?>
76
+ </p>
77
+
78
+ <table class="form-table shortcodes aggregate">
79
+ <tr>
80
+ <td rowspan="2">
81
+ <p><?php _e( 'Default', 'strong-testimonials' ); ?></p>
82
+ <p class="description"><?php _e( 'You must use the closing slash <code>/</code> if using the shortcode with content elsewhere on your page.', 'strong-testimonials' ); ?></p>
83
+ </td>
84
+ <td class="shortcode">&#91;testimonial_average_rating /&#93;</td>
85
+ </tr>
86
+ <tr>
87
+ <td>
88
+ <div class="strong-rating-wrapper average">
89
+ <span class="strong-rating-title">Average Rating:</span>
90
+ <span class="strong-rating"><span class="star0 star"></span><span class="star"></span><span
91
+ class="star"></span><span class="star"></span><span class="star current half"></span><span
92
+ class="star"></span></span>
93
+ <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span>
94
+ </div>
95
+ </td>
96
+ </tr>
97
+ </table>
98
+
99
+ <table class="form-table shortcodes aggregate">
100
+ <tr>
101
+ <td rowspan="2">
102
+ <p><?php _e( 'Customize using content tags.', 'strong-testimonials' ); ?></p>
103
+ <p><?php _e( 'Default:', 'strong-testimonials' ); ?></p>
104
+ <p><code>{title}</code><br><code>{stars}</code><br><code>{summary}</code></p>
105
+ </td>
106
+ <td class="shortcode">&#91;testimonial_average_rating&#93;{title} {stars} {summary}&#91;/testimonial_average_rating&#93;</td>
107
+ </tr>
108
+ <tr>
109
+ <td>
110
+ <div class="strong-rating-wrapper average">
111
+ <span class="strong-rating-title">Average Rating:</span>
112
+ <span class="strong-rating"><span class="star0 star"></span><span class="star"></span><span
113
+ class="star"></span><span class="star"></span><span class="star current half"></span><span
114
+ class="star"></span></span>
115
+ <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span>
116
+ </div>
117
+ </td>
118
+ </tr>
119
+ </table>
120
+
121
+ <table class="form-table shortcodes aggregate">
122
+ <tr>
123
+ <td rowspan="2">
124
+ <p><?php _e( 'Alternate content tags.', 'strong-testimonials' ); ?></p>
125
+ <p><code>{title2}</code><br><code>{summary2}</code></p>
126
+ </td>
127
+ <td class="shortcode">&#91;testimonial_average_rating&#93;{title2} {stars} {summary2}&#91;/testimonial_average_rating&#93;</td>
128
+ </tr>
129
+ <tr>
130
+ <td>
131
+ <div class="strong-rating-wrapper average">
132
+ <span class="strong-rating-title">Average of 9 Ratings:</span>
133
+ <span class="strong-rating"><span class="star0 star"></span><span class="star"></span><span
134
+ class="star"></span><span class="star"></span><span class="star current half"></span><span
135
+ class="star"></span></span>
136
+ <span class="strong-rating-summary">4.3 stars</span>
137
+ </div>
138
+ </td>
139
+ </tr>
140
+ </table>
141
+
142
+ <table class="form-table shortcodes aggregate">
143
+ <tr>
144
+ <td rowspan="2">
145
+ <p><?php _e( 'Insert tags into your custom content.', 'strong-testimonials' ); ?></p>
146
+ <p class="description"><?php _e( '', 'strong-testimonials' ); ?></p>
147
+ </td>
148
+ <td class="shortcode">&#91;testimonial_average_rating&#93;{stars} Our average rating is &lt;b&gt;{summary2}&lt;/b&gt;&#91;/testimonial_average_rating&#93;</td>
149
+ </tr>
150
+ <tr>
151
+ <td>
152
+ <div class="strong-rating-wrapper average">
153
+ <span class="strong-rating">
154
+ <span class="star0 star"></span>
155
+ <span class="star"></span><span class="star"></span><span class="star"></span><span class="star current half"></span><span
156
+ class="star"></span>
157
+ </span>
158
+ Our average rating is <b><span class="strong-rating-summary">4.3 stars</span></b>
159
+ </div>
160
+ </td>
161
+ </tr>
162
+ </table>
163
+
164
+ <table class="form-table shortcodes aggregate">
165
+ <tr>
166
+ <td rowspan="2">
167
+ <p><code>{stars}</code></p>
168
+ </td>
169
+ <td class="shortcode">&#91;testimonial_average_rating&#93;{stars}&#91;/testimonial_average_rating&#93;</td>
170
+ </tr>
171
+ <tr>
172
+ <td>
173
+ <div class="strong-rating-wrapper average">
174
+ <span class="strong-rating"><span class="star0 star"></span><span class="star"></span><span
175
+ class="star"></span><span class="star"></span><span class="star current half"></span><span
176
+ class="star"></span></span>
177
+ </div>
178
+ </td>
179
+ </tr>
180
+ </table>
181
+
182
+ <table class="form-table shortcodes aggregate">
183
+ <tr>
184
+ <td rowspan="2">
185
+ <p><code>{average}</code></p>
186
+ </td>
187
+ <td class="shortcode">&#91;testimonial_average_rating&#93;{average}&#91;/testimonial_average_rating&#93;</td>
188
+ </tr>
189
+ <tr>
190
+ <td>
191
+ <div class="strong-rating-wrapper average"><span class="strong-rating-average">4.3</span></div>
192
+ </td>
193
+ </tr>
194
+ </table>
195
+
196
+ <table class="form-table shortcodes aggregate">
197
+ <tr>
198
+ <td rowspan="2">
199
+ <p><code>{count}</code></p>
200
+ </td>
201
+ <td class="shortcode">&#91;testimonial_average_rating&#93;{count}&#91;/testimonial_average_rating&#93;</td>
202
+ </tr>
203
+ <tr>
204
+ <td>
205
+ <div class="strong-rating-wrapper average"><span class="strong-rating-count">9</span></div>
206
+ </td>
207
+ </tr>
208
+ </table>
209
+
210
+ <table class="form-table shortcodes aggregate">
211
+ <tr>
212
+ <td rowspan="2">
213
+ <p><code>block</code></p>
214
+ </td>
215
+ <td class="shortcode">&#91;testimonial_average_rating block /&#93;</td>
216
+ </tr>
217
+ <tr>
218
+ <td>
219
+ <div class="strong-rating-wrapper average block"><span class="strong-rating-title">Average Rating:</span>
220
+ <span class="strong-rating">
221
+ <span class="star0 star"></span>
222
+ <span class="star"></span><span class="star"></span><span class="star"></span><span class="star current half"></span><span
223
+ class="star"></span></span>
224
+ <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span></div>
225
+ </td>
226
+ </tr>
227
+ </table>
228
+
229
+ <table class="form-table shortcodes aggregate">
230
+ <tr>
231
+ <td rowspan="2">
232
+ <p><code>centered</code></p>
233
+ </td>
234
+ <td class="shortcode">&#91;testimonial_average_rating centered /&#93;</td>
235
+ </tr>
236
+ <tr>
237
+ <td>
238
+ <div class="strong-rating-wrapper average centered"><span class="strong-rating-title">Average Rating:</span>
239
+ <span class="strong-rating">
240
+ <span class="star0 star"></span>
241
+ <span class="star"></span><span class="star"></span><span class="star"></span><span class="star current half"></span><span
242
+ class="star"></span></span>
243
+ <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span></div>
244
+ </td>
245
+ </tr>
246
+ </table>
247
+
248
+ <table class="form-table shortcodes aggregate">
249
+ <tr>
250
+ <td rowspan="2">
251
+ <p><code>block</code> and <code>centered</code></p>
252
+ </td>
253
+ <td class="shortcode">&#91;testimonial_average_rating block centered /&#93;</td>
254
+ </tr>
255
+ <tr>
256
+ <td>
257
+ <div class="strong-rating-wrapper average block centered"><span class="strong-rating-title">Average Rating:</span>
258
+ <span class="strong-rating">
259
+ <span class="star0 star"></span>
260
+ <span class="star"></span><span class="star"></span><span class="star"></span><span class="star current half"></span><span class="star"></span></span>
261
+ <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span></div>
262
+ </td>
263
+ </tr>
264
+ </table>
265
+
266
+ <table class="form-table shortcodes aggregate">
267
+ <tr>
268
+ <td rowspan="2">
269
+ <p><?php _e( 'The default container element is <code>div</code>. Select another element using <code>element</code>.', 'strong-testimonials' ); ?></p>
270
+ </td>
271
+ <td class="shortcode">&#91;testimonial_average_rating element="span" /&#93;</td>
272
+ </tr>
273
+ <tr>
274
+ <td>
275
+ <span class="strong-rating-wrapper average"><span class="strong-rating-title">Average Rating:</span> <span
276
+ class="strong-rating">
277
+ <span class="star0 star"></span>
278
+ <span class="star"></span><span class="star"></span><span class="star"></span><span class="star current half"></span><span class="star"></span></span>
279
+ <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span></span>
280
+ </td>
281
+ </tr>
282
+ </table>
283
+
284
+ </div>
285
+ <?php
286
+ }
287
+
288
+ }
admin/class-strong-testimonials-updater.php CHANGED
@@ -206,10 +206,14 @@ class Strong_Testimonials_Updater {
206
  */
207
  public function update_addons() {
208
  $addons = get_option( 'wpmtst_addons' );
209
- foreach ( $addons as $addon => $data ) {
210
- $addons[ $addon ]['file'] = plugin_basename( basename( $data['file'], '.php' ) . '/' . basename( $data['file'] ) );
 
 
 
 
 
211
  }
212
- update_option( 'wpmtst_addons', $addons );
213
  }
214
 
215
  /**
@@ -383,35 +387,15 @@ class Strong_Testimonials_Updater {
383
  }
384
 
385
  /**
386
- * Custom fields
 
 
 
387
  *
388
  * @return array
389
  */
390
  public function update_fields() {
391
- $fields = get_option( 'wpmtst_fields', array() );
392
- if ( ! $fields ) {
393
- return Strong_Testimonials_Defaults::get_fields();
394
- }
395
-
396
- /**
397
- * Updating from 1.x
398
- *
399
- * Copy current custom fields to the new default custom form which will be added in the next step.
400
- *
401
- * @since 2.0.1
402
- * @since 2.17 Added version check.
403
- */
404
- if ( version_compare( '2.0', $this->old_version ) ) {
405
- if ( isset( $fields['field_groups'] ) ) {
406
- $default_custom_forms[1]['fields'] = $fields['field_groups']['custom']['fields'];
407
- unset( $fields['field_groups'] );
408
- }
409
- if ( isset( $fields['current_field_group'] ) ) {
410
- unset( $fields['current_field_group'] );
411
- }
412
- }
413
-
414
- return $fields;
415
  }
416
 
417
  /**
@@ -639,9 +623,39 @@ class Strong_Testimonials_Updater {
639
 
640
  // Merge in new options.
641
  $defaults = Strong_Testimonials_Defaults::get_compat_options();
 
642
  // Merge nested arrays individually. Don't use array_merge_recursive.
643
- $options['ajax'] = array_merge( $defaults['ajax'], $options['ajax'] );
644
- $options = array_merge( $defaults, $options );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
645
 
646
  return $options;
647
  }
206
  */
207
  public function update_addons() {
208
  $addons = get_option( 'wpmtst_addons' );
209
+ if ( $addons ) {
210
+ foreach ( $addons as $addon => $data ) {
211
+ if ( isset( $addons[ $addon ]['file'] ) ) {
212
+ $addons[ $addon ]['file'] = plugin_basename( basename( $data['file'], '.php' ) . '/' . basename( $data['file'] ) );
213
+ }
214
+ }
215
+ update_option( 'wpmtst_addons', $addons );
216
  }
 
217
  }
218
 
219
  /**
387
  }
388
 
389
  /**
390
+ * Default custom fields.
391
+ *
392
+ * @since 2.31.0 There is a rare bug/conflict where the default fields are incomplete.
393
+ * Overwrite existing fields on every update to auto-repair.
394
  *
395
  * @return array
396
  */
397
  public function update_fields() {
398
+ return Strong_Testimonials_Defaults::get_fields();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
399
  }
400
 
401
  /**
623
 
624
  // Merge in new options.
625
  $defaults = Strong_Testimonials_Defaults::get_compat_options();
626
+
627
  // Merge nested arrays individually. Don't use array_merge_recursive.
628
+
629
+ if ( isset( $options['controller'] ) ) {
630
+ $options['ajax'] = array_merge( $defaults['ajax'], $options['ajax'] );
631
+ } else {
632
+ $options['ajax'] = $defaults['ajax'];
633
+ }
634
+
635
+ /**
636
+ * Controller
637
+ *
638
+ * @since 2.31.0
639
+ */
640
+ if ( isset( $options['controller'] ) ) {
641
+ $options['controller'] = array_merge( $defaults['controller'], $options['controller'] );
642
+ } else {
643
+ $options['controller'] = $defaults['controller'];
644
+ }
645
+
646
+ /**
647
+ * Lazy load
648
+ *
649
+ * @since 2.31.0
650
+ */
651
+ if ( isset( $options['lazyload'] ) ) {
652
+ // first level only: enabled, classes (array)
653
+ $options['lazyload'] = array_merge( $defaults['lazyload'], $options['lazyload'] );
654
+ } else {
655
+ $options['lazyload'] = $defaults['lazyload'];
656
+ }
657
+
658
+ $options = array_merge( $defaults, $options );
659
 
660
  return $options;
661
  }
admin/class-strong-views-list-table.php CHANGED
@@ -2,13 +2,23 @@
2
  /**
3
  * Admin List Table
4
  *
5
- * @version 0.2.0
6
  */
7
 
8
  class Strong_Views_List_Table extends Strong_Testimonials_List_Table {
9
 
10
  public $stickies;
11
 
 
 
 
 
 
 
 
 
 
 
12
  public function prepare_list( $data = array() ) {
13
  $this->stickies = get_option( 'wpmtst_sticky_views', array() );
14
 
@@ -152,7 +162,7 @@ class Strong_Views_List_Table extends Strong_Testimonials_List_Table {
152
  if ( 'single_template' == $item['data']['mode'] ) {
153
  $text = '';
154
  } else {
155
- $text = "[testimonial_view id={$item['id']}]";
156
  }
157
  break;
158
  default:
2
  /**
3
  * Admin List Table
4
  *
5
+ * @version 0.2.1
6
  */
7
 
8
  class Strong_Views_List_Table extends Strong_Testimonials_List_Table {
9
 
10
  public $stickies;
11
 
12
+ /**
13
+ * Message to be displayed when there are no items
14
+ *
15
+ * @since 0.2.1
16
+ * @access public
17
+ */
18
+ public function no_items() {
19
+ _e( 'No views found.', 'strong-testimonials' );
20
+ }
21
+
22
  public function prepare_list( $data = array() ) {
23
  $this->stickies = get_option( 'wpmtst_sticky_views', array() );
24
 
162
  if ( 'single_template' == $item['data']['mode'] ) {
163
  $text = '';
164
  } else {
165
+ $text = '[testimonial_view id="' . $item['id'] . '"]';
166
  }
167
  break;
168
  default:
admin/css/admin-compat.css CHANGED
@@ -5,101 +5,92 @@
5
  * Basic structure
6
  */
7
  div.row {
8
- display: table-row;
9
- }
10
- div.row > div {
11
- display: table-cell;
12
- }
13
- div.row:not(:last-child) > div {
14
- padding-bottom: 0.5em;
15
- }
16
- div.row p {
17
- margin-bottom: 0.5em;
18
- }
19
- div.row.header p {
20
- margin-bottom: 1em;
21
- }
22
 
23
  /**
24
  * Elements
25
  */
26
  .wrap.wpmtst h2 {
27
- margin: 2em 0 1em;
28
- }
29
- .wrap.wpmtst h2.nav-tab-wrapper {
30
- margin-top: 6px;
31
- }
32
 
33
  input.element {
34
- width: 15em;
35
- }
36
 
37
  /**
38
  * Behavior
39
  */
40
  .hidden {
41
- display: none;
42
- }
43
 
44
  [data-sub] {
45
- display: none;
46
- }
47
 
48
  /**
49
  * Common scenarios table
50
  */
51
  div.scenarios div.row {
52
- border: 1px solid #DDD;
53
- }
54
- div.scenarios div.row > div {
55
- padding: 1em;
56
- }
57
- div.scenarios div.row > div:first-child {
58
- width: 35%;
59
- border-right: 1px dotted #DDD;
60
- }
61
- div.scenarios div.row > div:last-child {
62
- width: 30%;
63
- border-left: 1px dotted #DDD;
64
- }
65
- div.scenarios div.row p {
66
- font-size: 14px;
67
- margin: 0;
68
- }
69
- div.scenarios div.row p:not(:last-child) {
70
- margin-bottom: 1em;
71
- }
72
- div.scenarios div.row.header > div {
73
- font-weight: 600;
74
- padding: 0.5em 1em;
75
- }
76
 
77
  /**
78
  * Settings table
79
  */
80
  div.row:not(:last-child) > div:nth-child(2) {
81
- padding-bottom: 0.5em;
82
- }
83
- div.row > div:first-child {
84
- width: 180px;
85
- }
86
  div.row > div.radio-sub label {
87
  text-indent: 24px;
88
- }
89
  div.row p.about {
90
  display: inline-block;
91
- }
92
- div.row p.about.adjacent {
93
- margin-left: 0.5em;
94
- }
95
  div.row p.description {
96
  display: inline-block;
97
- font-size: 14px;
98
- }
99
  div.row label.current {
100
- font-weight: 600;
101
- }
102
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  /**
104
  * Number spinner
105
  */
@@ -108,93 +99,80 @@ div.row label.current {
108
  margin-right: 10px;
109
  /**
110
  * Disable text selection on buttons. Seems to help jittery pointers.
111
- */
112
- }
113
- .number-style input {
114
- margin: 0 5px;
115
- font-family: Consolas, Monaco, monospace;
116
- text-align: center;
117
- width: 4em;
118
- }
119
- .number-style > span {
120
- cursor: pointer;
121
- }
122
- .number-style > span.number-minus, .number-style > span.number-plus {
123
- height: 24px;
124
- width: 24px;
125
- display: inline-block;
126
- text-align: center;
127
- vertical-align: top;
128
- border-radius: 3px;
129
- background: #0085ba;
130
- border-width: 1px;
131
- border-style: solid;
132
- border-color: #0073aa #006799 #006799;
133
- -webkit-box-shadow: 0 1px 0 #006799;
134
- box-shadow: 0 1px 0 #006799;
135
- text-shadow: 0 -1px 1px #006799, 1px 0 1px #006799, 0 1px 1px #006799, -1px 0 1px #006799;
136
- color: #FFF;
137
- }
138
- .number-style > span.number-minus:hover, .number-style > span.number-plus:hover {
139
- background: #008ec2;
140
- }
141
- .number-style > span.number-minus:active, .number-style > span.number-plus:active {
142
- background: #0073aa;
143
- border-color: #006799;
144
- -webkit-box-shadow: inset 0 2px 0 #006799;
145
- box-shadow: inset 0 2px 0 #006799;
146
- -webkit-transform: translateY(1px);
147
- -ms-transform: translateY(1px);
148
- transform: translateY(1px);
149
- outline: none;
150
- }
151
- .number-style > span.number-minus.disabled, .number-style > span.number-plus.disabled {
152
- background: #AAA;
153
- border-color: #999 #777 #777;
154
- -webkit-box-shadow: 0 1px 0 #777;
155
- box-shadow: 0 1px 0 #777;
156
- text-shadow: 0 -1px 1px #777, 1px 0 1px #777, 0 1px 1px #777, -1px 0 1px #777;
157
- }
158
- .number-style > span.number-minus::after, .number-style > span.number-plus::after {
159
- font-family: dashicons;
160
- font-size: 24px;
161
- line-height: 24px;
162
- height: 24px;
163
- width: 24px;
164
- display: inline-block;
165
- color: #FFF;
166
- text-align: center;
167
- position: relative;
168
- left: -1px;
169
- }
170
- .number-style > span.number-minus::after {
171
- content: "\f140";
172
- }
173
- .number-style > span.number-plus::after {
174
- content: "\f142";
175
- }
176
- .number-style input[type='number'] {
177
- -moz-appearance: textfield;
178
- }
179
- .number-style input::-webkit-outer-spin-button,
180
- .number-style input::-webkit-inner-spin-button {
181
- -webkit-appearance: none;
182
- }
183
- .number-style .number-minus,
184
- .number-style .number-plus,
185
- .number-style .number-minus::after,
186
- .number-style .number-plus::after {
187
- -webkit-touch-callout: none;
188
- /* iOS Safari */
189
- -webkit-user-select: none;
190
- /* Safari */
191
- -khtml-user-select: none;
192
- /* Konqueror HTML */
193
- -moz-user-select: none;
194
- /* Firefox */
195
- -ms-user-select: none;
196
- /* Internet Explorer/Edge */
197
- user-select: none;
198
- /* Non-prefixed version, currently
199
- supported by Chrome and Opera */
200
- }
5
  * Basic structure
6
  */
7
  div.row {
8
+ display: table-row; }
9
+ div.row > div {
10
+ display: table-cell; }
11
+ div.row > div:first-child {
12
+ width: 200px; }
13
+ div.row:not(:last-child) > div {
14
+ padding-bottom: 0.5em; }
15
+ div.row p {
16
+ margin-bottom: 0.5em; }
17
+ div.row.header p {
18
+ margin-bottom: 1em; }
 
 
 
19
 
20
  /**
21
  * Elements
22
  */
23
  .wrap.wpmtst h2 {
24
+ margin: 2em 0 1em; }
25
+ .wrap.wpmtst h2.nav-tab-wrapper {
26
+ margin-top: 6px; }
 
 
27
 
28
  input.element {
29
+ width: 15em; }
 
30
 
31
  /**
32
  * Behavior
33
  */
34
  .hidden {
35
+ display: none; }
 
36
 
37
  [data-sub] {
38
+ display: none; }
 
39
 
40
  /**
41
  * Common scenarios table
42
  */
43
  div.scenarios div.row {
44
+ border: 1px solid #DDD; }
45
+ div.scenarios div.row > div {
46
+ padding: 1em; }
47
+ div.scenarios div.row > div:first-child {
48
+ width: 35%;
49
+ border-right: 1px dotted #DDD; }
50
+ div.scenarios div.row > div:last-child {
51
+ width: 30%;
52
+ border-left: 1px dotted #DDD; }
53
+ div.scenarios div.row p {
54
+ font-size: 14px;
55
+ margin: 0; }
56
+ div.scenarios div.row p:not(:last-child) {
57
+ margin-bottom: 1em; }
58
+ div.scenarios div.row.header > div {
59
+ font-weight: 600;
60
+ padding: 0.5em 1em; }
 
 
 
 
 
 
 
61
 
62
  /**
63
  * Settings table
64
  */
65
  div.row:not(:last-child) > div:nth-child(2) {
66
+ padding-bottom: 0.5em; }
 
 
 
 
67
  div.row > div.radio-sub label {
68
  text-indent: 24px;
69
+ width: 200px; }
70
  div.row p.about {
71
  display: inline-block;
72
+ vertical-align: middle; }
73
+ div.row p.about.adjacent {
74
+ margin-left: 0.5em; }
 
75
  div.row p.description {
76
  display: inline-block;
77
+ font-size: 14px; }
 
78
  div.row label.current {
79
+ font-weight: 600; }
 
80
 
81
+ /**
82
+ * Lazy load class name pairs
83
+ */
84
+ .pair-actions {
85
+ margin-top: 10px; }
86
+
87
+ .pair-sep {
88
+ margin-right: 1em; }
89
+
90
+ @media only screen and (max-width: 1024px) {
91
+ .lazyload-pairs .pair {
92
+ border: 1px solid #DDD;
93
+ padding: 5px 10px; } }
94
  /**
95
  * Number spinner
96
  */
99
  margin-right: 10px;
100
  /**
101
  * Disable text selection on buttons. Seems to help jittery pointers.
102
+ */ }
103
+ .number-style input {
104
+ margin: 0 5px;
105
+ font-family: Consolas, Monaco, monospace;
106
+ text-align: center;
107
+ width: 4em; }
108
+ .number-style > span {
109
+ cursor: pointer; }
110
+ .number-style > span.number-minus, .number-style > span.number-plus {
111
+ height: 24px;
112
+ width: 24px;
113
+ display: inline-block;
114
+ text-align: center;
115
+ vertical-align: top;
116
+ border-radius: 3px;
117
+ background: #0085ba;
118
+ border-width: 1px;
119
+ border-style: solid;
120
+ border-color: #0073aa #006799 #006799;
121
+ -webkit-box-shadow: 0 1px 0 #006799;
122
+ box-shadow: 0 1px 0 #006799;
123
+ text-shadow: 0 -1px 1px #006799, 1px 0 1px #006799, 0 1px 1px #006799, -1px 0 1px #006799;
124
+ color: #FFF; }
125
+ .number-style > span.number-minus:hover, .number-style > span.number-plus:hover {
126
+ background: #008ec2; }
127
+ .number-style > span.number-minus:active, .number-style > span.number-plus:active {
128
+ background: #0073aa;
129
+ border-color: #006799;
130
+ -webkit-box-shadow: inset 0 2px 0 #006799;
131
+ box-shadow: inset 0 2px 0 #006799;
132
+ -webkit-transform: translateY(1px);
133
+ -ms-transform: translateY(1px);
134
+ transform: translateY(1px);
135
+ outline: none; }
136
+ .number-style > span.number-minus.disabled, .number-style > span.number-plus.disabled {
137
+ background: #AAA;
138
+ border-color: #999 #777 #777;
139
+ -webkit-box-shadow: 0 1px 0 #777;
140
+ box-shadow: 0 1px 0 #777;
141
+ text-shadow: 0 -1px 1px #777, 1px 0 1px #777, 0 1px 1px #777, -1px 0 1px #777; }
142
+ .number-style > span.number-minus::after, .number-style > span.number-plus::after {
143
+ font-family: dashicons;
144
+ font-size: 24px;
145
+ line-height: 24px;
146
+ height: 24px;
147
+ width: 24px;
148
+ display: inline-block;
149
+ color: #FFF;
150
+ text-align: center;
151
+ position: relative;
152
+ left: -1px; }
153
+ .number-style > span.number-minus::after {
154
+ content: "\f140"; }
155
+ .number-style > span.number-plus::after {
156
+ content: "\f142"; }
157
+ .number-style input[type='number'] {
158
+ -moz-appearance: textfield; }
159
+ .number-style input::-webkit-outer-spin-button,
160
+ .number-style input::-webkit-inner-spin-button {
161
+ -webkit-appearance: none; }
162
+ .number-style .number-minus,
163
+ .number-style .number-plus,
164
+ .number-style .number-minus::after,
165
+ .number-style .number-plus::after {
166
+ -webkit-touch-callout: none;
167
+ /* iOS Safari */
168
+ -webkit-user-select: none;
169
+ /* Safari */
170
+ -khtml-user-select: none;
171
+ /* Konqueror HTML */
172
+ -moz-user-select: none;
173
+ /* Firefox */
174
+ -ms-user-select: none;
175
+ /* Internet Explorer/Edge */
176
+ user-select: none;
177
+ /* Non-prefixed version, currently
178
+ supported by Chrome and Opera */ }
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/css/admin.css CHANGED
@@ -324,7 +324,7 @@ div.radio:hover {
324
  }
325
 
326
  .submit-buttons input.button {
327
- margin-right: 5px;
328
  }
329
 
330
  .custom-input {
@@ -777,4 +777,23 @@ ul.standard {
777
 
778
  .form-table p.error {
779
  margin: 0.5em 0;
780
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
324
  }
325
 
326
  .submit-buttons input.button {
327
+ margin-right: 10px;
328
  }
329
 
330
  .custom-input {
777
 
778
  .form-table p.error {
779
  margin: 0.5em 0;
780
+ }
781
+
782
+ /* shortcodes page */
783
+ .wpmtst.shortcodes.has-stars table {
784
+ margin-bottom: 1em;
785
+ }
786
+ .wpmtst.shortcodes.has-stars td:nth-child(2) {
787
+ width: 70%;
788
+ /*white-space: nowrap;*/
789
+ }
790
+ .wpmtst.shortcodes td {
791
+ padding: 10px;
792
+ }
793
+ .wpmtst.shortcodes tr.important td {
794
+ border: 1px solid #DDD;
795
+ }
796
+ .wpmtst.shortcodes tr:hover,
797
+ .wpmtst.shortcodes tr:hover + tr {
798
+ background: #FFF;
799
+ }
admin/css/views.css CHANGED
@@ -952,4 +952,13 @@ table.wpmtst-help-tab {
952
  right: 0;
953
  background: rgba(255, 255, 255, 0.7); }
954
 
955
- /*# sourceMappingURL=views.css.map */
 
 
 
 
 
 
 
 
 
952
  right: 0;
953
  background: rgba(255, 255, 255, 0.7); }
954
 
955
+ .form-table td p.description.normal {
956
+ font-style: normal; }
957
+
958
+ ul.description.normal {
959
+ margin-top: 0;
960
+ font-style: normal; }
961
+
962
+ ul.description li {
963
+ margin-bottom: 0;
964
+ line-height: 1.5; }
admin/js/admin-compat.js CHANGED
@@ -39,6 +39,7 @@
39
  }
40
 
41
  // Update available options --- not currently used
 
42
  function matchMethodSetting () {
43
  if ($('#prerender-current').is(':checked')) {
44
  saveCurrentSettings()
@@ -59,6 +60,7 @@
59
  }
60
  }
61
  }
 
62
 
63
  // UI
64
  function highlightRadioLabel () {
@@ -101,12 +103,25 @@
101
  })
102
 
103
  // Listen for presets
104
- $('#set-scenario-1').click(function(e) {
105
  $(this).blur()
106
  setScenario1()
107
  e.preventDefault()
108
  })
109
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  // Start
111
  saveCurrentSettings()
112
  updateDisplay()
39
  }
40
 
41
  // Update available options --- not currently used
42
+ /*
43
  function matchMethodSetting () {
44
  if ($('#prerender-current').is(':checked')) {
45
  saveCurrentSettings()
60
  }
61
  }
62
  }
63
+ */
64
 
65
  // UI
66
  function highlightRadioLabel () {
103
  })
104
 
105
  // Listen for presets
106
+ $('#set-scenario-1').on('click', function(e) {
107
  $(this).blur()
108
  setScenario1()
109
  e.preventDefault()
110
  })
111
 
112
+ // Listen for [Add Row]
113
+ $('#add-pair').on('click', function (e) {
114
+ var $this = $(this);
115
+ var key = $this.closest('.lazyload-pairs').find('.pair').length;
116
+ var data = {
117
+ 'action': 'wpmtst_add_lazyload_pair',
118
+ 'key': key,
119
+ };
120
+ $.get(ajaxurl, data, function (response) {
121
+ $this.parent().before(response.data).prev().find('input').first().focus();
122
+ });
123
+ });
124
+
125
  // Start
126
  saveCurrentSettings()
127
  updateDisplay()
admin/menu/class-strong-testimonials-menu-shortcodes.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Strong_Testimonials_Menu_Shortcodes
4
+ */
5
+ class Strong_Testimonials_Menu_Shortcodes {
6
+
7
+ /**
8
+ * Strong_Testimonials_Menu_Shortcodes constructor.
9
+ */
10
+ public function __construct() {}
11
+
12
+ /**
13
+ * Initialize.
14
+ */
15
+ public static function init() {
16
+ self::add_actions();
17
+ }
18
+
19
+ /**
20
+ * Add actions and filters.
21
+ */
22
+ public static function add_actions() {
23
+ add_filter( 'wpmtst_submenu_pages', array( __CLASS__, 'add_submenu' ) );
24
+ }
25
+
26
+ /**
27
+ * Add submenu page.
28
+ *
29
+ * @param $pages
30
+ *
31
+ * @return mixed
32
+ */
33
+ public static function add_submenu( $pages ) {
34
+ $pages[40] = self::get_submenu();
35
+ return $pages;
36
+ }
37
+
38
+ /**
39
+ * Return submenu page parameters.
40
+ *
41
+ * @return array
42
+ */
43
+ public static function get_submenu() {
44
+ return array(
45
+ 'page_title' => apply_filters( 'wpmtst_shortcodes_page_title', __( 'Shortcodes', 'strong-testimonials' ) ),
46
+ 'menu_title' => apply_filters( 'wpmtst_shortcodes_menu_title', __( 'Shortcodes', 'strong-testimonials' ) ),
47
+ 'capability' => 'strong_testimonials_options',
48
+ 'menu_slug' => 'testimonial-shortcodes',
49
+ 'function' => array( 'Strong_Testimonials_Page_Shortcodes', 'render_page' ),
50
+ );
51
+ }
52
+
53
+ }
54
+
55
+ Strong_Testimonials_Menu_Shortcodes::init();
admin/partials/views/view-shortcode.php CHANGED
@@ -2,7 +2,7 @@
2
  // avoiding the tab character before the shortcode for better copy-n-paste
3
  if ( 'edit' == $action ) {
4
  $shortcode = '<div class="saved">';
5
- $shortcode .= '<input id="view-shortcode" type="text" value="[testimonial_view id=' . $view_id . ']" readonly />';
6
  $shortcode .= '<input id="copy-shortcode" class="button small" type="button" value="' . __( 'copy to clipboard', 'strong-testimonials' ) . '" data-copytarget="#view-shortcode" />';
7
  $shortcode .= '<span id="copy-message">copied</span>';
8
  $shortcode .= '</div>';
2
  // avoiding the tab character before the shortcode for better copy-n-paste
3
  if ( 'edit' == $action ) {
4
  $shortcode = '<div class="saved">';
5
+ $shortcode .= '<input id="view-shortcode" type="text" value="[testimonial_view id=&quot;' . $view_id . '&quot;]" readonly />';
6
  $shortcode .= '<input id="copy-shortcode" class="button small" type="button" value="' . __( 'copy to clipboard', 'strong-testimonials' ) . '" data-copytarget="#view-shortcode" />';
7
  $shortcode .= '<span id="copy-message">copied</span>';
8
  $shortcode .= '</div>';
admin/scss/admin-compat.scss CHANGED
@@ -10,6 +10,10 @@ div.row {
10
 
11
  > div {
12
  display: table-cell;
 
 
 
 
13
  }
14
 
15
  &:not(:last-child) > div {
@@ -108,12 +112,12 @@ div.row {
108
  > div {
109
 
110
  &:first-child {
111
- width: 180px;
112
  }
113
 
114
  &.radio-sub {
115
  label {
116
  text-indent: 24px;
 
117
  }
118
  }
119
  }
@@ -121,6 +125,7 @@ div.row {
121
  p {
122
  &.about {
123
  display: inline-block;
 
124
 
125
  &.adjacent {
126
  margin-left: 0.5em;
@@ -138,4 +143,24 @@ div.row {
138
  }
139
  }
140
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  @import "number-spinner.scss";
10
 
11
  > div {
12
  display: table-cell;
13
+
14
+ &:first-child {
15
+ width: 200px;
16
+ }
17
  }
18
 
19
  &:not(:last-child) > div {
112
  > div {
113
 
114
  &:first-child {
 
115
  }
116
 
117
  &.radio-sub {
118
  label {
119
  text-indent: 24px;
120
+ width: 200px;
121
  }
122
  }
123
  }
125
  p {
126
  &.about {
127
  display: inline-block;
128
+ vertical-align: middle;
129
 
130
  &.adjacent {
131
  margin-left: 0.5em;
143
  }
144
  }
145
 
146
+ /**
147
+ * Lazy load class name pairs
148
+ */
149
+ .pair-actions {
150
+ margin-top: 10px;
151
+ }
152
+
153
+ .pair-sep {
154
+ margin-right: 1em;
155
+ }
156
+
157
+ @media only screen and (max-width: 1024px) {
158
+ .lazyload-pairs {
159
+ .pair {
160
+ border: 1px solid #DDD;
161
+ padding: 5px 10px;
162
+ }
163
+ }
164
+ }
165
+
166
  @import "number-spinner.scss";
admin/scss/views.scss CHANGED
@@ -31,3 +31,16 @@ $grayedout: #888;
31
  @import "_partials/custom-fields";
32
  @import "_partials/help-tab";
33
  @import "_partials/sticky-views";
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  @import "_partials/custom-fields";
32
  @import "_partials/help-tab";
33
  @import "_partials/sticky-views";
34
+
35
+ // TODO Find a home for these in partials.
36
+ .form-table td p.description.normal {
37
+ font-style: normal;
38
+ }
39
+ ul.description.normal {
40
+ margin-top: 0;
41
+ font-style: normal;
42
+ }
43
+ ul.description li {
44
+ margin-bottom: 0;
45
+ line-height: 1.5;
46
+ }
admin/settings/class-strong-testimonials-settings-compat.php CHANGED
@@ -30,6 +30,7 @@ class Strong_Testimonials_Settings_Compat {
30
  add_action( 'wpmtst_register_settings', array( $this, 'register_settings' ) );
31
  add_action( 'wpmtst_settings_tabs', array( $this, 'register_tab' ), 3, 2 );
32
  add_filter( 'wpmtst_settings_callbacks', array( $this, 'register_settings_page' ) );
 
33
  }
34
 
35
  /**
@@ -70,18 +71,22 @@ class Strong_Testimonials_Settings_Compat {
70
  * Sanitize settings.
71
  *
72
  * @param $input
73
- *
 
 
74
  * @return array
75
  */
76
  public function sanitize_options( $input ) {
77
- $input['page_loading'] = sanitize_text_field( $input['page_loading'] );
 
78
  if ( 'general' == $input['page_loading'] ) {
79
  $input['prerender'] = 'all';
80
  $input['ajax']['method'] = 'universal';
81
- } else {
82
  $input['prerender'] = sanitize_text_field( $input['prerender'] );
83
  $input['ajax']['method'] = sanitize_text_field( $input['ajax']['method'] );
84
  }
 
85
  $input['ajax']['universal_timer'] = floatval( sanitize_text_field( $input['ajax']['universal_timer'] ) );
86
  $input['ajax']['observer_timer'] = floatval( sanitize_text_field( $input['ajax']['observer_timer'] ) );
87
  $input['ajax']['container_id'] = sanitize_text_field( $input['ajax']['container_id'] );
@@ -89,6 +94,19 @@ class Strong_Testimonials_Settings_Compat {
89
  $input['ajax']['event'] = sanitize_text_field( $input['ajax']['event'] );
90
  $input['ajax']['script'] = sanitize_text_field( $input['ajax']['script'] );
91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  return $input;
93
  }
94
 
@@ -102,12 +120,17 @@ class Strong_Testimonials_Settings_Compat {
102
 
103
  /**
104
  * Compatibility settings
 
 
 
105
  */
106
  public function settings_top() {
107
  $this->settings_intro();
108
  $this->settings_page_loading();
109
  $this->settings_prerender();
110
  $this->settings_monitor();
 
 
111
  }
112
 
113
  /**
@@ -115,47 +138,76 @@ class Strong_Testimonials_Settings_Compat {
115
  */
116
  public function settings_intro() {
117
  ?>
118
- <h2><?php _e( 'Common Scenarios' ); ?></h2>
119
- <table class="form-table" cellpadding="0" cellspacing="0">
120
- <tr valign="top">
121
- <td>
122
-
123
- <div class="scenarios">
124
- <div class="row header">
125
- <div>
126
- <?php _e( 'Views Not Working', 'strong-testimonials' ); ?>
127
- </div>
128
- <div>
129
  <?php _e( 'Possible Cause', 'strong-testimonials' ); ?>
130
- </div>
131
- <div>
132
- <?php _e( 'Solution', 'strong-testimonials' ); ?>
133
- </div>
134
- </div>
135
-
136
- <div class="row">
137
- <div>
138
- <p><?php _e( 'A testimonial view does not look right the first time you view the page.', 'strong-testimonials' ); ?></p>
139
- <p><?php _e( 'For example, it does not seem to have any style, the slideshow has not started, or the pagination is missing.', 'strong-testimonials' ); ?></p>
140
- <p><?php _e( 'When you refresh the page, the view does appear correctly.', 'strong-testimonials' ); ?></p>
141
- </div>
142
- <div>
143
- <p><?php _e( 'Your site is using <strong>Ajax page loading</strong> &ndash; also known as page animations, transition effects or Pjax (pushState Ajax) &ndash; provided by your theme or another plugin.', 'strong-testimonials' ); ?></p>
144
- <p><?php _e( 'Instead of loading the entire page, this technique fetches only the new content.', 'strong-testimonials' ); ?></p>
145
- </div>
146
- <div>
147
- <p><strong><?php _e( 'Ajax Page Loading', 'strong-testimonials' ); ?>
148
- :</strong> <?php _e( 'General', 'strong-testimonials' ); ?></p>
149
- <p><a href="#"
150
- id="set-scenario-1"><?php _ex( 'Set this now', 'link text on Settings > Compatibility tab', 'strong-testimonials' ); ?></a>
151
- </p>
152
- </div>
153
- </div>
154
- </div>
155
-
156
- </td>
157
- </tr>
158
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  <?php
160
  }
161
 
@@ -164,28 +216,26 @@ class Strong_Testimonials_Settings_Compat {
164
  */
165
  public function settings_page_loading() {
166
  ?>
167
- <h2><?php _e( 'Ajax Page Loading' ); ?></h2>
168
-
169
- <table class="form-table" cellpadding="0" cellspacing="0">
170
- <tr valign="top">
171
- <th scope="row">
172
- <?php _e( 'Type', 'strong-testimonials' ); ?>
173
- </th>
174
- <td>
175
- <div class="row header">
176
- <p>
177
  <?php _e( 'This does not perform Ajax page loading.', 'strong-testimonials' ); ?>
178
  <?php _e( 'It provides compatibility with themes and plugins that use Ajax to load pages, also known as page animation or transition effects.', 'strong-testimonials' ); ?>
179
- </p>
180
- </div>
181
- <fieldset data-radio-group="prerender">
182
  <?php $this->settings_page_loading_none(); ?>
183
  <?php $this->settings_page_loading_general(); ?>
184
  <?php $this->settings_page_loading_advanced(); ?>
185
- </fieldset>
186
- </td>
187
- </tr>
188
- </table>
189
  <?php
190
  }
191
 
@@ -193,21 +243,26 @@ class Strong_Testimonials_Settings_Compat {
193
  * None (default)
194
  */
195
  public function settings_page_loading_none() {
 
 
196
  ?>
197
- <div class="row">
198
- <div>
199
- <label for="page-loading-none">
200
- <input type="radio" id="page-loading-none" name="wpmtst_compat_options[page_loading]"
201
- value="" <?php checked( $this->options['page_loading'], '' ); ?>/>
 
 
 
202
  <?php _e( 'None', 'strong-testimonials' ); ?>
203
- <em><?php _e( '(default)', 'strong-testimonials' ); ?></em>
204
- </label>
205
- </div>
206
- <div>
207
- <p class="about"><?php _e( 'No compatibility needed.', 'strong-testimonials' ); ?></p>
208
- <p class="about"><?php _e( 'This works well for most themes.', 'strong-testimonials' ); ?></p>
209
- </div>
210
- </div>
211
  <?php
212
  }
213
 
@@ -215,20 +270,25 @@ class Strong_Testimonials_Settings_Compat {
215
  * General
216
  */
217
  public function settings_page_loading_general() {
 
 
218
  ?>
219
- <div class="row">
220
- <div>
221
- <label for="page-loading-general">
222
- <input type="radio" id="page-loading-general" name="wpmtst_compat_options[page_loading]"
223
- value="general" <?php checked( $this->options['page_loading'], 'general' ); ?>/>
 
 
 
224
  <?php _e( 'General', 'strong-testimonials' ); ?>
225
- </label>
226
- </div>
227
- <div>
228
- <p class="about"><?php _e( 'Be ready to render any view at any time.', 'strong-testimonials' ); ?></p>
229
- <p class="about"><?php _e( 'This works well with common Ajax methods.', 'strong-testimonials' ); ?></p>
230
- </div>
231
- </div>
232
  <?php
233
  }
234
 
@@ -236,20 +296,25 @@ class Strong_Testimonials_Settings_Compat {
236
  * Advanced
237
  */
238
  public function settings_page_loading_advanced() {
 
 
239
  ?>
240
- <div class="row">
241
- <div>
242
- <label for="page-loading-advanced">
243
- <input type="radio" id="page-loading-advanced" name="wpmtst_compat_options[page_loading]"
244
- value="advanced" <?php checked( $this->options['page_loading'], 'advanced' ); ?>
245
- data-group="advanced"/>
 
 
 
246
  <?php _e( 'Advanced', 'strong-testimonials' ); ?>
247
- </label>
248
- </div>
249
- <div>
250
- <p class="about"><?php _e( 'For specific configurations.', 'strong-testimonials' ); ?></p>
251
- </div>
252
- </div>
253
  <?php
254
  }
255
 
@@ -258,25 +323,25 @@ class Strong_Testimonials_Settings_Compat {
258
  */
259
  public function settings_prerender() {
260
  ?>
261
- <table class="form-table" cellpadding="0" cellspacing="0" data-sub="advanced">
262
- <tr valign="top">
263
- <th scope="row">
264
  <?php _e( 'Prerender', 'strong-testimonials' ); ?>
265
- </th>
266
- <td>
267
- <div class="row header">
268
- <p><?php _e( 'Load stylesheets and populate script variables up front.', 'strong-testimonials' ); ?>
269
- <a class="open-help-tab" href="#tab-panel-wpmtst-help-prerender"><?php _e( 'Help' ); ?></a>
270
- </p>
271
- </div>
272
- <fieldset data-radio-group="prerender">
273
  <?php $this->settings_prerender_current(); ?>
274
  <?php $this->settings_prerender_all(); ?>
275
  <?php $this->settings_prerender_none(); ?>
276
- </fieldset>
277
- </td>
278
- </tr>
279
- </table>
280
  <?php
281
  }
282
 
@@ -284,21 +349,26 @@ class Strong_Testimonials_Settings_Compat {
284
  * Current (default)
285
  */
286
  public function settings_prerender_current() {
 
 
287
  ?>
288
- <div class="row">
289
- <div>
290
- <label for="prerender-current">
291
- <input type="radio" id="prerender-current" name="wpmtst_compat_options[prerender]"
292
- value="current" <?php checked( $this->options['prerender'], 'current' ); ?>/>
 
 
 
293
  <?php _e( 'Current page', 'strong-testimonials' ); ?>
294
- <em><?php _e( '(default)', 'strong-testimonials' ); ?></em>
295
- </label>
296
- </div>
297
- <div>
298
- <p class="about"><?php _e( 'For the current page only.', 'strong-testimonials' ); ?></p>
299
- <p class="about"><?php _e( 'This works well for most themes.', 'strong-testimonials' ); ?></p>
300
- </div>
301
- </div>
302
  <?php
303
  }
304
 
@@ -306,20 +376,25 @@ class Strong_Testimonials_Settings_Compat {
306
  * All
307
  */
308
  public function settings_prerender_all() {
 
 
309
  ?>
310
- <div class="row">
311
- <div>
312
- <label for="prerender-all">
313
- <input type="radio" id="prerender-all" name="wpmtst_compat_options[prerender]"
314
- value="all" <?php checked( $this->options['prerender'], 'all' ); ?>/>
 
 
 
315
  <?php _e( 'All views', 'strong-testimonials' ); ?>
316
- </label>
317
- </div>
318
- <div>
319
- <p class="about"><?php _e( 'For all views. Required for Ajax page loading.', 'strong-testimonials' ); ?></p>
320
- <p class="about"><?php _e( 'Then select an option for <strong>Monitor</strong> below.', 'strong-testimonials' ); ?></p>
321
- </div>
322
- </div>
323
  <?php
324
  }
325
 
@@ -327,19 +402,24 @@ class Strong_Testimonials_Settings_Compat {
327
  * None
328
  */
329
  public function settings_prerender_none() {
 
 
330
  ?>
331
- <div class="row">
332
- <div>
333
- <label for="prerender-none">
334
- <input type="radio" id="prerender-none" name="wpmtst_compat_options[prerender]"
335
- value="none" <?php checked( $this->options['prerender'], 'none' ); ?>/>
 
 
 
336
  <?php _e( 'None', 'strong-testimonials' ); ?>
337
- </label>
338
- </div>
339
- <div>
340
- <p class="about"><?php _e( 'When the shortcode is rendered. May result in a flash of unstyled content.', 'strong-testimonials' ); ?></p>
341
- </div>
342
- </div>
343
  <?php
344
  }
345
 
@@ -348,25 +428,25 @@ class Strong_Testimonials_Settings_Compat {
348
  */
349
  public function settings_monitor() {
350
  ?>
351
- <table class="form-table" cellpadding="0" cellspacing="0" data-sub="advanced">
352
- <tr valign="top">
353
- <th scope="row">
354
  <?php _e( 'Monitor', 'strong-testimonials' ); ?>
355
- </th>
356
- <td>
357
- <div class="row header">
358
- <p><?php _e( 'Initialize slideshows, pagination and form validation as pages change.', 'strong-testimonials' ); ?></p>
359
- </div>
360
- <fieldset data-radio-group="method">
361
  <?php $this->settings_monitor_none(); ?>
362
  <?php $this->settings_monitor_universal(); ?>
363
  <?php $this->settings_monitor_observer(); ?>
364
  <?php $this->settings_monitor_event(); ?>
365
  <?php $this->settings_monitor_script(); ?>
366
- </fieldset>
367
- </td>
368
- </tr>
369
- </table>
370
  <?php
371
  }
372
 
@@ -374,20 +454,25 @@ class Strong_Testimonials_Settings_Compat {
374
  * None
375
  */
376
  public function settings_monitor_none() {
 
 
377
  ?>
378
- <div class="row">
379
- <div>
380
- <label for="method-none">
381
- <input type="radio" id="method-none" name="wpmtst_compat_options[ajax][method]" value=""
382
- <?php checked( $this->options['ajax']['method'], '' ); ?> />
 
 
 
383
  <?php _e( 'None', 'strong-testimonials' ); ?>
384
- <em><?php _e( '(default)', 'strong-testimonials' ); ?></em>
385
- </label>
386
- </div>
387
- <div>
388
- <p class="about"><?php _e( 'No compatibility needed.', 'strong-testimonials' ); ?></p>
389
- </div>
390
- </div>
391
  <?php
392
  }
393
 
@@ -395,37 +480,42 @@ class Strong_Testimonials_Settings_Compat {
395
  * Universal (timer)
396
  */
397
  public function settings_monitor_universal() {
 
 
398
  ?>
399
- <div class="row">
400
- <div>
401
- <label for="method-universal">
402
- <input type="radio"
403
- id="method-universal"
404
- name="wpmtst_compat_options[ajax][method]"
405
- value="universal"
406
- <?php checked( $this->options['ajax']['method'], 'universal' ); ?>
407
- data-group="universal"/>
408
  <?php _e( 'Universal', 'strong-testimonials' ); ?>
409
- </label>
410
- </div>
411
- <div>
412
- <p class="about"><?php _e( 'Watch for page changes on a timer.', 'strong-testimonials' ); ?></p>
413
- </div>
414
- </div>
415
-
416
- <div class="row" data-sub="universal">
417
- <div class="radio-sub">
418
- <label for="universal-timer">
419
  <?php _ex( 'Check every', 'timer setting', 'strong-testimonials' ); ?>
420
- </label>
421
- </div>
422
- <div>
423
- <input type="number" id="universal-timer" name="wpmtst_compat_options[ajax][universal_timer]"
424
- min=".1" max="5" step=".1" size="3"
425
- value="<?php echo $this->options['ajax']['universal_timer']; ?>"/>
 
 
 
426
  <?php _ex( 'seconds', 'timer setting', 'strong-testimonials' ); ?>
427
- </div>
428
- </div>
429
  <?php
430
  }
431
 
@@ -433,81 +523,92 @@ class Strong_Testimonials_Settings_Compat {
433
  * Observer
434
  */
435
  public function settings_monitor_observer() {
 
 
436
  ?>
437
- <div class="row">
438
- <div>
439
- <label for="method-observer">
440
- <input type="radio" id="method-observer" name="wpmtst_compat_options[ajax][method]" value="observer"
441
- <?php checked( $this->options['ajax']['method'], 'observer' ); ?>
442
- data-group="observer"/>
 
 
 
443
  <?php _e( 'Observer', 'strong-testimonials' ); ?>
444
- </label>
445
- </div>
446
- <div>
447
- <p class="about"><?php _e( 'React to changes in specific page elements.', 'strong-testimonials' ); ?></p>
448
- <p class="description"><?php _e( 'For advanced users.', 'strong-testimonials' ); ?></p>
449
- </div>
450
- </div>
451
 
452
  <?php
453
  /*
454
  * Timer
455
  */
456
  ?>
457
- <div class="row" data-sub="observer">
458
- <div class="radio-sub">
459
- <label for="observer-timer">
460
  <?php _ex( 'Check once after', 'timer setting', 'strong-testimonials' ); ?>
461
- </label>
462
- </div>
463
- <div>
464
- <input type="number" id="observer-timer"
465
- name="wpmtst_compat_options[ajax][observer_timer]"
466
- min=".1" max="5" step=".1" size="3"
467
- value="<?php echo $this->options['ajax']['observer_timer']; ?>"/>
 
 
468
  <?php _ex( 'seconds', 'timer setting', 'strong-testimonials' ); ?>
469
- </div>
470
- </div>
471
 
472
  <?php
473
  /*
474
  * Container element ID
475
  */
476
  ?>
477
- <div class="row" data-sub="observer">
478
- <div class="radio-sub">
479
- <label for="container-id">
480
  <?php _e( 'Container ID', 'strong-testimonials' ); ?>
481
- </label>
482
- </div>
483
- <div>
484
- <span class="code input-before">#</span>
485
- <input type="text" id="container-id" class="code element"
486
- name="wpmtst_compat_options[ajax][container_id]"
487
- value="<?php echo $this->options['ajax']['container_id']; ?>"/>
488
- <p class="about adjacent"><?php _e( 'the element to observe', 'strong-testimonials' ); ?></p>
489
- </div>
490
- </div>
 
 
491
 
492
  <?php
493
  /*
494
  * Added node ID
495
  */
496
  ?>
497
- <div class="row" data-sub="observer">
498
- <div class="radio-sub">
499
- <label for="addednode-id">
500
  <?php _e( 'Added node ID', 'strong-testimonials' ); ?>
501
- </label>
502
- </div>
503
- <div>
504
- <span class="code input-before">#</span>
505
- <input type="text" id="addednode-id" class="code element"
506
- name="wpmtst_compat_options[ajax][addednode_id]"
507
- value="<?php echo $this->options['ajax']['addednode_id']; ?>"/>
508
- <p class="about adjacent"><?php _e( 'the element being added', 'strong-testimonials' ); ?></p>
509
- </div>
510
- </div>
 
 
511
  <?php
512
  }
513
 
@@ -515,34 +616,41 @@ class Strong_Testimonials_Settings_Compat {
515
  * Custom event
516
  */
517
  public function settings_monitor_event() {
518
- ?>
519
- <div class="row">
520
- <div>
521
- <label for="method-event">
522
- <input type="radio" id="method-event" name="wpmtst_compat_options[ajax][method]" value="event"
523
- <?php checked( $this->options['ajax']['method'], 'event' ); ?>
524
- data-group="event"/>
 
 
 
 
525
  <?php _e( 'Custom event', 'strong-testimonials' ); ?>
526
- </label>
527
- </div>
528
- <div>
529
- <p class="about"><?php _e( 'Listen for specific events.', 'strong-testimonials' ); ?></p>
530
- <p class="description"><?php _e( 'For advanced users.', 'strong-testimonials' ); ?></p>
531
- </div>
532
- </div>
533
-
534
- <div class="row" data-sub="event">
535
- <div class="radio-sub">
536
- <label for="event-name">
537
  <?php _e( 'Event name', 'strong-testimonials' ); ?>
538
- </label>
539
- </div>
540
- <div>
541
- <input type="text" id="event-name" class="code"
542
- name="wpmtst_compat_options[ajax][event]"
543
- value="<?php echo $this->options['ajax']['event']; ?>" size="30"/>
544
- </div>
545
- </div>
 
 
 
546
  <?php
547
  }
548
 
@@ -550,41 +658,244 @@ class Strong_Testimonials_Settings_Compat {
550
  * Specific script
551
  */
552
  public function settings_monitor_script() {
 
 
553
  ?>
554
- <div class="row">
555
- <div>
556
- <label for="method-script">
557
- <input type="radio" id="method-script" name="wpmtst_compat_options[ajax][method]" value="script"
558
- <?php checked( $this->options['ajax']['method'], 'script' ); ?>
559
- data-group="script"/>
 
 
 
560
  <?php _e( 'Specific script', 'strong-testimonials' ); ?>
561
- </label>
562
- </div>
563
- <div>
564
- <p class="about"><?php _e( 'Register a callback for a specific Ajax script.', 'strong-testimonials' ); ?></p>
565
- <p class="description"><?php _e( 'For advanced users.', 'strong-testimonials' ); ?></p>
566
- </div>
567
- </div>
568
-
569
- <div class="row" data-sub="script">
570
- <div class="radio-sub">
571
- <label for="script-name">
572
  <?php _e( 'Script name', 'strong-testimonials' ); ?>
573
- </label>
574
- </div>
575
- <div>
576
- <select id="script-name" name="wpmtst_compat_options[ajax][script]">
577
- <option value="" <?php selected( $this->options['ajax']['script'], '' ); ?>>
578
  <?php _e( '&mdash; Select &mdash;' ); ?>
579
- </option>
580
- <option value="barba" <?php selected( $this->options['ajax']['script'], 'barba' ); ?>>Barba.js
581
- </option>
582
- </select>
583
- </div>
584
- </div>