Version Description
- TWEAKED: yasr_visitor_votes doesn't use anymore yasr_votes table. It use only yasr_log instead. From this version, yasr_votes is not created anymore. If after this update everything is ok, if you wish you can drop yasr_votes table
- TWEAKED: add the link to the post on yasr recent ratings widget
- TWEAKED: huge code cleanup
Download this release
Release Info
Developer | Dudo |
Plugin | Yasr – Yet Another Stars Rating |
Version | 1.3.6 |
Comparing to | |
See all releases |
Code changes from version 1.3.5 to 1.3.6
- js/yasr-front.js +0 -18
- lib/yasr-ajax-functions.php +66 -201
- lib/yasr-db-functions.php +1 -14
- lib/yasr-widgets.php +3 -3
- readme.txt +6 -12
- yet-another-stars-rating.php +2 -2
js/yasr-front.js
CHANGED
@@ -55,22 +55,6 @@ document.addEventListener('DOMContentLoaded', function(event) {
|
|
55 |
|
56 |
jQuery('#yasr_visitor_votes_' + postid).html(yasrCommonData.loaderHtml);
|
57 |
|
58 |
-
//If logged in user and has already rated for a post/page update the vote
|
59 |
-
if (yasrCommonData.loggedUser && voteIfUserAlredyRated) {
|
60 |
-
|
61 |
-
var data = {
|
62 |
-
action: 'yasr_update_visitor_rating',
|
63 |
-
rating: value,
|
64 |
-
post_id: postid,
|
65 |
-
size: classSize,
|
66 |
-
nonce_visitor: yasrVisitorsVotesData.nonceVisitor
|
67 |
-
};
|
68 |
-
|
69 |
-
}
|
70 |
-
|
71 |
-
//else is a new vote
|
72 |
-
else {
|
73 |
-
|
74 |
var data = {
|
75 |
action: 'yasr_send_visitor_rating',
|
76 |
rating: value,
|
@@ -79,8 +63,6 @@ document.addEventListener('DOMContentLoaded', function(event) {
|
|
79 |
nonce_visitor: yasrVisitorsVotesData.nonceVisitor
|
80 |
};
|
81 |
|
82 |
-
}
|
83 |
-
|
84 |
//Send value to the Server
|
85 |
jQuery.post(yasrCommonData.ajaxurl, data, function(response) {
|
86 |
//response
|
55 |
|
56 |
jQuery('#yasr_visitor_votes_' + postid).html(yasrCommonData.loaderHtml);
|
57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
var data = {
|
59 |
action: 'yasr_send_visitor_rating',
|
60 |
rating: value,
|
63 |
nonce_visitor: yasrVisitorsVotesData.nonceVisitor
|
64 |
};
|
65 |
|
|
|
|
|
66 |
//Send value to the Server
|
67 |
jQuery.post(yasrCommonData.ajaxurl, data, function(response) {
|
68 |
//response
|
lib/yasr-ajax-functions.php
CHANGED
@@ -1161,9 +1161,6 @@ if ( ! defined( 'ABSPATH' ) ) exit('You\'re not allowed to see this page'); // E
|
|
1161 |
die( 'Security check' );
|
1162 |
}
|
1163 |
|
1164 |
-
$row_exists_result=NULL; //Avoid Undefined variable notice
|
1165 |
-
$new_row_result=NULL; ////Avoid Undefined variable notice
|
1166 |
-
|
1167 |
if ($rating < 1) {
|
1168 |
_e("Error: you can't vote 0", 'yet-another-stars-rating');
|
1169 |
die();
|
@@ -1192,65 +1189,19 @@ if ( ! defined( 'ABSPATH' ) ) exit('You\'re not allowed to see this page'); // E
|
|
1192 |
|
1193 |
global $wpdb;
|
1194 |
|
1195 |
-
|
1196 |
-
|
1197 |
-
//If post already has vote, find where it is and sum it
|
1198 |
-
if ($row_exists) {
|
1199 |
-
|
1200 |
-
foreach ($row_exists as $user_votes) {
|
1201 |
-
$number_of_votes = $user_votes->number_of_votes;
|
1202 |
-
$user_votes_sum = $user_votes->sum_votes;
|
1203 |
-
}
|
1204 |
-
|
1205 |
-
$number_of_votes=$number_of_votes+1;
|
1206 |
-
$user_votes_sum=$user_votes_sum+$rating;
|
1207 |
-
|
1208 |
-
$row_exists_result=$wpdb->update(
|
1209 |
-
YASR_VOTES_TABLE,
|
1210 |
-
array (
|
1211 |
-
'number_of_votes' => $number_of_votes,
|
1212 |
-
'sum_votes' => $user_votes_sum
|
1213 |
-
),
|
1214 |
-
array (
|
1215 |
-
'post_id' => $post_id
|
1216 |
-
),
|
1217 |
-
array('%d', '%s' ),
|
1218 |
-
array( '%d' )
|
1219 |
-
);
|
1220 |
-
|
1221 |
-
} //End if row_exists
|
1222 |
-
|
1223 |
-
else {
|
1224 |
-
|
1225 |
-
$number_of_votes = 1;
|
1226 |
|
1227 |
-
|
1228 |
-
YASR_VOTES_TABLE,
|
1229 |
-
array (
|
1230 |
-
'post_id' => $post_id,
|
1231 |
-
'number_of_votes' => $number_of_votes,
|
1232 |
-
'overall_rating' => '-1',
|
1233 |
-
'sum_votes' => $rating,
|
1234 |
-
'review_type' => YASR_ITEMTYPE
|
1235 |
-
),
|
1236 |
-
array ('%d', "%d", "%s", "%s", "%s")
|
1237 |
-
);
|
1238 |
-
}
|
1239 |
-
|
1240 |
-
|
1241 |
-
//If one of this is true update the log table
|
1242 |
-
if ($row_exists_result || $new_row_result ) {
|
1243 |
|
1244 |
-
|
|
|
1245 |
|
1246 |
-
|
1247 |
-
|
1248 |
-
$current_user = wp_get_current_user();
|
1249 |
|
1250 |
-
|
|
|
1251 |
|
1252 |
-
|
1253 |
-
YASR_LOG_TABLE,
|
1254 |
array (
|
1255 |
'post_id' => $post_id,
|
1256 |
'multi_set_id' => -1,
|
@@ -1259,173 +1210,87 @@ if ( ! defined( 'ABSPATH' ) ) exit('You\'re not allowed to see this page'); // E
|
|
1259 |
'date' => date('Y-m-d H:i:s'),
|
1260 |
'ip' => $ip_adress
|
1261 |
),
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
|
1278 |
-
|
1279 |
-
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
die(); // this is required to return a proper result
|
1287 |
-
}
|
1288 |
-
|
1289 |
-
|
1290 |
-
/****** Update vote for logged in user ******/
|
1291 |
-
|
1292 |
-
add_action( 'wp_ajax_yasr_update_visitor_rating', 'yasr_update_visitor_rating_callback' );
|
1293 |
-
add_action( 'wp_ajax_nopriv_yasr_update_visitor_rating', 'yasr_update_visitor_rating_callback' );
|
1294 |
-
|
1295 |
-
function yasr_update_visitor_rating_callback () {
|
1296 |
-
|
1297 |
-
if(isset($_POST['rating']) && isset($_POST['post_id']) && isset($_POST['size']) && isset($_POST['nonce_visitor']) ) {
|
1298 |
-
$new_rating = $_POST['rating'];
|
1299 |
-
$post_id = $_POST['post_id'];
|
1300 |
-
$rateit_class = $_POST['size'];
|
1301 |
-
$nonce_visitor = $_POST['nonce_visitor'];
|
1302 |
-
|
1303 |
-
if($post_id == '') {
|
1304 |
|
1305 |
-
|
1306 |
-
|
1307 |
-
}
|
1308 |
-
|
1309 |
-
}
|
1310 |
-
|
1311 |
-
else {
|
1312 |
-
exit();
|
1313 |
-
}
|
1314 |
-
|
1315 |
-
//create an hook
|
1316 |
-
do_action('yasr_action_on_update_visitor_vote', $post_id, $new_rating);
|
1317 |
-
|
1318 |
-
//Check nonce
|
1319 |
-
if ( ! wp_verify_nonce( $nonce_visitor, 'yasr_nonce_insert_visitor_rating' ) ) {
|
1320 |
-
die( 'Security check' );
|
1321 |
-
}
|
1322 |
-
|
1323 |
-
//Rating can't be <1
|
1324 |
-
if ($new_rating < 1) {
|
1325 |
-
_e("Error: you can't vote 0", 'yet-another-stars-rating');
|
1326 |
-
die();
|
1327 |
-
}
|
1328 |
-
|
1329 |
-
//or >5
|
1330 |
-
elseif ($new_rating > 5 ) {
|
1331 |
-
$rating = 5;
|
1332 |
-
}
|
1333 |
-
|
1334 |
-
if ($rateit_class == 'rateit yasr_visitor_votes_stars_div') {
|
1335 |
-
$px_size = '16';
|
1336 |
-
}
|
1337 |
-
|
1338 |
-
elseif ($rateit_class == 'rateit medium yasr_visitor_votes_stars_div') {
|
1339 |
-
$px_size = '24';
|
1340 |
-
}
|
1341 |
-
|
1342 |
-
//default values
|
1343 |
-
else {
|
1344 |
-
$px_size = '32';
|
1345 |
-
}
|
1346 |
-
|
1347 |
-
$transient_name = 'yasr_visitor_votes_' . $post_id;
|
1348 |
-
|
1349 |
-
delete_transient( $transient_name );
|
1350 |
-
|
1351 |
-
global $wpdb;
|
1352 |
-
|
1353 |
-
$all_post_votes = $wpdb->get_results($wpdb->prepare("SELECT sum_votes, number_of_votes FROM " . YASR_VOTES_TABLE . " WHERE post_id=%d", $post_id));
|
1354 |
|
1355 |
-
$current_user = wp_get_current_user();
|
1356 |
|
1357 |
-
|
1358 |
|
1359 |
-
|
1360 |
-
|
1361 |
|
1362 |
-
|
|
|
1363 |
|
1364 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1365 |
|
1366 |
-
|
1367 |
-
|
1368 |
-
$number_of_votes = $votes->number_of_votes;
|
1369 |
-
}
|
1370 |
-
|
1371 |
-
//Avoid division by 0. This should never happen, just to be safe, check this post
|
1372 |
-
//http://wordpress.org/support/topic/warning-division-by-zero-in-4?replies=2
|
1373 |
-
if ($number_of_votes < 1) {
|
1374 |
-
$number_of_votes = 1;
|
1375 |
-
}
|
1376 |
|
|
|
1377 |
|
1378 |
-
|
1379 |
-
$new_sum = $old_votes_sum - $old_vote;
|
1380 |
|
1381 |
-
|
1382 |
-
$new_sum = $new_sum + $new_rating;
|
1383 |
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
'sum_votes' => $new_sum
|
1389 |
-
),
|
1390 |
-
array (
|
1391 |
-
'post_id' => $post_id
|
1392 |
-
),
|
1393 |
-
array( '%s' ),
|
1394 |
-
array( '%d' )
|
1395 |
-
);
|
1396 |
|
|
|
|
|
1397 |
|
1398 |
-
|
1399 |
-
$update_log = $wpdb->update (
|
1400 |
-
YASR_LOG_TABLE,
|
1401 |
-
array (
|
1402 |
-
'vote' => $new_rating
|
1403 |
-
),
|
1404 |
-
array (
|
1405 |
-
'post_id' => $post_id,
|
1406 |
-
'user_id' => $current_user->ID
|
1407 |
-
),
|
1408 |
-
array( '%s' ),
|
1409 |
-
array( '%d', '%d' )
|
1410 |
-
);
|
1411 |
|
|
|
1412 |
|
1413 |
-
|
1414 |
-
|
1415 |
|
1416 |
-
|
|
|
|
|
1417 |
|
1418 |
-
if (YASR_VISITORS_STATS === 'yes') {
|
1419 |
-
echo "<span class=\"yasr-total-average-text\"><span class=\"dashicons dashicons-chart-bar\" id=\"yasr-total-average-$post_id\"></span>[" . __("Total: ", 'yet-another-stars-rating') . "$number_of_votes " . __("Average: " , 'yet-another-stars-rating') . "$medium_rating/5]</span>";
|
1420 |
}
|
1421 |
|
1422 |
-
echo "<span class=\"yasr-small-block-bold\" id=\"yasr-already-voted-text\">" . __("Vote updated", 'yet-another-stars-rating') . "</span>";
|
1423 |
-
|
1424 |
die(); // this is required to return a proper result
|
1425 |
|
1426 |
}
|
1427 |
|
1428 |
-
|
1429 |
/****** Get Multiple value from visitor and insert into db, used in yasr-shortcode-functions ******/
|
1430 |
|
1431 |
add_action( 'wp_ajax_yasr_visitor_multiset_field_vote', 'yasr_visitor_multiset_field_vote_callback' );
|
1161 |
die( 'Security check' );
|
1162 |
}
|
1163 |
|
|
|
|
|
|
|
1164 |
if ($rating < 1) {
|
1165 |
_e("Error: you can't vote 0", 'yet-another-stars-rating');
|
1166 |
die();
|
1189 |
|
1190 |
global $wpdb;
|
1191 |
|
1192 |
+
$current_user = wp_get_current_user();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1193 |
|
1194 |
+
$ip_adress = yasr_get_ip();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1195 |
|
1196 |
+
$result_update_log = NULL; //avoid undefined
|
1197 |
+
$result_insert_log = NULL; //avoid undefined
|
1198 |
|
1199 |
+
if (is_user_logged_in()) {
|
|
|
|
|
1200 |
|
1201 |
+
//try to update first, if fails the do the insert
|
1202 |
+
$result_update_log = $wpdb->update (
|
1203 |
|
1204 |
+
YASR_LOG_TABLE,
|
|
|
1205 |
array (
|
1206 |
'post_id' => $post_id,
|
1207 |
'multi_set_id' => -1,
|
1210 |
'date' => date('Y-m-d H:i:s'),
|
1211 |
'ip' => $ip_adress
|
1212 |
),
|
1213 |
+
array (
|
1214 |
+
'post_id' => $post_id,
|
1215 |
+
'user_id' => $current_user->ID
|
1216 |
+
),
|
1217 |
+
array ('%d', '%d', '%d', '%s', '%s', '%s'),
|
1218 |
+
array ('%d', '%d')
|
1219 |
+
|
1220 |
+
);
|
1221 |
+
|
1222 |
+
//insert the new row
|
1223 |
+
if (!$result_update_log) {
|
1224 |
+
|
1225 |
+
$result_insert_log = $wpdb->insert (
|
1226 |
+
YASR_LOG_TABLE,
|
1227 |
+
array (
|
1228 |
+
'post_id' => $post_id,
|
1229 |
+
'multi_set_id' => -1,
|
1230 |
+
'user_id' => $current_user->ID,
|
1231 |
+
'vote' => $rating,
|
1232 |
+
'date' => date('Y-m-d H:i:s'),
|
1233 |
+
'ip' => $ip_adress
|
1234 |
+
),
|
1235 |
+
array ('%d', '%d', '%d', '%s', '%s', '%s')
|
1236 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1237 |
|
1238 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1239 |
|
|
|
1240 |
|
1241 |
+
}
|
1242 |
|
1243 |
+
//if user is not logged in insert
|
1244 |
+
else {
|
1245 |
|
1246 |
+
//be sure that allow anonymous is on
|
1247 |
+
if (YASR_ALLOWED_USER === 'allow_anonymous')
|
1248 |
|
1249 |
+
$result_insert_log = $wpdb->replace (
|
1250 |
+
YASR_LOG_TABLE,
|
1251 |
+
array (
|
1252 |
+
'post_id' => $post_id,
|
1253 |
+
'multi_set_id' => -1,
|
1254 |
+
'user_id' => $current_user->ID,
|
1255 |
+
'vote' => $rating,
|
1256 |
+
'date' => date('Y-m-d H:i:s'),
|
1257 |
+
'ip' => $ip_adress
|
1258 |
+
),
|
1259 |
|
1260 |
+
array ('%d', '%d', '%d', '%s', '%s', '%s')
|
1261 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1262 |
|
1263 |
+
}
|
1264 |
|
1265 |
+
if($result_update_log || $result_insert_log) {
|
|
|
1266 |
|
1267 |
+
$row_exists = yasr_get_visitor_votes ($post_id, $create_transient=FALSE);
|
|
|
1268 |
|
1269 |
+
foreach ($row_exists as $results) {
|
1270 |
+
$stored_user_votes_sum = $results->sum_votes;
|
1271 |
+
$stored_number_of_votes = $results->number_of_votes;
|
1272 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1273 |
|
1274 |
+
$user_votes_sum = $stored_user_votes_sum;
|
1275 |
+
$number_of_votes = $stored_number_of_votes;
|
1276 |
|
1277 |
+
$cookiename = "yasr_visitor_vote_" . $post_id;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1278 |
|
1279 |
+
yasr_setcookie($cookiename, $rating);
|
1280 |
|
1281 |
+
$total_rating = ($user_votes_sum / $number_of_votes);
|
1282 |
+
$medium_rating = round ($total_rating, 1);
|
1283 |
|
1284 |
+
echo "<div class=\"$rateit_class\" id=\"yasr_rateit_user_votes_voted\" data-rateit-starwidth=\"$px_size\" data-rateit-starheight=\"$px_size\" data-rateit-value=\"$total_rating\" data-rateit-resetable=\"false\" data-rateit-readonly=\"true\"></div>
|
1285 |
+
<span class=\"yasr-total-average-text\" title=\"yasr-stats\"> [" . __("Total: ", 'yet-another-stars-rating') . "$number_of_votes " . __("Average:", 'yet-another-stars-rating') . " $medium_rating/5 ]</span>
|
1286 |
+
<span class=\"yasr-small-block-bold\" id=\"yasr-vote-saved\">" . __("Vote Saved" , 'yet-another-stars-rating') . "</span>";
|
1287 |
|
|
|
|
|
1288 |
}
|
1289 |
|
|
|
|
|
1290 |
die(); // this is required to return a proper result
|
1291 |
|
1292 |
}
|
1293 |
|
|
|
1294 |
/****** Get Multiple value from visitor and insert into db, used in yasr-shortcode-functions ******/
|
1295 |
|
1296 |
add_action( 'wp_ajax_yasr_visitor_multiset_field_vote', 'yasr_visitor_multiset_field_vote_callback' );
|
lib/yasr-db-functions.php
CHANGED
@@ -26,23 +26,11 @@ function yasr_install() {
|
|
26 |
|
27 |
$prefix=$wpdb->prefix . 'yasr_'; //Table prefix
|
28 |
|
29 |
-
$yasr_votes_table = $prefix . 'votes';
|
30 |
$yasr_multi_set_table = $prefix . 'multi_set';
|
31 |
$yasr_multi_set_fields = $prefix . 'multi_set_fields';
|
32 |
$yasr_multi_values_table = $prefix . 'multi_values';
|
33 |
$yasr_log_table = $prefix . 'log';
|
34 |
|
35 |
-
$sql_yasr_votes_table = "CREATE TABLE IF NOT EXISTS $yasr_votes_table (
|
36 |
-
id bigint(20) NOT NULL AUTO_INCREMENT,
|
37 |
-
post_id bigint(20) NOT NULL,
|
38 |
-
overall_rating decimal(2,1) NOT NULL,
|
39 |
-
number_of_votes bigint(20) NOT NULL,
|
40 |
-
sum_votes decimal(11,1) NOT NULL,
|
41 |
-
review_type VARCHAR(10),
|
42 |
-
PRIMARY KEY (id),
|
43 |
-
UNIQUE KEY post_id (post_id)
|
44 |
-
);";
|
45 |
-
|
46 |
$sql_yasr_multi_set_table= "CREATE TABLE IF NOT EXISTS $yasr_multi_set_table (
|
47 |
set_id int(2) NOT NULL,
|
48 |
set_name varchar(64) COLLATE utf8_unicode_ci NOT NULL,
|
@@ -86,7 +74,6 @@ function yasr_install() {
|
|
86 |
|
87 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
88 |
|
89 |
-
dbDelta( $sql_yasr_votes_table );
|
90 |
dbDelta( $sql_yasr_multi_set_table );
|
91 |
dbDelta( $sql_yasr_multi_set_fields );
|
92 |
dbDelta( $sql_yasr_multi_value_table );
|
@@ -345,7 +332,7 @@ function yasr_get_visitor_votes ($post_id=FALSE, $create_transient=TRUE) {
|
|
345 |
|
346 |
else {
|
347 |
|
348 |
-
$result = $wpdb->get_results($wpdb->prepare("SELECT
|
349 |
|
350 |
if ($create_transient == TRUE) {
|
351 |
|
26 |
|
27 |
$prefix=$wpdb->prefix . 'yasr_'; //Table prefix
|
28 |
|
|
|
29 |
$yasr_multi_set_table = $prefix . 'multi_set';
|
30 |
$yasr_multi_set_fields = $prefix . 'multi_set_fields';
|
31 |
$yasr_multi_values_table = $prefix . 'multi_values';
|
32 |
$yasr_log_table = $prefix . 'log';
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
$sql_yasr_multi_set_table= "CREATE TABLE IF NOT EXISTS $yasr_multi_set_table (
|
35 |
set_id int(2) NOT NULL,
|
36 |
set_name varchar(64) COLLATE utf8_unicode_ci NOT NULL,
|
74 |
|
75 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
76 |
|
|
|
77 |
dbDelta( $sql_yasr_multi_set_table );
|
78 |
dbDelta( $sql_yasr_multi_set_fields );
|
79 |
dbDelta( $sql_yasr_multi_value_table );
|
332 |
|
333 |
else {
|
334 |
|
335 |
+
$result = $wpdb->get_results($wpdb->prepare("SELECT SUM(vote) AS sum_votes, COUNT(vote) as number_of_votes FROM " . YASR_LOG_TABLE . " WHERE post_id=%d", $post_id));
|
336 |
|
337 |
if ($create_transient == TRUE) {
|
338 |
|
lib/yasr-widgets.php
CHANGED
@@ -436,7 +436,6 @@ class Yasr_Recent_Ratings_Widget extends WP_Widget {
|
|
436 |
|
437 |
if ($log_result) {
|
438 |
|
439 |
-
|
440 |
$widget_recent_ratings = "<table class=\"yasr-widget-recent-ratings-table\">";
|
441 |
|
442 |
foreach ($log_result as $result) {
|
@@ -458,7 +457,9 @@ class Yasr_Recent_Ratings_Widget extends WP_Widget {
|
|
458 |
$widget_recent_ratings .= "<tr>
|
459 |
<td width=\"40%\" class=\"yasr-widget-recent-ratings-td\">";
|
460 |
|
461 |
-
$widget_recent_ratings .= sprintf(__('Vote %s from %s on
|
|
|
|
|
462 |
|
463 |
$widget_recent_ratings .= "</td>
|
464 |
</tr>";
|
@@ -470,7 +471,6 @@ class Yasr_Recent_Ratings_Widget extends WP_Widget {
|
|
470 |
|
471 |
}
|
472 |
|
473 |
-
|
474 |
echo $widget_recent_ratings;
|
475 |
|
476 |
echo $args['after_widget'];
|
436 |
|
437 |
if ($log_result) {
|
438 |
|
|
|
439 |
$widget_recent_ratings = "<table class=\"yasr-widget-recent-ratings-table\">";
|
440 |
|
441 |
foreach ($log_result as $result) {
|
457 |
$widget_recent_ratings .= "<tr>
|
458 |
<td width=\"40%\" class=\"yasr-widget-recent-ratings-td\">";
|
459 |
|
460 |
+
$widget_recent_ratings .= sprintf(__('Vote %s from %s on', 'yet-another-stars-rating'), '<span class="yasr-widget-recent-ratings-text">'. $vote . '</span>',
|
461 |
+
'<span class="yasr-widget-recent-ratings-text">' . $user->user_login . '</span>') .
|
462 |
+
'<span class="yasr-widget-recent-ratings-text"><a href="'.$link.'"> ' . $title_post . ' </a></span>';
|
463 |
|
464 |
$widget_recent_ratings .= "</td>
|
465 |
</tr>";
|
471 |
|
472 |
}
|
473 |
|
|
|
474 |
echo $widget_recent_ratings;
|
475 |
|
476 |
echo $args['after_widget'];
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: 5 star, admin, administrator, AJAX, five-star, javascript, jquery, post r
|
|
4 |
Requires at least: 4.3.0
|
5 |
Contributors: Dudo
|
6 |
Tested up to: 4.6
|
7 |
-
Stable tag: 1.3.
|
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
|
@@ -113,6 +113,11 @@ Of course not: you can easily add it on the visual editor just by clicking the "
|
|
113 |
|
114 |
The full changelog can be found in the plugin's directory. Recent entries:
|
115 |
|
|
|
|
|
|
|
|
|
|
|
116 |
= 1.3.5 =
|
117 |
* TWEAKED: READ CAREFULLY: this is the first step of an important yasr database change: the main goal is to switch from yasr_votes table to wordpress default post_meta.
|
118 |
A database backup is strongly suggested.
|
@@ -140,14 +145,3 @@ A database backup is strongly suggested.
|
|
140 |
* TWEAKED: Flat stars set is the new default theme
|
141 |
* Minor changes
|
142 |
|
143 |
-
= 1.2.7 =
|
144 |
-
* NEW FEATURE: a new flat stars set has been added! (Just go in the Yasr settings, --> Aspect & Styles, and choose the one you want!)
|
145 |
-
* TWEAKED: added filter and action on yasr style settings page
|
146 |
-
* TWEAKED: CSS changes. *** DELETE ALL YOUR CACHES ***
|
147 |
-
* TWEAKED: added class yasr-visitor-votes-must-sign-in on "You must sign in to vote" text
|
148 |
-
|
149 |
-
= 1.2.6 =
|
150 |
-
* TWEAKED: removed get_currentuserinfo to use wp_get_current_user()
|
151 |
-
* TWEAKED: removed unused div on yasr_most_or_highest_rated shortcode
|
152 |
-
* TWEAKED: minor changes on rankings shortcodes
|
153 |
-
* TWEAKED: added $rating on action yasr_action_on_visitor_vote, yasr_action_on_update_visitor_vote and yasr_action_on_overall_rating
|
4 |
Requires at least: 4.3.0
|
5 |
Contributors: Dudo
|
6 |
Tested up to: 4.6
|
7 |
+
Stable tag: 1.3.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
|
113 |
|
114 |
The full changelog can be found in the plugin's directory. Recent entries:
|
115 |
|
116 |
+
= 1.3.6 =
|
117 |
+
* TWEAKED: yasr_visitor_votes doesn't use anymore yasr_votes table. It use only yasr_log instead. From this version, yasr_votes is not created anymore. If after this update everything is ok, if you wish you can drop yasr_votes table
|
118 |
+
* TWEAKED: add the link to the post on yasr recent ratings widget
|
119 |
+
* TWEAKED: huge code cleanup
|
120 |
+
|
121 |
= 1.3.5 =
|
122 |
* TWEAKED: READ CAREFULLY: this is the first step of an important yasr database change: the main goal is to switch from yasr_votes table to wordpress default post_meta.
|
123 |
A database backup is strongly suggested.
|
145 |
* TWEAKED: Flat stars set is the new default theme
|
146 |
* Minor changes
|
147 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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: Yet Another Stars Rating turn your WordPress into a complete review website.
|
6 |
-
* Version: 1.3.
|
7 |
* Author: Dario Curvino
|
8 |
* Author URI: https://yetanotherstarsrating.com/
|
9 |
* Text Domain: yet-another-stars-rating
|
@@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
31 |
|
32 |
if ( ! defined( 'ABSPATH' ) ) exit('You\'re not allowed to see this page'); // Exit if accessed directly
|
33 |
|
34 |
-
define('YASR_VERSION_NUM', '1.3.
|
35 |
|
36 |
//Plugin relative path
|
37 |
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: Yet Another Stars Rating turn your WordPress into a complete review website.
|
6 |
+
* Version: 1.3.6
|
7 |
* Author: Dario Curvino
|
8 |
* Author URI: https://yetanotherstarsrating.com/
|
9 |
* Text Domain: yet-another-stars-rating
|
31 |
|
32 |
if ( ! defined( 'ABSPATH' ) ) exit('You\'re not allowed to see this page'); // Exit if accessed directly
|
33 |
|
34 |
+
define('YASR_VERSION_NUM', '1.3.6');
|
35 |
|
36 |
//Plugin relative path
|
37 |
define( "YASR_ABSOLUTE_PATH", dirname(__FILE__) );
|