Yasr – Yet Another Stars Rating - Version 0.3.9

Version Description

  • Fixed page exclusion
Download this release

Release Info

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

Code changes from version 0.3.8 to 0.3.9

lib/yasr-functions.php CHANGED
@@ -135,8 +135,6 @@ function overall_rating_auto_insert_code () {
135
 
136
  $option = get_option( 'yasr_general_options' );
137
 
138
- if ($option['auto_insert_exclude_pages'] === 'no') {
139
-
140
  if($option['text_before_stars'] == 1 && $option['text_before_overall'] != '') {
141
  $shortcode_html = "<div class=\"yasr-container-custom-text-and-overall\">
142
  <span id=\"yasr-custom-text-before-overall\">$option[text_before_overall]</span>
@@ -155,28 +153,50 @@ function overall_rating_auto_insert_code () {
155
  //IF show overall rating in loop is disabled use is_singular && is_main query
156
  if ($option['show_overall_in_loop'] === 'disabled') {
157
 
158
- if( is_singular() && is_main_query() ) {
 
159
 
160
- return $shortcode_html;
 
 
 
 
161
 
162
  }
163
 
164
- }
 
 
 
 
 
165
 
166
- //else don't
 
 
 
 
167
  elseif ($option['show_overall_in_loop'] === 'enabled') {
168
 
169
- return $shortcode_html;
 
170
 
171
- }
172
 
173
- } // End if ($option['auto_insert_exclude_pages'] === 'no') {
174
 
175
- elseif ($option['auto_insert_exclude_pages'] === 'yes') {
 
176
 
177
- return NULL;
178
 
179
- }
 
 
 
 
 
 
180
 
181
  } //End function
182
 
@@ -190,8 +210,6 @@ function visitor_votes_auto_insert_code () {
190
 
191
  $option = get_option( 'yasr_general_options' );
192
 
193
- if ($option['auto_insert_exclude_pages'] === 'no') {
194
-
195
  $shortcode_html = NULL; //Avoid undefined variable outside is_singular && is_main_query
196
 
197
  if( is_singular() && is_main_query() ) {
@@ -438,17 +456,23 @@ function visitor_votes_auto_insert_code () {
438
 
439
  <?php
440
 
441
- return $shortcode_html;
442
 
443
- } //End if is singular
444
 
445
- } // End if ($option['auto_insert_exclude_pages'] === 'no')
446
 
447
- elseif ($option['auto_insert_exclude_pages'] === 'yes') {
448
 
449
- return NULL;
450
 
451
- }
 
 
 
 
 
 
452
 
453
  } //End function shortcode_visitor_votes_callback
454
 
135
 
136
  $option = get_option( 'yasr_general_options' );
137
 
 
 
138
  if($option['text_before_stars'] == 1 && $option['text_before_overall'] != '') {
139
  $shortcode_html = "<div class=\"yasr-container-custom-text-and-overall\">
140
  <span id=\"yasr-custom-text-before-overall\">$option[text_before_overall]</span>
153
  //IF show overall rating in loop is disabled use is_singular && is_main query
154
  if ($option['show_overall_in_loop'] === 'disabled') {
155
 
156
+ //If pages are not excluted
157
+ if ($option['auto_insert_exclude_pages'] === 'no') {
158
 
159
+ if( is_singular() && is_main_query() ) {
160
+
161
+ return $shortcode_html;
162
+
163
+ }
164
 
165
  }
166
 
167
+ //If page are excluted
168
+ else {
169
+
170
+ if( is_singular() && is_main_query() && !is_page() )
171
+
172
+ return $shortcode_html;
173
 
174
+ }
175
+
176
+ } // End if ($option['show_overall_in_loop'] === 'disabled') {
177
+
178
+ //If overall rating in loop is enabled don't use is_singular && is main_query
179
  elseif ($option['show_overall_in_loop'] === 'enabled') {
180
 
181
+ //If pages are not excluted return always
182
+ if ($option['auto_insert_exclude_pages'] === 'no') {
183
 
184
+ return $shortcode_html;
185
 
186
+ }
187
 
188
+ //Else if page are excluted return only if is not a page
189
+ else {
190
 
191
+ if ( !is_page() ) {
192
 
193
+ return $shortcode_html;
194
+
195
+ }
196
+
197
+ }
198
+
199
+ }
200
 
201
  } //End function
202
 
210
 
211
  $option = get_option( 'yasr_general_options' );
212
 
 
 
213
  $shortcode_html = NULL; //Avoid undefined variable outside is_singular && is_main_query
214
 
215
  if( is_singular() && is_main_query() ) {
456
 
457
  <?php
458
 
459
+ if ($option['auto_insert_exclude_pages'] === 'no') {
460
 
461
+ return $shortcode_html;
462
 
463
+ }
464
 
465
+ else {
466
 
467
+ if ( !is_page() ) {
468
 
469
+ return $shortcode_html;
470
+
471
+ }
472
+
473
+ }
474
+
475
+ } //End if is singular
476
 
477
  } //End function shortcode_visitor_votes_callback
478
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
3
  Tags: Rating, Review, Star, Snippet, Rich snippet, Schema, Schema.org, Serp
4
  Requires at least: 3.5
5
  Tested up to: 3.9.1
6
- Stable tag: 0.3.8
7
  License: GPL2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -42,13 +42,41 @@ If with gd-star-rating you're using a different number of stars from the default
42
  2. Activate the plugin through the 'Plugins' menu in WordPress
43
  3. Go to the Yet Another Star Rating menu in Settings and set your options.
44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  == Screenshots ==
46
  1. Example of yasr in a videogame review
47
  2. Another example of a restaurant review
48
 
49
-
50
  == Changelog ==
51
 
 
 
 
52
  = 0.3.8 =
53
  * Added new chart: Top 10 most rated / highest rated posts from visitors (show up only posts rated at least twice)
54
  * New setting: it's possibile now to explude pages from auto insert
3
  Tags: Rating, Review, Star, Snippet, Rich snippet, Schema, Schema.org, Serp
4
  Requires at least: 3.5
5
  Tested up to: 3.9.1
6
+ Stable tag: 0.3.9
7
  License: GPL2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
42
  2. Activate the plugin through the 'Plugins' menu in WordPress
43
  3. Go to the Yet Another Star Rating menu in Settings and set your options.
44
 
45
+ == Frequently Asked Questions ==
46
+
47
+ = What is "Overall Rating"? =
48
+ It's the vote put from who write the review: readers can see this vote in read-only. Reviewer can vote using the box on the top rigth when writing a new articole or post (he / she must have at least "Author" role). Remember to insert this shortcode **[yasr_overall_rating]** to make appear where you want. You can choose to make it appear just in a single post/page or in archive pages too (e.g. default Index, category pages, etc)
49
+
50
+ = What is "Visitor Rating"? =
51
+ It's the vote that allows your visitors to vote: just paste this shortcode **[yasr_visitor_votes]** where you want the stars to appear. This works only in single post or pages
52
+
53
+ = What is "Multi Set"? =
54
+ It's the feature that make YASR awesome. Multisets give the opportunity to score different aspects for each review: for example, if you're reviewing a videogame, you can create the aspects "Graphics", "Gameplay", "Story", etc. and give a vote for each one. To create a set, just go in "Settings" -> "Yet Another Stars Rating: Settings" and click on the "Multi Sets" tab. To insert it into a post, just paste the shortcode that YASR will create for you.
55
+
56
+ = What is "Top 10 overall ratings" ? =
57
+ It's the chart of the 10 highest rated item from reviewer. To insert it into a post or page, just paste this shortcode **[yasr_top_ten_highest_rated]**
58
+
59
+ = What is "Top 10 by visitors" ? =
60
+ This is 2 charts in 1. Infact, this chart will be display both the most rated posts/pages or the highest rated posts/pages. In order to appear in this chart item must be rated at least twice. Paste this shortcode to make appear where you want **[yasr_most_or_highest_rated_posts]**
61
+
62
+ = What is "Most active reviewers" ? =
63
+ If in your site there are more than 1 person writing reviews, this chart will show up the most 5 active reviewer. Shortcode is **[yasr_top_5_reviewers]**
64
+
65
+ = What is Most "active users" ? =
66
+ When a visitor (logged in or not) rates a post/page, rating are stored in the database. This chart will show the 10 most active users; show up login name if was logged in, "Anonymous" otherwise. The shortcode : **[yasr_top_ten_active_users]**
67
+
68
+ = Wait, wait! Do I need to keep in mind all this shortcode? =
69
+ Of course no: you can easly add it on visual editor clicking on the yellow star and then choose what to insert
70
+
71
  == Screenshots ==
72
  1. Example of yasr in a videogame review
73
  2. Another example of a restaurant review
74
 
 
75
  == Changelog ==
76
 
77
+ = 0.3.9 =
78
+ * Fixed page exclusion
79
+
80
  = 0.3.8 =
81
  * Added new chart: Top 10 most rated / highest rated posts from visitors (show up only posts rated at least twice)
82
  * New setting: it's possibile now to explude pages from auto insert
yet-another-stars-rating.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Yet Another Stars Rating
4
  * Plugin URI: http://wordpress.org/plugins/yet-another-stars-rating/
5
  * Description: Rating system with rich snippets
6
- * Version: 0.3.8
7
  * Author: Dario Curvino
8
  * Author URI: http://profiles.wordpress.org/dudo/
9
  * License: GPL2
@@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
28
  */
29
 
30
 
31
- define('YASR_VERSION_NUM', '0.3.8');
32
 
33
  //Plugin absolute path
34
  define( "YASR_ABSOLUTE_PATH", dirname(__FILE__) );
3
  * Plugin Name: Yet Another Stars Rating
4
  * Plugin URI: http://wordpress.org/plugins/yet-another-stars-rating/
5
  * Description: Rating system with rich snippets
6
+ * Version: 0.3.9
7
  * Author: Dario Curvino
8
  * Author URI: http://profiles.wordpress.org/dudo/
9
  * License: GPL2
28
  */
29
 
30
 
31
+ define('YASR_VERSION_NUM', '0.3.9');
32
 
33
  //Plugin absolute path
34
  define( "YASR_ABSOLUTE_PATH", dirname(__FILE__) );