Yasr – Yet Another Stars Rating - Version 2.6.7

Version Description

  • FIX: if custom text is disabled in the settings, default text for a logged in user that has already rated for a post or page was empty.
Download this release

Release Info

Developer Dudo
Plugin Icon 128x128 Yasr – Yet Another Stars Rating
Version 2.6.7
Comparing to
See all releases

Code changes from version 2.6.6 to 2.6.7

includes/shortcodes/classes/YasrVisitorVotes.php CHANGED
@@ -187,13 +187,10 @@ class YasrVisitorVotes extends YasrShortcode {
187
  $span_bottom_line_content = false;
188
 
189
  if ($stars_enabled === 'true_logged' || $stars_enabled === 'false_already_voted') {
190
- //At the begin, rating is = $cookie_value
191
- $rating = $cookie_value;
 
192
  $default_text = '';
193
- if($cookie_value) {
194
- $default_text = __('You\'ve already voted this article with ', 'yet-another-stars-rating');
195
- }
196
-
197
  $span_bottom_line_content = "<span class='yasr-already-voted-text'>";
198
 
199
  //if it is not false_already_voted means it is true_logged
@@ -204,12 +201,19 @@ class YasrVisitorVotes extends YasrShortcode {
204
  if($vote_if_user_already_rated) {
205
  $rating = $vote_if_user_already_rated;
206
  }
 
 
207
  }
208
 
209
- $default_text .= $rating;
210
- $custom_text = apply_filters('yasr_cstm_text_already_voted', $default_text, $rating);
211
- $span_bottom_line_content .= wp_kses_post($custom_text);
 
 
 
 
212
 
 
213
  $span_bottom_line_content .= '</span>';
214
 
215
  }
187
  $span_bottom_line_content = false;
188
 
189
  if ($stars_enabled === 'true_logged' || $stars_enabled === 'false_already_voted') {
190
+ //default value is false
191
+ $rating = false;
192
+ //default is empty text
193
  $default_text = '';
 
 
 
 
194
  $span_bottom_line_content = "<span class='yasr-already-voted-text'>";
195
 
196
  //if it is not false_already_voted means it is true_logged
201
  if($vote_if_user_already_rated) {
202
  $rating = $vote_if_user_already_rated;
203
  }
204
+ } else {
205
+ $rating = $cookie_value;
206
  }
207
 
208
+ //if rating is not false, show the text after the stars
209
+ if($rating) {
210
+ $default_text = __('You\'ve already voted this article with ', 'yet-another-stars-rating') . $rating;
211
+ $custom_text = apply_filters('yasr_cstm_text_already_voted', $default_text, $rating);
212
+ } else {
213
+ $custom_text = '';
214
+ }
215
 
216
+ $span_bottom_line_content .= ($custom_text);
217
  $span_bottom_line_content .= '</span>';
218
 
219
  }
readme.txt CHANGED
@@ -5,7 +5,7 @@ Requires at least: 5.0
5
  Contributors: Dudo
6
  Tested up to: 5.7
7
  Requires PHP: 5.4
8
- Stable tag: 2.6.6
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
  Boost the way people interact with your site with an easy WordPress stars rating system! With schema.org rich snippets YASR will improve your SEO
@@ -181,6 +181,9 @@ If doesn't, you should work on your seo reputation.
181
 
182
  The full changelog can be found in the plugin's directory. Recent entries:
183
 
 
 
 
184
  = 2.6.6 =
185
  * TWEAKED: settings page revamped. I'd like to heard your feedback in the forum.
186
  * NEW FEATURE: it is now possible to add the %rating% variable when customizing the text for an user that has already rated.
5
  Contributors: Dudo
6
  Tested up to: 5.7
7
  Requires PHP: 5.4
8
+ Stable tag: 2.6.7
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
  Boost the way people interact with your site with an easy WordPress stars rating system! With schema.org rich snippets YASR will improve your SEO
181
 
182
  The full changelog can be found in the plugin's directory. Recent entries:
183
 
184
+ = 2.6.7 =
185
+ * FIX: if custom text is disabled in the settings, default text for a logged in user that has already rated for a post or page was empty.
186
+
187
  = 2.6.6 =
188
  * TWEAKED: settings page revamped. I'd like to heard your feedback in the forum.
189
  * NEW FEATURE: it is now possible to add the %rating% variable when customizing the text for an user that has already rated.
yet-another-stars-rating.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Yet Another Stars Rating
5
  * Plugin URI: http://wordpress.org/plugins/yet-another-stars-rating/
6
  * Description: Boost the way people interact with your site with an easy WordPress stars rating system! With schema.org rich snippets YASR will improve your SEO
7
- * Version: 2.6.6
8
  * Author: Dario Curvino
9
  * Author URI: https://dariocurvino.it/
10
  * Text Domain: yet-another-stars-rating
@@ -76,7 +76,7 @@ if ( !function_exists( 'yasr_fs' ) ) {
76
  yasr_fs();
77
  // Signal that SDK was initiated.
78
  do_action( 'yasr_fs_loaded' );
79
- define( 'YASR_VERSION_NUM', '2.6.6' );
80
  //Plugin absolute path
81
  //e.g. /var/www/html/plugin_development/wp-content/plugins/yet-another-stars-rating
82
  define( 'YASR_ABSOLUTE_PATH', __DIR__ );
4
  * Plugin Name: Yet Another Stars Rating
5
  * Plugin URI: http://wordpress.org/plugins/yet-another-stars-rating/
6
  * Description: Boost the way people interact with your site with an easy WordPress stars rating system! With schema.org rich snippets YASR will improve your SEO
7
+ * Version: 2.6.7
8
  * Author: Dario Curvino
9
  * Author URI: https://dariocurvino.it/
10
  * Text Domain: yet-another-stars-rating
76
  yasr_fs();
77
  // Signal that SDK was initiated.
78
  do_action( 'yasr_fs_loaded' );
79
+ define( 'YASR_VERSION_NUM', '2.6.7' );
80
  //Plugin absolute path
81
  //e.g. /var/www/html/plugin_development/wp-content/plugins/yet-another-stars-rating
82
  define( 'YASR_ABSOLUTE_PATH', __DIR__ );