Yasr – Yet Another Stars Rating - Version 0.6.2

Version Description

  • Fixed bug for [yasr_overall_rating] in pages
  • Code cleanup in [yasr_overall_rating]
Download this release

Release Info

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

Code changes from version 0.6.1 to 0.6.2

lib/yasr-shortcode-functions.php CHANGED
@@ -34,20 +34,25 @@ function shortcode_overall_rating_callback ($atts) {
34
 
35
  }
36
 
37
- switch ($size) {
38
- case 'small':
39
- $shortcode_html .= "<div class=\"rateit\" id=\"yasr_rateit_overall\" data-rateit-starwidth=\"16\" data-rateit-starheight=\"16\" data-rateit-value=\"$overall_rating\" data-rateit-step=\"0.1\" data-rateit-resetable=\"false\" data-rateit-readonly=\"true\"></div>";
40
- break;
41
-
42
- case 'medium':
43
- $shortcode_html .= "<div class=\"rateit medium\" id=\"yasr_rateit_overall\" data-rateit-starwidth=\"24\" data-rateit-starheight=\"24\" data-rateit-value=\"$overall_rating\" data-rateit-step=\"0.1\" data-rateit-resetable=\"false\" data-rateit-readonly=\"true\"></div>";
44
- break;
45
-
46
- case 'large':
47
- $shortcode_html .= "<div class=\"rateit bigstars\" id=\"yasr_rateit_overall\" data-rateit-starwidth=\"32\" data-rateit-starheight=\"32\" data-rateit-value=\"$overall_rating\" data-rateit-step=\"0.1\" data-rateit-resetable=\"false\" data-rateit-readonly=\"true\"></div>";
48
- break;
49
  }
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
  if (YASR_TEXT_BEFORE_STARS == 1 && YASR_TEXT_BEFORE_OVERALL != '') {
53
 
@@ -59,7 +64,7 @@ function shortcode_overall_rating_callback ($atts) {
59
  if ( YASR_SHOW_OVERALL_IN_LOOP === 'disabled' ) {
60
 
61
  //If pages are not excluted
62
- if ( YASR_AUTO_INSERT_EXCLUDE_PAGES === 'no' ) {
63
 
64
  if( is_singular() && is_main_query() ) {
65
 
@@ -84,7 +89,7 @@ function shortcode_overall_rating_callback ($atts) {
84
  elseif ( YASR_SHOW_OVERALL_IN_LOOP === 'enabled' ) {
85
 
86
  //If pages are not excluted return always
87
- if ( YASR_AUTO_INSERT_EXCLUDE_PAGES === 'no' ) {
88
 
89
  return $shortcode_html;
90
 
34
 
35
  }
36
 
37
+ if ($size === 'small') {
38
+ $rateit_class='rateit';
39
+ $px_size = '16';
 
 
 
 
 
 
 
 
 
40
  }
41
 
42
+ elseif ($size === 'medium') {
43
+ $rateit_class = 'rateit medium';
44
+ $px_size = '24';
45
+ }
46
+
47
+ //default values
48
+ else {
49
+ $rateit_class = 'rateit bigstars';
50
+ $px_size = '32';
51
+ }
52
+
53
+ $shortcode_html .= "<div class=\"$rateit_class\" id=\"yasr_rateit_overall\" data-rateit-starwidth=\"$px_size\" data-rateit-starheight=\"$px_size\" data-rateit-value=\"$overall_rating\" data-rateit-step=\"0.1\" data-rateit-resetable=\"false\" data-rateit-readonly=\"true\"></div>";
54
+
55
+
56
 
57
  if (YASR_TEXT_BEFORE_STARS == 1 && YASR_TEXT_BEFORE_OVERALL != '') {
58
 
64
  if ( YASR_SHOW_OVERALL_IN_LOOP === 'disabled' ) {
65
 
66
  //If pages are not excluted
67
+ if ( YASR_AUTO_INSERT_EXCLUDE_PAGES === 'no' || !YASR_AUTO_INSERT_EXCLUDE_PAGES ) {
68
 
69
  if( is_singular() && is_main_query() ) {
70
 
89
  elseif ( YASR_SHOW_OVERALL_IN_LOOP === 'enabled' ) {
90
 
91
  //If pages are not excluted return always
92
+ if ( YASR_AUTO_INSERT_EXCLUDE_PAGES === 'no' || !YASR_AUTO_INSERT_EXCLUDE_PAGES ) {
93
 
94
  return $shortcode_html;
95
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: 5 star, admin, administrator, AJAX, five-star, javascript, jquery, post r
4
  Requires at least: 3.5
5
  Contributors: Dudo
6
  Tested up to: 4.0
7
- Stable tag: 0.6.1
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
  Yet Another Stars Rating is a simple plugin which allows you and / or your visitor to rate a post or element. Ideal for review's website
@@ -29,9 +29,10 @@ Again, this can be placed automatically at the beginning or the end of each post
29
  = Multi Set =
30
  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",
31
  "Gameplay", "Story", etc.
 
32
 
33
  = Importing data from gd star rating =
34
- If you're using gd-star-rating, YASR is the plugin for you! You can import from gd-star-rating "overall_rating", "visitor_votes" and all the multisets with
35
  their respective score. Once YASR is installed you just have to go to "Settings" -> "Yet Another Stars Rating: Settings" and start the import (last box at the bottom).
36
  This operation can take some time, don't stop it! Once it's done you just need to replace the gd-star-rating's shortcode with the YASR tags.
37
  If with gd-star-rating you're using a different number of stars from the default of 5, YASR will automatically convert all the scores in a range from 1 to 5.
@@ -57,6 +58,7 @@ It is the vote that allows your visitors to vote: just paste this shortcode **[y
57
 
58
  = What is "Multi Set"? =
59
  It is the feature that makes 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.
 
60
 
61
  = What is "Ranking reviews" ? =
62
  It is the 10 highest rated item chart by reviewer. In order to insert it into a post or page, just paste this shortcode **[yasr_top_ten_highest_rated]**
@@ -84,6 +86,10 @@ Of course not: you can easily add it on the visual editor just by clicking on th
84
 
85
  == Changelog ==
86
 
 
 
 
 
87
  = 0.6.1 =
88
  * Bugfix: fixed mysql error if inserted the overall rating vote if post wasn't saved yet
89
  * Fixed schema info when overall rating is used
4
  Requires at least: 3.5
5
  Contributors: Dudo
6
  Tested up to: 4.0
7
+ Stable tag: 0.6.2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
  Yet Another Stars Rating is a simple plugin which allows you and / or your visitor to rate a post or element. Ideal for review's website
29
  = Multi Set =
30
  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",
31
  "Gameplay", "Story", etc.
32
+ Only who write the post or page can inserta votes in Multi Set.
33
 
34
  = Importing data from gd star rating =
35
+ If you're using gd-star-rating, YASR is the plugin for you! You can import from gd-star-rating "Overall Rating", "Visitor Votes" and all the multisets with
36
  their respective score. Once YASR is installed you just have to go to "Settings" -> "Yet Another Stars Rating: Settings" and start the import (last box at the bottom).
37
  This operation can take some time, don't stop it! Once it's done you just need to replace the gd-star-rating's shortcode with the YASR tags.
38
  If with gd-star-rating you're using a different number of stars from the default of 5, YASR will automatically convert all the scores in a range from 1 to 5.
58
 
59
  = What is "Multi Set"? =
60
  It is the feature that makes 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.
61
+ Only who write the post or page can insert votes in Multi Set.
62
 
63
  = What is "Ranking reviews" ? =
64
  It is the 10 highest rated item chart by reviewer. In order to insert it into a post or page, just paste this shortcode **[yasr_top_ten_highest_rated]**
86
 
87
  == Changelog ==
88
 
89
+ = 0.6.2 =
90
+ * Fixed bug for [yasr_overall_rating] in pages
91
+ * Code cleanup in [yasr_overall_rating]
92
+
93
  = 0.6.1 =
94
  * Bugfix: fixed mysql error if inserted the overall rating vote if post wasn't saved yet
95
  * Fixed schema info when overall rating is used
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.6.1
7
  * Author: Dario Curvino
8
  * Author URI: http://yetanotherstarsrating.com/
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.6.1');
32
 
33
  //Plugin absolute path
34
  define( "YASR_ABSOLUTE_PATH", dirname(__FILE__) );
@@ -152,7 +152,7 @@ else {
152
  define ("YASR_AUTO_INSERT_WHAT", NULL);
153
  define ("YASR_AUTO_INSERT_WHERE", NULL);
154
  define ("YASR_AUTO_INSERT_SIZE", NULL);
155
- define ("YASR_AUTO_INSERT_EXCLUDE_PAGES", "yes");
156
  define ("YASR_AUTO_INSERT_CUSTOM_POST_ONLY", NULL);
157
 
158
  }
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.6.2
7
  * Author: Dario Curvino
8
  * Author URI: http://yetanotherstarsrating.com/
9
  * License: GPL2
28
  */
29
 
30
 
31
+ define('YASR_VERSION_NUM', '0.6.2');
32
 
33
  //Plugin absolute path
34
  define( "YASR_ABSOLUTE_PATH", dirname(__FILE__) );
152
  define ("YASR_AUTO_INSERT_WHAT", NULL);
153
  define ("YASR_AUTO_INSERT_WHERE", NULL);
154
  define ("YASR_AUTO_INSERT_SIZE", NULL);
155
+ define ("YASR_AUTO_INSERT_EXCLUDE_PAGES", NULL);
156
  define ("YASR_AUTO_INSERT_CUSTOM_POST_ONLY", NULL);
157
 
158
  }