Strong Testimonials - Version 2.31.2

Version Description

  • May 18, 2018 =
  • Fix bug in average rating half-star.
Download this release

Release Info

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

Code changes from version 2.31.1 to 2.31.2

admin/class-strong-testimonials-page-shortcodes.php CHANGED
@@ -18,6 +18,8 @@ class Strong_Testimonials_Page_Shortcodes {
18
  */
19
  public static function render_page() {
20
 
 
 
21
  $tags = array(
22
  'a' => array(
23
  'href' => array(),
@@ -42,7 +44,7 @@ class Strong_Testimonials_Page_Shortcodes {
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>
@@ -75,208 +77,257 @@ class Strong_Testimonials_Page_Shortcodes {
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>
18
  */
19
  public static function render_page() {
20
 
21
+ $stars = '<span class="strong-rating"><span class="star0 star"></span><span class="star"></span><span class="star"></span><span class="star"></span><span class="star"></span><span class="star current half"></span></span>';
22
+
23
  $tags = array(
24
  'a' => array(
25
  'href' => array(),
44
 
45
  <p><?php printf( __( 'Use %s to display the number of testimonials.', 'strong-testimonials' ), '<code>&#91;testimonial_count&#93;</code>' ); ?></p>
46
 
47
+ <table class="form-table shortcodes" cellpadding="0" cellspacing="0">
48
  <tr>
49
  <td>
50
  <p><?php _e( 'Default', 'strong-testimonials' ); ?></p>
77
  <?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>' ); ?>
78
  </p>
79
 
80
+ <table class="form-table shortcodes average" cellpadding="0" cellspacing="0">
81
  <tr>
82
+ <td>
83
  <p><?php _e( 'Default', 'strong-testimonials' ); ?></p>
84
  <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>
85
  </td>
86
+ <td class="has-inner">
87
+ <table class="inner" cellpadding="0" cellspacing="0">
88
+ <tr>
89
+ <td class="shortcode">&#91;testimonial_average_rating /&#93;</td>
90
+ </tr>
91
+ <tr>
92
+ <td>
93
+ <div class="strong-rating-wrapper average">
94
+ <span class="strong-rating-title">Average Rating:</span>
95
+ <?php echo $stars; ?>
96
+ <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span>
97
+ </div>
98
+ </td>
99
+ </tr>
100
+ </table>
101
  </td>
102
  </tr>
103
  </table>
104
 
105
+ <table class="form-table shortcodes average" cellpadding="0" cellspacing="0">
106
  <tr>
107
+ <td>
108
  <p><?php _e( 'Customize using content tags.', 'strong-testimonials' ); ?></p>
109
  <p><?php _e( 'Default:', 'strong-testimonials' ); ?></p>
110
  <p><code>{title}</code><br><code>{stars}</code><br><code>{summary}</code></p>
111
  </td>
112
+ <td class="has-inner">
113
+ <table class="inner" cellpadding="0" cellspacing="0">
114
+ <tr>
115
+ <td class="shortcode">&#91;testimonial_average_rating&#93;{title} {stars} {summary}&#91;/testimonial_average_rating&#93;</td>
116
+ </tr>
117
+ <tr>
118
+ <td>
119
+ <div class="strong-rating-wrapper average">
120
+ <span class="strong-rating-title">Average Rating:</span>
121
+ <?php echo $stars; ?>
122
+ <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span>
123
+ </div>
124
+ </td>
125
+ </tr>
126
+ </table>
127
  </td>
128
  </tr>
129
  </table>
130
 
131
+ <table class="form-table shortcodes average" cellpadding="0" cellspacing="0">
132
  <tr>
133
+ <td>
134
  <p><?php _e( 'Alternate content tags.', 'strong-testimonials' ); ?></p>
135
  <p><code>{title2}</code><br><code>{summary2}</code></p>
136
  </td>
137
+ <td class="has-inner">
138
+ <table class="inner" cellpadding="0" cellspacing="0">
139
+ <tr>
140
+ <td class="shortcode">&#91;testimonial_average_rating&#93;{title2} {stars} {summary2}&#91;/testimonial_average_rating&#93;</td>
141
+ </tr>
142
+ <tr>
143
+ <td>
144
+ <div class="strong-rating-wrapper average">
145
+ <span class="strong-rating-title">Average of 9 Ratings:</span>
146
+ <?php echo $stars; ?>
147
+ <span class="strong-rating-summary">4.3 stars</span>
148
+ </div>
149
+ </td>
150
+ <tr>
151
+ </tr>
152
+ </table>
153
  </tr>
154
  </table>
155
 
156
+ <table class="form-table shortcodes average">
157
  <tr>
158
+ <td>
159
  <p><?php _e( 'Insert tags into your custom content.', 'strong-testimonials' ); ?></p>
160
  <p class="description"><?php _e( '', 'strong-testimonials' ); ?></p>
161
  </td>
162
+ <td class="has-inner">
163
+ <table class="inner" cellpadding="0" cellspacing="0">
164
+ <tr>
165
+ <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>
166
+ </tr>
167
+ <tr>
168
+ <td>
169
+ <div class="strong-rating-wrapper average">
170
+ <?php echo $stars; ?>
171
+ Our average rating is <b><span class="strong-rating-summary">4.3 stars</span></b>
172
+ </div>
173
+ </td>
174
+ </tr>
175
+ </table>
176
  </td>
177
  </tr>
178
  </table>
179
 
180
+ <table class="form-table shortcodes average">
181
  <tr>
182
+ <td>
183
  <p><code>{stars}</code></p>
184
  </td>
185
+ <td class="has-inner">
186
+ <table class="inner" cellpadding="0" cellspacing="0">
187
+ <tr>
188
+ <td class="shortcode">&#91;testimonial_average_rating&#93;{stars}&#91;/testimonial_average_rating&#93;</td>
189
+ </tr>
190
+ <tr>
191
+ <td>
192
+ <div class="strong-rating-wrapper average">
193
+ <?php echo $stars; ?>
194
+ </div>
195
+ </td>
196
+ </tr>
197
+ </table>
198
  </td>
199
  </tr>
200
  </table>
201
 
202
+ <table class="form-table shortcodes average">
203
  <tr>
204
+ <td>
205
  <p><code>{average}</code></p>
206
  </td>
207
+ <td class="has-inner">
208
+ <table class="inner" cellpadding="0" cellspacing="0">
209
+ <tr>
210
+ <td class="shortcode">&#91;testimonial_average_rating&#93;{average}&#91;/testimonial_average_rating&#93;</td>
211
+ </tr>
212
+ <tr>
213
+ <td>
214
+ <div class="strong-rating-wrapper average"><span class="strong-rating-average">4.3</span></div>
215
+ </td>
216
+ </tr>
217
+ </table>
218
  </td>
219
  </tr>
220
  </table>
221
 
222
+ <table class="form-table shortcodes average">
223
  <tr>
224
+ <td>
225
  <p><code>{count}</code></p>
226
  </td>
227
+ <td class="has-inner">
228
+ <table class="inner" cellpadding="0" cellspacing="0">
229
+ <tr>
230
+ <td class="shortcode">&#91;testimonial_average_rating&#93;{count}&#91;/testimonial_average_rating&#93;</td>
231
+ </tr>
232
+ <tr>
233
+ <td>
234
+ <div class="strong-rating-wrapper average"><span class="strong-rating-count">9</span></div>
235
+ </td>
236
+ </tr>
237
+ </table>
238
  </td>
239
  </tr>
240
  </table>
241
 
242
+ <table class="form-table shortcodes average">
243
  <tr>
244
+ <td>
245
  <p><code>block</code></p>
246
  </td>
247
+ <td class="has-inner">
248
+ <table class="inner" cellpadding="0" cellspacing="0">
249
+ <tr>
250
+ <td class="shortcode">&#91;testimonial_average_rating block /&#93;</td>
251
+ </tr>
252
+ <tr>
253
+ <td>
254
+ <div class="strong-rating-wrapper average block"><span class="strong-rating-title">Average Rating:</span>
255
+ <?php echo $stars; ?>
256
+ <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span>
257
+ </div>
258
+ </td>
259
+ </tr>
260
+ </table>
261
  </td>
262
  </tr>
263
  </table>
264
 
265
+ <table class="form-table shortcodes average">
266
  <tr>
267
+ <td>
268
  <p><code>centered</code></p>
269
  </td>
270
+ <td class="has-inner">
271
+ <table class="inner" cellpadding="0" cellspacing="0">
272
+ <tr>
273
+ <td class="shortcode">&#91;testimonial_average_rating centered /&#93;</td>
274
+ </tr>
275
+ <tr>
276
+ <td>
277
+ <div class="strong-rating-wrapper average centered"><span class="strong-rating-title">Average Rating:</span>
278
+ <?php echo $stars; ?>
279
+ <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span>
280
+ </div>
281
+ </td>
282
+ </tr>
283
+ </table>
284
  </td>
285
  </tr>
286
  </table>
287
 
288
+ <table class="form-table shortcodes average">
289
  <tr>
290
+ <td>
291
  <p><code>block</code> and <code>centered</code></p>
292
  </td>
293
+ <td class="has-inner">
294
+ <table class="inner" cellpadding="0" cellspacing="0">
295
+ <tr>
296
+ <td class="shortcode">&#91;testimonial_average_rating block centered /&#93;</td>
297
+ </tr>
298
+ <tr>
299
+ <td>
300
+ <div class="strong-rating-wrapper average block centered"><span class="strong-rating-title">Average Rating:</span>
301
+ <?php echo $stars; ?>
302
+ <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span>
303
+ </div>
304
+ </td>
305
+ </tr>
306
+ </table>
307
  </td>
308
  </tr>
309
  </table>
310
 
311
+ <table class="form-table shortcodes average">
312
  <tr>
313
+ <td>
314
  <p><?php _e( 'The default container element is <code>div</code>. Select another element using <code>element</code>.', 'strong-testimonials' ); ?></p>
315
  </td>
316
+ <td class="has-inner">
317
+ <table class="inner" cellpadding="0" cellspacing="0">
318
+ <tr>
319
+ <td class="shortcode">&#91;testimonial_average_rating element="span" /&#93;</td>
320
+ </tr>
321
+ <tr>
322
+ <td>
323
+ <span class="strong-rating-wrapper average">
324
+ <span class="strong-rating-title">Average Rating:</span>
325
+ <?php echo $stars; ?>
326
+ <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span>
327
+ </span>
328
+ </td>
329
+ </tr>
330
+ </table>
331
  </td>
332
  </tr>
333
  </table>
admin/css/admin.css CHANGED
@@ -780,6 +780,9 @@ ul.standard {
780
  }
781
 
782
  /* shortcodes page */
 
 
 
783
  .wpmtst.shortcodes.has-stars table {
784
  margin-bottom: 1em;
785
  }
@@ -793,7 +796,24 @@ ul.standard {
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
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
780
  }
781
 
782
  /* shortcodes page */
783
+ .wpmtst.shortcode {
784
+ vertical-align: middle;
785
+ }
786
  .wpmtst.shortcodes.has-stars table {
787
  margin-bottom: 1em;
788
  }
796
  .wpmtst.shortcodes tr.important td {
797
  border: 1px solid #DDD;
798
  }
799
+ .wpmtst.shortcodes tr:hover {
 
800
  background: #FFF;
801
  }
802
+
803
+ /* inner table */
804
+ .wpmtst.shortcodes td.has-inner {
805
+ padding: 0;
806
+ }
807
+ .wpmtst.shortcodes table.inner {
808
+ margin: 0;
809
+ vertical-align: middle;
810
+ width: 100%;
811
+ }
812
+ .wpmtst.shortcodes table.inner,
813
+ .wpmtst.shortcodes table.inner tr,
814
+ .wpmtst.shortcodes table.inner td {
815
+ border: 0;
816
+ }
817
+ .wpmtst.shortcodes table.inner tr:first-child td {
818
+ border-bottom: 1px solid #DDD;
819
+ }
admin/settings/class-strong-testimonials-settings-compat.php CHANGED
@@ -208,6 +208,9 @@ class Strong_Testimonials_Settings_Compat {
208
  </table>
209
 
210
  <h2><?php _e( 'Compatibility Settings', 'strong-testimonials' ); ?></h2>
 
 
 
211
  <?php
212
  }
213
 
@@ -823,8 +826,7 @@ class Strong_Testimonials_Settings_Compat {
823
  </div>
824
  <div data-sub="lazyload">
825
  <p class="about"><?php _e( 'Most lazy loading techniques use one or two CSS class names to indicate which images to lazy load and when the lazy loading is finished.', 'strong-testimonials' ); ?></p>
826
- <p class="about"><?php _e( 'Contact support for your theme or plugin to find out if it uses CSS class names and if so, what they are.', 'strong-testimonials' ); ?></p>
827
- <p class="about"><?php printf( __( 'Or <a href="%s" target="_blank">open a support ticket here</a> and provide your system information.', 'strong-testimonials' ), esc_url( 'https://support.strongplugins.com/new-ticket/' ) ); ?></p>
828
  </div>
829
  </div>
830
  <?php
208
  </table>
209
 
210
  <h2><?php _e( 'Compatibility Settings', 'strong-testimonials' ); ?></h2>
211
+
212
+ <p class="about"><?php printf( __( '<a href="%s" target="_blank">Start a support ticket</a> if you need help with these options.', 'strong-testimonials' ), esc_url( 'https://support.strongplugins.com/new-ticket/' ) ); ?></p>
213
+
214
  <?php
215
  }
216
 
826
  </div>
827
  <div data-sub="lazyload">
828
  <p class="about"><?php _e( 'Most lazy loading techniques use one or two CSS class names to indicate which images to lazy load and when the lazy loading is finished.', 'strong-testimonials' ); ?></p>
829
+ <p class="about"><?php _e( 'Contact support for your theme or plugin to ask if it uses CSS class names.', 'strong-testimonials' ); ?></p>
 
830
  </div>
831
  </div>
832
  <?php
includes/class-strong-testimonials-shortcode-average.php CHANGED
@@ -93,29 +93,13 @@ class Strong_Testimonials_Average_Shortcode {
93
 
94
  // category
95
  if ( $atts['category'] ) {
96
-
97
- if ( is_numeric( $atts['category'] ) ) {
98
-
99
- $args['tax_query'] = array(
100
- array(
101
- 'taxonomy' => 'wpm-testimonial-category',
102
- 'field' => 'id',
103
- 'terms' => $args['category'],
104
- ),
105
- );
106
-
107
- } else {
108
-
109
- $args['tax_query'] = array(
110
- array(
111
- 'taxonomy' => 'wpm-testimonial-category',
112
- 'field' => 'slug',
113
- 'terms' => $args['category'],
114
- ),
115
- );
116
-
117
- }
118
-
119
  }
120
 
121
  $args = apply_filters( 'wpmtst_query_args', $args, $atts );
@@ -300,8 +284,8 @@ class Strong_Testimonials_Average_Shortcode {
300
  /**
301
  * Print the stars.
302
  *
303
- * @param double $rating
304
- * @param string $class
305
  * @since 2.31.0
306
  * @return string
307
  */
@@ -317,14 +301,14 @@ class Strong_Testimonials_Average_Shortcode {
317
  echo str_repeat( '<span class="star"></span>', 5 );
318
  } else {
319
  for ( $i = 1; $i <= 5; $i++ ) {
320
- $star_class = '';
321
- if ( intval( $i ) == intval( $rating ) ) {
322
- $star_class = ' current';
323
- if ( $rating - $i ) {
324
- $star_class .= ' half';
325
- }
326
  }
327
- echo '<span class="star' . $star_class . '"></span>';
328
  }
329
  }
330
  ?>
93
 
94
  // category
95
  if ( $atts['category'] ) {
96
+ $args['tax_query'] = array(
97
+ array(
98
+ 'taxonomy' => 'wpm-testimonial-category',
99
+ 'field' => is_numeric( $atts['category'] ) ? 'id' : 'slug',
100
+ 'terms' => $atts['category'],
101
+ ),
102
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  }
104
 
105
  $args = apply_filters( 'wpmtst_query_args', $args, $atts );
284
  /**
285
  * Print the stars.
286
  *
287
+ * @param double $rating Rounded to half.
288
+ * @param string $class The container CSS class.
289
  * @since 2.31.0
290
  * @return string
291
  */
301
  echo str_repeat( '<span class="star"></span>', 5 );
302
  } else {
303
  for ( $i = 1; $i <= 5; $i++ ) {
304
+ $star_class = 'star';
305
+ if ( $i == round( $rating ) ) {
306
+ $star_class .= ' current';
307
+ }
308
+ if ( 0.5 == $i - $rating ) {
309
+ $star_class .= ' half';
310
  }
311
+ printf( '<span class="%s"></span>', $star_class );
312
  }
313
  }
314
  ?>
public/css/rating-display.css CHANGED
@@ -125,7 +125,7 @@
125
  }
126
 
127
  /* which may be a half star */
128
- .strong-rating-wrapper.average span.current.half:before {
129
  content: "\f123";
130
  }
131
 
125
  }
126
 
127
  /* which may be a half star */
128
+ .strong-rating-wrapper.average .strong-rating span.star.half:before {
129
  content: "\f123";
130
  }
131
 
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: cdillon27
3
  Tags: testimonials, testimonial slider, testimonial form, reviews, star ratings
4
  Requires at least: 3.7
5
- Tested up to: 4.9.5
6
- Stable tag: 2.31.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -197,6 +197,9 @@ If you prefer, start a private support ticket at [support.strongplugins.com](htt
197
 
198
  == Changelog ==
199
 
 
 
 
200
  = 2.31.1 - May 15, 2018 =
201
  * Fix conflict with Review Markup add-on.
202
 
2
  Contributors: cdillon27
3
  Tags: testimonials, testimonial slider, testimonial form, reviews, star ratings
4
  Requires at least: 3.7
5
+ Tested up to: 4.9.6
6
+ Stable tag: 2.31.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
197
 
198
  == Changelog ==
199
 
200
+ = 2.31.2 - May 18, 2018 =
201
+ * Fix bug in average rating half-star.
202
+
203
  = 2.31.1 - May 15, 2018 =
204
  * Fix conflict with Review Markup add-on.
205
 
strong-testimonials.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: https://strongplugins.com/plugins/strong-testimonials/
5
  * Description: Collect and display your testimonials or reviews.
6
  * Author: Chris Dillon
7
- * Version: 2.31.1
8
  *
9
  * Author URI: https://strongplugins.com/
10
  * Text Domain: strong-testimonials
@@ -34,7 +34,7 @@ if ( ! defined( 'ABSPATH' ) ) {
34
  exit;
35
  }
36
 
37
- define( 'WPMTST_VERSION', '2.31.1' );
38
  define( 'WPMTST_PLUGIN', plugin_basename( __FILE__ ) ); // strong-testimonials/strong-testimonials.php
39
  define( 'WPMTST', dirname( WPMTST_PLUGIN ) ); // strong-testimonials
40
  define( 'STRONGPLUGINS_STORE_URL', 'https://strongplugins.com' );
4
  * Plugin URI: https://strongplugins.com/plugins/strong-testimonials/
5
  * Description: Collect and display your testimonials or reviews.
6
  * Author: Chris Dillon
7
+ * Version: 2.31.2
8
  *
9
  * Author URI: https://strongplugins.com/
10
  * Text Domain: strong-testimonials
34
  exit;
35
  }
36
 
37
+ define( 'WPMTST_VERSION', '2.31.2' );
38
  define( 'WPMTST_PLUGIN', plugin_basename( __FILE__ ) ); // strong-testimonials/strong-testimonials.php
39
  define( 'WPMTST', dirname( WPMTST_PLUGIN ) ); // strong-testimonials
40
  define( 'STRONGPLUGINS_STORE_URL', 'https://strongplugins.com' );