Yasr – Yet Another Stars Rating - Version 0.8.6

Version Description

  • Fixed bug on new installation if multi set are used
Download this release

Release Info

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

Code changes from version 0.8.5 to 0.8.6

lib/yasr-db-functions.php CHANGED
@@ -65,6 +65,8 @@ function yasr_install() {
65
set_type int (2) NOT NULL,
66
post_id bigint(20) NOT NULL,
67
votes decimal(2,1) NOT NULL,
68
PRIMARY KEY (id),
69
UNIQUE KEY id (id)
70
);";
65
set_type int (2) NOT NULL,
66
post_id bigint(20) NOT NULL,
67
votes decimal(2,1) NOT NULL,
68
+ number_of_votes bigint(20) NOT NULL,
69
+ sum_votes decimal(11, 1) NOT NULL,
70
PRIMARY KEY (id),
71
UNIQUE KEY id (id)
72
);";
lib/yasr-shortcode-functions.php CHANGED
@@ -139,11 +139,11 @@ function shortcode_visitor_votes_callback ($atts) {
139
140
$stars_attribute = yasr_stars_size($size);
141
142
- $cookiename = 'yasr_visitor_vote_' . $post_id;
143
144
- if (isset($_COOKIE[$cookiename])) {
145
146
- $cookie_value = $_COOKIE[$cookiename];
147
148
$cookie_value = (int)$cookie_value;
149
@@ -279,7 +279,7 @@ function shortcode_visitor_votes_callback ($atts) {
279
280
else {
281
282
- $span_text_after_star .= "<span class=\"yasr-total-average-container\" id=\"yasr-total-average-text_$post_id\" title=\"yasr-stats\">
283
[" . __("Total: ", "yasr") . "$votes_number &nbsp; &nbsp;" . __("Average: ","yasr") . "$medium_rating/5]
284
</span>";
285
139
140
$stars_attribute = yasr_stars_size($size);
141
142
+ $yasr_cookiename = 'yasr_visitor_vote_' . $post_id;
143
144
+ if (isset($_COOKIE[$yasr_cookiename])) {
145
146
+ $cookie_value = $_COOKIE[$yasr_cookiename];
147
148
$cookie_value = (int)$cookie_value;
149
279
280
else {
281
282
+ $span_text_after_star = "<span class=\"yasr-total-average-container\" id=\"yasr-total-average-text_$post_id\" title=\"yasr-stats\">
283
[" . __("Total: ", "yasr") . "$votes_number &nbsp; &nbsp;" . __("Average: ","yasr") . "$medium_rating/5]
284
</span>";
285
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.2
7
- Stable tag: 0.8.5
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
@@ -48,7 +48,7 @@ If with gd-star-rating you're using a different number of stars from the default
48
* Persian (Thanks to Babak Mehri )
49
* Brazilian Portuguese (Thanks to [Iuri](http://assistirfilmesonline.info) )
50
* Russian (Thanks to Ron)
51
- * Spanish (Thanks to [Carlos](http://dto2y3d.com) )
52
53
Check [here](http://translate.yetanotherstarsrating.com/) to see if your translation is up to date
54
@@ -119,6 +119,9 @@ Of course not: you can easily add it on the visual editor just by clicking on th
119
120
== Changelog ==
121
122
= 0.8.5 =
123
* TWEAKED: code changes and bug fixes on Multi Set shortcodes
124
4
Requires at least: 3.5
5
Contributors: Dudo
6
Tested up to: 4.2
7
+ Stable tag: 0.8.6
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
48
* Persian (Thanks to Babak Mehri )
49
* Brazilian Portuguese (Thanks to [Iuri](http://assistirfilmesonline.info) )
50
* Russian (Thanks to Ron)
51
+ * Spanish (Thanks to [Carlos](http://CGlevel.com) )
52
53
Check [here](http://translate.yetanotherstarsrating.com/) to see if your translation is up to date
54
119
120
== Changelog ==
121
122
+ = 0.8.6 =
123
+ * Fixed bug on new installation if multi set are used
124
+
125
= 0.8.5 =
126
* TWEAKED: code changes and bug fixes on Multi Set shortcodes
127
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.8.5
7
* Author: Dario Curvino
8
* Author URI: https://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.8.5');
32
33
//Plugin relative path
34
define( "YASR_RELATIVE_PATH", dirname(__FILE__) );
@@ -162,10 +162,23 @@ define ("YASR_LOADER_IMAGE", YASR_IMG_DIR . "/loader.gif");
162
/****** backward compatibility functions ******/
163
164
//remove end july 2015
165
- if ($version_installed && $version_installed < '0.8.3') {
166
167
- $wpdb->query("ALTER TABLE " . YASR_MULTI_SET_VALUES_TABLE . " ADD number_of_votes BIGINT( 20 ) NOT NULL ,
168
- ADD sum_votes DECIMAL( 11, 1 ) NOT NULL ;");
169
170
}
171
@@ -178,8 +191,6 @@ if ($version_installed && $version_installed < '0.8.2') {
178
179
}
180
181
-
182
-
183
//remove end may 2015
184
if ($version_installed && $version_installed < '0.7.7') {
185
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.8.6
7
* Author: Dario Curvino
8
* Author URI: https://yetanotherstarsrating.com/
9
* License: GPL2
28
*/
29
30
31
+ define('YASR_VERSION_NUM', '0.8.6');
32
33
//Plugin relative path
34
define( "YASR_RELATIVE_PATH", dirname(__FILE__) );
162
/****** backward compatibility functions ******/
163
164
//remove end july 2015
165
+ if ($version_installed && $version_installed < '0.8.6') {
166
167
+ $new_fields=$wpdb->get_results("SELECT * FROM " . YASR_MULTI_SET_VALUES_TABLE . " LIMIT 1");
168
+
169
+ foreach ($new_fields as $fields) {
170
+ if(!isset($fields->number_of_votes)) {
171
+ $new_fields = FALSE;
172
+ }
173
+ }
174
+
175
+
176
+
177
+ if(!$new_fields) {
178
+
179
+ $wpdb->query("ALTER TABLE " . YASR_MULTI_SET_VALUES_TABLE . " ADD number_of_votes BIGINT( 20 ) NOT NULL ,
180
+ ADD sum_votes DECIMAL( 11, 1 ) NOT NULL ;");
181
+ }
182
183
}
184
191
192
}
193
194
//remove end may 2015
195
if ($version_installed && $version_installed < '0.7.7') {
196