Yasr – Yet Another Stars Rating - Version 2.2.9

Version Description

  • FIXED: in the editor screen, if a Multi Set already has ratings, and then try to update only one, all the other fields where reset
  • ENHANCEMENT: rich snippet are returned only if a YASR shortcode is in the post or page
  • ENHANCEMENT: changed classes names star-rating and star-value in yasr-star-rating and yasr-star-value. DELETE YOUR BROWSER CACHE
Download this release

Release Info

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

Code changes from version 2.2.8 to 2.2.9

css/yasr-admin.css CHANGED
@@ -1,4 +1,4 @@
1
- .star-rating {
2
width: 0;
3
position: relative;
4
display: inline-block;
@@ -7,7 +7,7 @@
7
background-repeat: repeat-x;
8
}
9
10
- .star-rating[data-title]:hover:after {
11
content: attr(data-title);
12
padding: 4px 8px;
13
color: #333;
@@ -30,12 +30,12 @@
30
background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
31
}
32
33
- .star-rating .star-value {
34
height: 100%;
35
position: absolute;
36
}
37
38
- .star-rating .star-value {
39
position: absolute;
40
height: 100%;
41
width: 100%;
1
+ .yasr-star-rating {
2
width: 0;
3
position: relative;
4
display: inline-block;
7
background-repeat: repeat-x;
8
}
9
10
+ .yasr-star-rating[data-title]:hover:after {
11
content: attr(data-title);
12
padding: 4px 8px;
13
color: #333;
30
background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
31
}
32
33
+ .yasr-star-rating .yasr-star-value {
34
height: 100%;
35
position: absolute;
36
}
37
38
+ .yasr-star-rating .yasr-star-value {
39
position: absolute;
40
height: 100%;
41
width: 100%;
css/yasr.css CHANGED
@@ -1,4 +1,4 @@
1
- .star-rating {
2
width: 0;
3
position: relative;
4
display:inline-block;
@@ -6,7 +6,7 @@
6
background-repeat: repeat-x;
7
}
8
9
- .star-rating[data-title]:hover:after {
10
content: attr(data-title);
11
padding: 4px 8px;
12
color: #333;
@@ -29,23 +29,23 @@
29
background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
30
}
31
32
- .star-rating .star-value {
33
height: 100%;
34
position: absolute;
35
}
36
37
- .star-rating .star-value {
38
position: absolute;
39
height: 100%;
40
width: 100%;
41
background-repeat: repeat-x;
42
}
43
44
- .star-rating::before {
45
content: none !important;
46
}
47
48
- .star-value::before {
49
content: none !important;
50
}
51
/****** NON ADMIN RULES ******/
1
+ .yasr-star-rating {
2
width: 0;
3
position: relative;
4
display:inline-block;
6
background-repeat: repeat-x;
7
}
8
9
+ .yasr-star-rating[data-title]:hover:after {
10
content: attr(data-title);
11
padding: 4px 8px;
12
color: #333;
29
background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
30
}
31
32
+ .yasr-star-rating .yasr-star-value {
33
height: 100%;
34
position: absolute;
35
}
36
37
+ .yasr-star-rating .yasr-star-value {
38
position: absolute;
39
height: 100%;
40
width: 100%;
41
background-repeat: repeat-x;
42
}
43
44
+ .yasr-star-rating::before {
45
content: none !important;
46
}
47
48
+ .yasr-star-value::before {
49
content: none !important;
50
}
51
/****** NON ADMIN RULES ******/
js/rater-js-rtl.js CHANGED
@@ -30,9 +30,9 @@
30
var rating;
31
var myRating;
32
var elem = options.element;
33
- elem.classList.add("star-rating");
34
var div = document.createElement("div");
35
- div.classList.add("star-value");
36
div.style.backgroundSize = starSize + "px";
37
elem.appendChild(div);
38
elem.style.width = starSize * stars + "px";
@@ -69,7 +69,7 @@
69
}
70
71
if (typeof rating === "undefined") {
72
- elem.querySelector(".star-value").style.width = "0px";
73
}
74
75
if (disabled) {
@@ -110,7 +110,7 @@
110
currentRating = 5;
111
}
112
113
- elem.querySelector(".star-value").style.width = currentRating / stars * 100 + "%";
114
115
if (showToolTip) {
116
var toolTip = ratingText.replace("{rating}", currentRating);
@@ -127,10 +127,10 @@
127
128
function onStarOut(e) {
129
if (typeof rating !== "undefined") {
130
- elem.querySelector(".star-value").style.width = rating / stars * 100 + "%";
131
elem.setAttribute("data-rating", rating);
132
} else {
133
- elem.querySelector(".star-value").style.width = "0%";
134
elem.removeAttribute("data-rating");
135
}
136
@@ -203,7 +203,7 @@
203
}
204
205
rating = value;
206
- elem.querySelector(".star-value").style.width = value / stars * 100 + "%";
207
elem.setAttribute("data-rating", value);
208
}
209
@@ -232,7 +232,7 @@
232
};
233
234
},{"./style.css":2}],2:[function(require,module,exports){
235
- var css = ".star-rating {\n width: 0;\n position: relative;\n display: inline-block;\n background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDguOSIgaGVpZ2h0PSIxMDMuNiIgdmlld0JveD0iMCAwIDEwOC45IDEwMy42Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2UzZTZlNjt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPnN0YXJfMDwvdGl0bGU+PGcgaWQ9IkxheWVyXzIiIGRhdGEtbmFtZT0iTGF5ZXIgMiI+PGcgaWQ9IkxheWVyXzEtMiIgZGF0YS1uYW1lPSJMYXllciAxIj48cG9seWdvbiBjbGFzcz0iY2xzLTEiIHBvaW50cz0iMTA4LjkgMzkuNiA3MS4zIDM0LjEgNTQuNCAwIDM3LjYgMzQuMSAwIDM5LjYgMjcuMiA2Ni4xIDIwLjggMTAzLjYgNTQuNCA4NS45IDg4LjEgMTAzLjYgODEuNyA2Ni4xIDEwOC45IDM5LjYiLz48L2c+PC9nPjwvc3ZnPgo=);\n background-position: 0 0;\n background-repeat: repeat-x;\n cursor: pointer;\n}\n.star-rating[data-title]:hover:after {\n content: attr(data-title);\n padding: 4px 8px;\n color: #333;\n position: absolute;\n left: 0;\n top: 100%;\n z-index: 20;\n white-space: nowrap;\n -moz-border-radius: 5px;\n -webkit-border-radius: 5px;\n border-radius: 5px;\n -moz-box-shadow: 0px 0px 4px #222;\n -webkit-box-shadow: 0px 0px 4px #222;\n box-shadow: 0px 0px 4px #222;\n background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);\n background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #eeeeee),color-stop(1, #cccccc));\n background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);\n background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);\n background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);\n background-image: -o-linear-gradient(top, #eeeeee, #cccccc);\n}\n.star-rating .star-value {\n height: 100%;\n position: absolute;\n}\n.star-rating .star-value {\n position: absolute;\n height: 100%;\n width: 100%;\n background: url('data:image/svg+xml;base64,PHN2ZwoJeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMTA4LjkiIGhlaWdodD0iMTAzLjYiIHZpZXdCb3g9IjAgMCAxMDguOSAxMDMuNiI+Cgk8ZGVmcz4KCQk8c3R5bGU+LmNscy0xe2ZpbGw6I2YxYzk0Nzt9PC9zdHlsZT4KCTwvZGVmcz4KCTx0aXRsZT5zdGFyMTwvdGl0bGU+Cgk8ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIj4KCQk8ZyBpZD0iTGF5ZXJfMS0yIiBkYXRhLW5hbWU9IkxheWVyIDEiPgoJCQk8cG9seWdvbiBjbGFzcz0iY2xzLTEiIHBvaW50cz0iNTQuNCAwIDcxLjMgMzQuMSAxMDguOSAzOS42IDgxLjcgNjYuMSA4OC4xIDEwMy42IDU0LjQgODUuOSAyMC44IDEwMy42IDI3LjIgNjYuMSAwIDM5LjYgMzcuNiAzNC4xIDU0LjQgMCIvPgoJCTwvZz4KCTwvZz4KPC9zdmc+Cg==');\n background-repeat: repeat-x;\n}\n"; (require("browserify-css").createStyle(css, { "href": "lib\\style.css" }, { "insertAt": "bottom" })); module.exports = css;
236
},{"browserify-css":3}],3:[function(require,module,exports){
237
'use strict';
238
// For more information about browser field, check out the browser field at https://github.com/substack/browserify-handbook#browser-field.
30
var rating;
31
var myRating;
32
var elem = options.element;
33
+ elem.classList.add("yasr-star-rating");
34
var div = document.createElement("div");
35
+ div.classList.add("yasr-star-value");
36
div.style.backgroundSize = starSize + "px";
37
elem.appendChild(div);
38
elem.style.width = starSize * stars + "px";
69
}
70
71
if (typeof rating === "undefined") {
72
+ elem.querySelector(".yasr-star-value").style.width = "0px";
73
}
74
75
if (disabled) {
110
currentRating = 5;
111
}
112
113
+ elem.querySelector(".yasr-star-value").style.width = currentRating / stars * 100 + "%";
114
115
if (showToolTip) {
116
var toolTip = ratingText.replace("{rating}", currentRating);
127
128
function onStarOut(e) {
129
if (typeof rating !== "undefined") {
130
+ elem.querySelector(".yasr-star-value").style.width = rating / stars * 100 + "%";
131
elem.setAttribute("data-rating", rating);
132
} else {
133
+ elem.querySelector(".yasr-star-value").style.width = "0%";
134
elem.removeAttribute("data-rating");
135
}
136
203
}
204
205
rating = value;
206
+ elem.querySelector(".yasr-star-value").style.width = value / stars * 100 + "%";
207
elem.setAttribute("data-rating", value);
208
}
209
232
};
233
234
},{"./style.css":2}],2:[function(require,module,exports){
235
+ var css = ".yasr-star-rating {\n width: 0;\n position: relative;\n display: inline-block;\n background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDguOSIgaGVpZ2h0PSIxMDMuNiIgdmlld0JveD0iMCAwIDEwOC45IDEwMy42Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2UzZTZlNjt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPnN0YXJfMDwvdGl0bGU+PGcgaWQ9IkxheWVyXzIiIGRhdGEtbmFtZT0iTGF5ZXIgMiI+PGcgaWQ9IkxheWVyXzEtMiIgZGF0YS1uYW1lPSJMYXllciAxIj48cG9seWdvbiBjbGFzcz0iY2xzLTEiIHBvaW50cz0iMTA4LjkgMzkuNiA3MS4zIDM0LjEgNTQuNCAwIDM3LjYgMzQuMSAwIDM5LjYgMjcuMiA2Ni4xIDIwLjggMTAzLjYgNTQuNCA4NS45IDg4LjEgMTAzLjYgODEuNyA2Ni4xIDEwOC45IDM5LjYiLz48L2c+PC9nPjwvc3ZnPgo=);\n background-position: 0 0;\n background-repeat: repeat-x;\n cursor: pointer;\n}\n.yasr-star-rating[data-title]:hover:after {\n content: attr(data-title);\n padding: 4px 8px;\n color: #333;\n position: absolute;\n left: 0;\n top: 100%;\n z-index: 20;\n white-space: nowrap;\n -moz-border-radius: 5px;\n -webkit-border-radius: 5px;\n border-radius: 5px;\n -moz-box-shadow: 0px 0px 4px #222;\n -webkit-box-shadow: 0px 0px 4px #222;\n box-shadow: 0px 0px 4px #222;\n background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);\n background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #eeeeee),color-stop(1, #cccccc));\n background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);\n background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);\n background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);\n background-image: -o-linear-gradient(top, #eeeeee, #cccccc);\n}\n.yasr-star-rating .yasr-star-value {\n height: 100%;\n position: absolute;\n}\n.yasr-star-rating .yasr-star-value {\n position: absolute;\n height: 100%;\n width: 100%;\n background: url('data:image/svg+xml;base64,PHN2ZwoJeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMTA4LjkiIGhlaWdodD0iMTAzLjYiIHZpZXdCb3g9IjAgMCAxMDguOSAxMDMuNiI+Cgk8ZGVmcz4KCQk8c3R5bGU+LmNscy0xe2ZpbGw6I2YxYzk0Nzt9PC9zdHlsZT4KCTwvZGVmcz4KCTx0aXRsZT5zdGFyMTwvdGl0bGU+Cgk8ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIj4KCQk8ZyBpZD0iTGF5ZXJfMS0yIiBkYXRhLW5hbWU9IkxheWVyIDEiPgoJCQk8cG9seWdvbiBjbGFzcz0iY2xzLTEiIHBvaW50cz0iNTQuNCAwIDcxLjMgMzQuMSAxMDguOSAzOS42IDgxLjcgNjYuMSA4OC4xIDEwMy42IDU0LjQgODUuOSAyMC44IDEwMy42IDI3LjIgNjYuMSAwIDM5LjYgMzcuNiAzNC4xIDU0LjQgMCIvPgoJCTwvZz4KCTwvZz4KPC9zdmc+Cg==');\n background-repeat: repeat-x;\n}\n"; (require("browserify-css").createStyle(css, { "href": "lib\\style.css" }, { "insertAt": "bottom" })); module.exports = css;
236
},{"browserify-css":3}],3:[function(require,module,exports){
237
'use strict';
238
// For more information about browser field, check out the browser field at https://github.com/substack/browserify-handbook#browser-field.
js/rater-js.js CHANGED
@@ -30,9 +30,9 @@
30
var rating;
31
var myRating;
32
var elem = options.element;
33
- elem.classList.add("star-rating");
34
var div = document.createElement("div");
35
- div.classList.add("star-value");
36
div.style.backgroundSize = starSize + "px";
37
elem.appendChild(div);
38
elem.style.width = starSize * stars + "px";
@@ -69,7 +69,7 @@
69
}
70
71
if (typeof rating === "undefined") {
72
- elem.querySelector(".star-value").style.width = "0px";
73
}
74
75
if (disabled) {
@@ -100,7 +100,7 @@
100
}
101
}
102
103
- elem.querySelector(".star-value").style.width = currentRating / stars * 100 + "%";
104
105
if (showToolTip) {
106
var toolTip = ratingText.replace("{rating}", currentRating);
@@ -116,10 +116,10 @@
116
117
function onStarOut(e) {
118
if (typeof rating !== "undefined") {
119
- elem.querySelector(".star-value").style.width = rating / stars * 100 + "%";
120
elem.setAttribute("data-rating", rating);
121
} else {
122
- elem.querySelector(".star-value").style.width = "0%";
123
elem.removeAttribute("data-rating");
124
}
125
@@ -192,7 +192,7 @@
192
}
193
194
rating = value;
195
- elem.querySelector(".star-value").style.width = value / stars * 100 + "%";
196
elem.setAttribute("data-rating", value);
197
}
198
@@ -221,7 +221,7 @@
221
};
222
223
},{"./style.css":2}],2:[function(require,module,exports){
224
- var css = ".star-rating {\n width: 0;\n position: relative;\n display: inline-block;\n background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDguOSIgaGVpZ2h0PSIxMDMuNiIgdmlld0JveD0iMCAwIDEwOC45IDEwMy42Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2UzZTZlNjt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPnN0YXJfMDwvdGl0bGU+PGcgaWQ9IkxheWVyXzIiIGRhdGEtbmFtZT0iTGF5ZXIgMiI+PGcgaWQ9IkxheWVyXzEtMiIgZGF0YS1uYW1lPSJMYXllciAxIj48cG9seWdvbiBjbGFzcz0iY2xzLTEiIHBvaW50cz0iMTA4LjkgMzkuNiA3MS4zIDM0LjEgNTQuNCAwIDM3LjYgMzQuMSAwIDM5LjYgMjcuMiA2Ni4xIDIwLjggMTAzLjYgNTQuNCA4NS45IDg4LjEgMTAzLjYgODEuNyA2Ni4xIDEwOC45IDM5LjYiLz48L2c+PC9nPjwvc3ZnPgo=);\n background-position: 0 0;\n background-repeat: repeat-x;\n cursor: pointer;\n}\n.star-rating[data-title]:hover:after {\n content: attr(data-title);\n padding: 4px 8px;\n color: #333;\n position: absolute;\n left: 0;\n top: 100%;\n z-index: 20;\n white-space: nowrap;\n -moz-border-radius: 5px;\n -webkit-border-radius: 5px;\n border-radius: 5px;\n -moz-box-shadow: 0px 0px 4px #222;\n -webkit-box-shadow: 0px 0px 4px #222;\n box-shadow: 0px 0px 4px #222;\n background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);\n background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #eeeeee),color-stop(1, #cccccc));\n background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);\n background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);\n background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);\n background-image: -o-linear-gradient(top, #eeeeee, #cccccc);\n}\n.star-rating .star-value {\n height: 100%;\n position: absolute;\n}\n.star-rating .star-value {\n position: absolute;\n height: 100%;\n width: 100%;\n background: url('data:image/svg+xml;base64,PHN2ZwoJeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMTA4LjkiIGhlaWdodD0iMTAzLjYiIHZpZXdCb3g9IjAgMCAxMDguOSAxMDMuNiI+Cgk8ZGVmcz4KCQk8c3R5bGU+LmNscy0xe2ZpbGw6I2YxYzk0Nzt9PC9zdHlsZT4KCTwvZGVmcz4KCTx0aXRsZT5zdGFyMTwvdGl0bGU+Cgk8ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIj4KCQk8ZyBpZD0iTGF5ZXJfMS0yIiBkYXRhLW5hbWU9IkxheWVyIDEiPgoJCQk8cG9seWdvbiBjbGFzcz0iY2xzLTEiIHBvaW50cz0iNTQuNCAwIDcxLjMgMzQuMSAxMDguOSAzOS42IDgxLjcgNjYuMSA4OC4xIDEwMy42IDU0LjQgODUuOSAyMC44IDEwMy42IDI3LjIgNjYuMSAwIDM5LjYgMzcuNiAzNC4xIDU0LjQgMCIvPgoJCTwvZz4KCTwvZz4KPC9zdmc+Cg==');\n background-repeat: repeat-x;\n}\n"; (require("browserify-css").createStyle(css, { "href": "lib\\style.css" }, { "insertAt": "bottom" })); module.exports = css;
225
},{"browserify-css":3}],3:[function(require,module,exports){
226
'use strict';
227
// For more information about browser field, check out the browser field at https://github.com/substack/browserify-handbook#browser-field.
30
var rating;
31
var myRating;
32
var elem = options.element;
33
+ elem.classList.add("yasr-star-rating");
34
var div = document.createElement("div");
35
+ div.classList.add("yasr-star-value");
36
div.style.backgroundSize = starSize + "px";
37
elem.appendChild(div);
38
elem.style.width = starSize * stars + "px";
69
}
70
71
if (typeof rating === "undefined") {
72
+ elem.querySelector(".yasr-star-value").style.width = "0px";
73
}
74
75
if (disabled) {
100
}
101
}
102
103
+ elem.querySelector(".yasr-star-value").style.width = currentRating / stars * 100 + "%";
104
105
if (showToolTip) {
106
var toolTip = ratingText.replace("{rating}", currentRating);
116
117
function onStarOut(e) {
118
if (typeof rating !== "undefined") {
119
+ elem.querySelector(".yasr-star-value").style.width = rating / stars * 100 + "%";
120
elem.setAttribute("data-rating", rating);
121
} else {
122
+ elem.querySelector(".yasr-star-value").style.width = "0%";
123
elem.removeAttribute("data-rating");
124
}
125
192
}
193
194
rating = value;
195
+ elem.querySelector(".yasr-star-value").style.width = value / stars * 100 + "%";
196
elem.setAttribute("data-rating", value);
197
}
198
221
};
222
223
},{"./style.css":2}],2:[function(require,module,exports){
224
+ var css = ".yasr-star-rating {\n width: 0;\n position: relative;\n display: inline-block;\n background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDguOSIgaGVpZ2h0PSIxMDMuNiIgdmlld0JveD0iMCAwIDEwOC45IDEwMy42Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2UzZTZlNjt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPnN0YXJfMDwvdGl0bGU+PGcgaWQ9IkxheWVyXzIiIGRhdGEtbmFtZT0iTGF5ZXIgMiI+PGcgaWQ9IkxheWVyXzEtMiIgZGF0YS1uYW1lPSJMYXllciAxIj48cG9seWdvbiBjbGFzcz0iY2xzLTEiIHBvaW50cz0iMTA4LjkgMzkuNiA3MS4zIDM0LjEgNTQuNCAwIDM3LjYgMzQuMSAwIDM5LjYgMjcuMiA2Ni4xIDIwLjggMTAzLjYgNTQuNCA4NS45IDg4LjEgMTAzLjYgODEuNyA2Ni4xIDEwOC45IDM5LjYiLz48L2c+PC9nPjwvc3ZnPgo=);\n background-position: 0 0;\n background-repeat: repeat-x;\n cursor: pointer;\n}\n.yasr-star-rating[data-title]:hover:after {\n content: attr(data-title);\n padding: 4px 8px;\n color: #333;\n position: absolute;\n left: 0;\n top: 100%;\n z-index: 20;\n white-space: nowrap;\n -moz-border-radius: 5px;\n -webkit-border-radius: 5px;\n border-radius: 5px;\n -moz-box-shadow: 0px 0px 4px #222;\n -webkit-box-shadow: 0px 0px 4px #222;\n box-shadow: 0px 0px 4px #222;\n background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);\n background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #eeeeee),color-stop(1, #cccccc));\n background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);\n background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);\n background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);\n background-image: -o-linear-gradient(top, #eeeeee, #cccccc);\n}\n.yasr-star-rating .yasr-star-value {\n height: 100%;\n position: absolute;\n}\n.yasr-star-rating .yasr-star-value {\n position: absolute;\n height: 100%;\n width: 100%;\n background: url('data:image/svg+xml;base64,PHN2ZwoJeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMTA4LjkiIGhlaWdodD0iMTAzLjYiIHZpZXdCb3g9IjAgMCAxMDguOSAxMDMuNiI+Cgk8ZGVmcz4KCQk8c3R5bGU+LmNscy0xe2ZpbGw6I2YxYzk0Nzt9PC9zdHlsZT4KCTwvZGVmcz4KCTx0aXRsZT5zdGFyMTwvdGl0bGU+Cgk8ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIj4KCQk8ZyBpZD0iTGF5ZXJfMS0yIiBkYXRhLW5hbWU9IkxheWVyIDEiPgoJCQk8cG9seWdvbiBjbGFzcz0iY2xzLTEiIHBvaW50cz0iNTQuNCAwIDcxLjMgMzQuMSAxMDguOSAzOS42IDgxLjcgNjYuMSA4OC4xIDEwMy42IDU0LjQgODUuOSAyMC44IDEwMy42IDI3LjIgNjYuMSAwIDM5LjYgMzcuNiAzNC4xIDU0LjQgMCIvPgoJCTwvZz4KCTwvZz4KPC9zdmc+Cg==');\n background-repeat: repeat-x;\n}\n"; (require("browserify-css").createStyle(css, { "href": "lib\\style.css" }, { "insertAt": "bottom" })); module.exports = css;
225
},{"browserify-css":3}],3:[function(require,module,exports){
226
'use strict';
227
// For more information about browser field, check out the browser field at https://github.com/substack/browserify-handbook#browser-field.
js/yasr-editor-screen.js CHANGED
@@ -244,6 +244,18 @@ function yasrSetRaterAdminMulti(setId) {
244
var htmlId = yasrMultiSetAdmin.item(i).id;
245
var elem = document.getElementById(htmlId);
246
247
raterJs({
248
starSize: 32,
249
step: 0.5,
@@ -252,14 +264,11 @@ function yasrSetRaterAdminMulti(setId) {
252
element: elem,
253
254
rateCallback: function rateCallback(rating, done) {
255
-
256
rating = rating.toFixed(1);
257
//Be sure is a number and not a string
258
rating = parseFloat(rating);
259
this.setRating(rating); //Set the rating
260
261
- var setIdField = parseInt(elem.getAttribute('data-multi-idfield'));
262
-
263
ratingObject = {
264
field: setIdField,
265
rating: rating
244
var htmlId = yasrMultiSetAdmin.item(i).id;
245
var elem = document.getElementById(htmlId);
246
247
+ var setIdField = parseInt(elem.getAttribute('data-multi-idfield'));
248
+ var ratingOnLoad = parseInt(elem.getAttribute('data-rating'));
249
+
250
+ ratingObjectOnLoad = {
251
+ field: setIdField,
252
+ rating: ratingOnLoad
253
+ };
254
+
255
+ //creating rating array
256
+ ratingArray.push(ratingObjectOnLoad);
257
+
258
+
259
raterJs({
260
starSize: 32,
261
step: 0.5,
264
element: elem,
265
266
rateCallback: function rateCallback(rating, done) {
267
rating = rating.toFixed(1);
268
//Be sure is a number and not a string
269
rating = parseFloat(rating);
270
this.setRating(rating); //Set the rating
271
272
ratingObject = {
273
field: setIdField,
274
rating: rating
lib/admin/editor/YasrOnSavePost.php CHANGED
@@ -206,7 +206,7 @@ class YasrOnSavePost {
206
$i = 0;
207
208
$data_to_save[$i] = array(
209
- 'set_id' => (int)$set_id,
210
'fields_and_ratings' => $field_and_vote_array
211
);
212
206
$i = 0;
207
208
$data_to_save[$i] = array(
209
+ 'set_id' => $set_id,
210
'fields_and_ratings' => $field_and_vote_array
211
);
212
lib/admin/editor/yasr-editor-functions.php CHANGED
@@ -161,4 +161,3 @@ function yasr_metabox_below_editor_metabox_callback() {
161
162
}
163
164
- ?>
161
162
}
163
lib/admin/settings/yasr-settings-migration-functions.php CHANGED
@@ -524,4 +524,3 @@ function yasr_import_plugin_alert_box($plugin, $number_of_queries) {
524
525
}
526
527
- ?>
524
525
}
526
lib/admin/settings/yasr-stats-functions.php CHANGED
@@ -181,7 +181,7 @@ class YASR_Stats_Log_List_Table extends YASR_WP_List_Table {
181
* @param Array $item Data
182
* @param String $column_name - Current column name
183
*
184
- * @return Mixed
185
*/
186
protected function column_default( $item, $column_name ) {
187
@@ -256,7 +256,7 @@ class YASR_Stats_Log_List_Table extends YASR_WP_List_Table {
256
case 'ip':
257
return $item[$column_name];
258
}
259
-
260
}
261
262
/**
181
* @param Array $item Data
182
* @param String $column_name - Current column name
183
*
184
+ * @return Mixed|void
185
*/
186
protected function column_default( $item, $column_name ) {
187
256
case 'ip':
257
return $item[$column_name];
258
}
259
+ return;
260
}
261
262
/**
lib/yasr-functions.php CHANGED
@@ -30,7 +30,14 @@ add_action('admin_enqueue_scripts', 'yasr_add_admin_scripts');
30
31
function yasr_add_scripts() {
32
33
- wp_enqueue_style('yasrcss', YASR_CSS_DIR . 'yasr.css', false, YASR_VERSION_NUM, 'all');
34
wp_enqueue_style('dashicons'); //dashicons
35
36
//Run after default css are loaded
@@ -45,11 +52,18 @@ function yasr_add_scripts() {
45
$yasr_multiset_theme = 'yasr-table-dark.css';
46
}
47
48
- wp_enqueue_style($yasr_multiset_theme_handle, YASR_CSS_DIR . $yasr_multiset_theme, array('yasrcss'),
49
- YASR_VERSION_NUM, 'all');
50
51
if (YASR_CUSTOM_CSS_RULES) {
52
- wp_add_inline_style('yasrcss', YASR_CUSTOM_CSS_RULES);
53
}
54
55
$rater_file_to_include = 'rater-js.js';
@@ -58,9 +72,29 @@ function yasr_add_scripts() {
58
$rater_file_to_include = 'rater-js-rtl.js';
59
}
60
61
- wp_enqueue_script('rater', YASR_JS_DIR . $rater_file_to_include, '', YASR_VERSION_NUM, true);
62
- wp_enqueue_script('yasrfront', YASR_JS_DIR . 'yasr-front.js', array('jquery', 'rater'), YASR_VERSION_NUM, true);
63
- wp_enqueue_script('tippy', YASR_JS_DIR . 'tippy.all.min.js', '', '3.6.0', true);
64
65
do_action('yasr_add_front_script_js');
66
@@ -157,10 +191,10 @@ function yasr_css_stars_set() {
157
158
159
$yasr_st_css = "
160
- .star-rating {
161
background-image: url(\"$star_grey\");
162
}
163
- .star-rating .star-value {
164
background: url(\"$star_yellow\") ;
165
}
166
";
@@ -175,7 +209,7 @@ add_action('yasr_add_admin_scripts_end', 'yasr_rtl_support');
175
function yasr_rtl_support() {
176
177
if (is_rtl()) {
178
- $yasr_rtl_css = '.star-rating .star-value {
179
-moz-transform: scaleX(-1);
180
-o-transform: scaleX(-1);
181
@@ -281,6 +315,11 @@ if (YASR_AUTO_INSERT_ENABLED == 1) {
281
add_filter('the_content', 'yasr_auto_insert_shortcode_callback');
282
}
283
284
function yasr_auto_insert_shortcode_callback($content) {
285
286
$post_id = get_the_ID();
@@ -307,6 +346,9 @@ if (YASR_AUTO_INSERT_ENABLED == 1) {
307
$overall_rating_code = $container_div_overall. '[yasr_overall_rating size="' . YASR_AUTO_INSERT_SIZE . '"]' . $closing_div;
308
$visitor_votes_code = $container_div_visitor. '[yasr_visitor_votes size="' . YASR_AUTO_INSERT_SIZE . '"]' . $closing_div;
309
310
if (YASR_AUTO_INSERT_WHAT === 'overall_rating') {
311
switch (YASR_AUTO_INSERT_WHERE) {
312
case 'top':
@@ -366,7 +408,7 @@ if (YASR_AUTO_INSERT_ENABLED == 1) {
366
return $content_and_stars;
367
}
368
}
369
-
370
} //End function yasr_auto_insert_shortcode_callback
371
372
} //End if (YASR_AUTO_INSERT_ENABLED
@@ -392,6 +434,10 @@ function yasr_add_schema($content) {
392
return $content;
393
}
394
395
$overall_rating = YasrDatabaseRatings::getOverallRating();
396
$visitor_votes = YasrDatabaseRatings::getVisitorVotes(false);
397
30
31
function yasr_add_scripts() {
32
33
+ wp_enqueue_style(
34
+ 'yasrcss',
35
+ YASR_CSS_DIR . 'yasr.css',
36
+ false,
37
+ YASR_VERSION_NUM,
38
+ 'all'
39
+ );
40
+
41
wp_enqueue_style('dashicons'); //dashicons
42
43
//Run after default css are loaded
52
$yasr_multiset_theme = 'yasr-table-dark.css';
53
}
54
55
+ wp_enqueue_style(
56
+ $yasr_multiset_theme_handle,
57
+ YASR_CSS_DIR . $yasr_multiset_theme,
58
+ array('yasrcss'),
59
+ YASR_VERSION_NUM, 'all'
60
+ );
61
62
if (YASR_CUSTOM_CSS_RULES) {
63
+ wp_add_inline_style(
64
+ 'yasrcss',
65
+ YASR_CUSTOM_CSS_RULES
66
+ );
67
}
68
69
$rater_file_to_include = 'rater-js.js';
72
$rater_file_to_include = 'rater-js-rtl.js';
73
}
74
75
+ wp_enqueue_script(
76
+ 'rater',
77
+ YASR_JS_DIR .
78
+ $rater_file_to_include,
79
+ '',
80
+ YASR_VERSION_NUM,
81
+ true
82
+ );
83
+
84
+ wp_enqueue_script(
85
+ 'yasrfront',
86
+ YASR_JS_DIR . 'yasr-front.js',
87
+ array('jquery', 'rater'),
88
+ YASR_VERSION_NUM,
89
+ true);
90
+
91
+ wp_enqueue_script(
92
+ 'tippy',
93
+ YASR_JS_DIR . 'tippy.all.min.js',
94
+ '',
95
+ '3.6.0',
96
+ true
97
+ );
98
99
do_action('yasr_add_front_script_js');
100
191
192
193
$yasr_st_css = "
194
+ .yasr-star-rating {
195
background-image: url(\"$star_grey\");
196
}
197
+ .yasr-star-rating .yasr-star-value {
198
background: url(\"$star_yellow\") ;
199
}
200
";
209
function yasr_rtl_support() {
210
211
if (is_rtl()) {
212
+ $yasr_rtl_css = '.yasr-star-rating .yasr-star-value {
213
-moz-transform: scaleX(-1);
214
-o-transform: scaleX(-1);
215
315
add_filter('the_content', 'yasr_auto_insert_shortcode_callback');
316
}
317
318
+ /**
319
+ * @param $content
320
+ *
321
+ * @return bool|string|void
322
+ */
323
function yasr_auto_insert_shortcode_callback($content) {
324
325
$post_id = get_the_ID();
346
$overall_rating_code = $container_div_overall. '[yasr_overall_rating size="' . YASR_AUTO_INSERT_SIZE . '"]' . $closing_div;
347
$visitor_votes_code = $container_div_visitor. '[yasr_visitor_votes size="' . YASR_AUTO_INSERT_SIZE . '"]' . $closing_div;
348
349
+ //avoid undefined
350
+ $content_and_stars = false;
351
+
352
if (YASR_AUTO_INSERT_WHAT === 'overall_rating') {
353
switch (YASR_AUTO_INSERT_WHERE) {
354
case 'top':
408
return $content_and_stars;
409
}
410
}
411
+ return;
412
} //End function yasr_auto_insert_shortcode_callback
413
414
} //End if (YASR_AUTO_INSERT_ENABLED
434
return $content;
435
}
436
437
+ if (!has_shortcode($content, 'yasr_visitor_votes') && !has_shortcode($content, 'yasr_overall_rating')) {
438
+ return $content;
439
+ }
440
+
441
$overall_rating = YasrDatabaseRatings::getOverallRating();
442
$visitor_votes = YasrDatabaseRatings::getVisitorVotes(false);
443
lib/yasr-shortcode-functions.php CHANGED
@@ -111,6 +111,9 @@ function yasr_most_or_highest_rated_posts_callback () {
111
112
add_shortcode ('yasr_top_5_reviewers', 'yasr_top_5_reviewers_callback');
113
114
function yasr_top_5_reviewers_callback () {
115
116
global $wpdb;
@@ -174,7 +177,7 @@ function yasr_top_5_reviewers_callback () {
174
else {
175
_e("Problem while retrieving the top 5 most active reviewers. Did you publish any review?");
176
}
177
-
178
} //End top 5 reviewers function
179
180
@@ -182,6 +185,9 @@ function yasr_top_5_reviewers_callback () {
182
183
add_shortcode ('yasr_top_ten_active_users', 'yasr_top_ten_active_users_callback');
184
185
function yasr_top_ten_active_users_callback () {
186
187
global $wpdb;
@@ -195,7 +201,6 @@ function yasr_top_ten_active_users_callback () {
195
LIMIT 10");
196
197
if ($query_result) {
198
-
199
$shortcode_html = '<!-- Yasr Top 10 Active Users Shortcode-->';
200
201
$shortcode_html .= "
@@ -224,18 +229,14 @@ function yasr_top_ten_active_users_callback () {
224
225
}
226
227
-
228
$shortcode_html .= "</table>";
229
$shortcode_html .= '<!--End Yasr Top 10 Active Users Shortcode-->';
230
231
return $shortcode_html;
232
-
233
- }
234
-
235
- else {
236
_e("Problem while retrieving the top 10 active users chart. Are you sure you have votes to show?");
237
}
238
-
239
} //End function
240
241
- ?>
111
112
add_shortcode ('yasr_top_5_reviewers', 'yasr_top_5_reviewers_callback');
113
114
+ /**
115
+ * @return string|void
116
+ */
117
function yasr_top_5_reviewers_callback () {
118
119
global $wpdb;
177
else {
178
_e("Problem while retrieving the top 5 most active reviewers. Did you publish any review?");
179
}
180
+ return;
181
} //End top 5 reviewers function
182
183
185
186
add_shortcode ('yasr_top_ten_active_users', 'yasr_top_ten_active_users_callback');
187
188
+ /**
189
+ * @return string|void
190
+ */
191
function yasr_top_ten_active_users_callback () {
192
193
global $wpdb;
201
LIMIT 10");
202
203
if ($query_result) {
204
$shortcode_html = '<!-- Yasr Top 10 Active Users Shortcode-->';
205
206
$shortcode_html .= "
229
230
}
231
232
$shortcode_html .= "</table>";
233
$shortcode_html .= '<!--End Yasr Top 10 Active Users Shortcode-->';
234
235
return $shortcode_html;
236
+ } else {
237
_e("Problem while retrieving the top 10 active users chart. Are you sure you have votes to show?");
238
}
239
+ return;
240
} //End function
241
242
+
readme.txt CHANGED
@@ -5,7 +5,7 @@ Requires at least: 4.9.0
5
Contributors: Dudo
6
Tested up to: 5.4
7
Requires PHP: 5.3
8
- Stable tag: 2.2.8
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
@@ -125,6 +125,12 @@ If doesn't, it's suggested to ask in a SEO oriented forum.
125
126
The full changelog can be found in the plugin's directory. Recent entries:
127
128
= 2.2.8 =
129
* FIXED: empty schema field can return error on existing post or page.
130
5
Contributors: Dudo
6
Tested up to: 5.4
7
Requires PHP: 5.3
8
+ Stable tag: 2.2.9
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
125
126
The full changelog can be found in the plugin's directory. Recent entries:
127
128
+ = 2.2.9 =
129
+ * FIXED: in the editor screen, if a Multi Set already has ratings, and then try to update only one, all the other
130
+ fields where reset
131
+ * ENHANCEMENT: rich snippet are returned only if a YASR shortcode is in the post or page
132
+ * ENHANCEMENT: changed classes names star-rating and star-value in yasr-star-rating and yasr-star-value. **DELETE YOUR BROWSER CACHE**
133
+
134
= 2.2.8 =
135
* FIXED: empty schema field can return error on existing post or page.
136
yet-another-stars-rating.php CHANGED
@@ -5,7 +5,7 @@
5
* Plugin URI: http://wordpress.org/plugins/yet-another-stars-rating/
6
* Description: Yasr - Yet Another Stars Rating is a powerful way to add SEO-friendly user-generated reviews and
7
* testimonials to your website posts, pages and CPT, without affecting its speed.
8
- * Version: 2.2.8
9
* Author: Dario Curvino
10
* Author URI: https://dariocurvino.it/
11
* Text Domain: yet-another-stars-rating
@@ -77,7 +77,7 @@ if ( !function_exists( 'yasr_fs' ) ) {
77
yasr_fs();
78
// Signal that SDK was initiated.
79
do_action( 'yasr_fs_loaded' );
80
- define( 'YASR_VERSION_NUM', '2.2.8' );
81
//Plugin relative path
82
define( "YASR_ABSOLUTE_PATH", dirname( __FILE__ ) );
83
//Plugin RELATIVE PATH without slashes (just the directory's name)
5
* Plugin URI: http://wordpress.org/plugins/yet-another-stars-rating/
6
* Description: Yasr - Yet Another Stars Rating is a powerful way to add SEO-friendly user-generated reviews and
7
* testimonials to your website posts, pages and CPT, without affecting its speed.
8
+ * Version: 2.2.9
9
* Author: Dario Curvino
10
* Author URI: https://dariocurvino.it/
11
* Text Domain: yet-another-stars-rating
77
yasr_fs();
78
// Signal that SDK was initiated.
79
do_action( 'yasr_fs_loaded' );
80
+ define( 'YASR_VERSION_NUM', '2.2.9' );
81
//Plugin relative path
82
define( "YASR_ABSOLUTE_PATH", dirname( __FILE__ ) );
83
//Plugin RELATIVE PATH without slashes (just the directory's name)