Version Description
- FIX: register_rest_route called incorrectly in Gutenberg
- FIX: random js error into dashboard (thanks to @lwangaman)
- TWEAK: On stars hover, cursor is now displayed an an hand
- FIX: minor changes to support older versions
Download this release
Release Info
Developer | Dudo |
Plugin | Yasr – Yet Another Stars Rating |
Version | 2.5.6 |
Comparing to | |
See all releases |
Code changes from version 2.5.5 to 2.5.6
- admin/js/src/yasr-dashboard.js +1 -1
- admin/js/yasr-admin.js +1 -1
- includes/css/yasr.css +1 -0
- includes/rest/classes/YasrCustomEndpoint.php +3 -1
- includes/yasr-includes-db-functions.php +10 -3
- readme.txt +7 -1
- yet-another-stars-rating.php +2 -2
admin/js/src/yasr-dashboard.js
CHANGED
@@ -23,7 +23,7 @@ jQuery(document).ready(function () {
|
|
23 |
jQuery(document).ajaxComplete(function (event, xhr, settings) {
|
24 |
var isYasrAjaxCall = true;
|
25 |
|
26 |
-
if(settings.data !== 'undefined') {
|
27 |
//check if the ajax call is done by yasr with action yasr_change_log_page
|
28 |
isYasrAjaxCall = settings.data.search("action=yasr_change_log_page");
|
29 |
}
|
23 |
jQuery(document).ajaxComplete(function (event, xhr, settings) {
|
24 |
var isYasrAjaxCall = true;
|
25 |
|
26 |
+
if(typeof settings.data !== 'undefined') {
|
27 |
//check if the ajax call is done by yasr with action yasr_change_log_page
|
28 |
isYasrAjaxCall = settings.data.search("action=yasr_change_log_page");
|
29 |
}
|
admin/js/yasr-admin.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e){var t={};function r(o){if(t[o])return t[o].exports;var a=t[o]={i:o,l:!1,exports:{}};return e[o].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(o,a,function(t){return e[t]}.bind(null,a));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){r(1),r(2),e.exports=r(3)},function(e,t){copyToClipboard=e=>{const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)},tippy(document.querySelectorAll(".yasr-copy-shortcode"),{content:"Copied! Insert into your post!",theme:"yasr",arrow:"true",arrowType:"round",trigger:"click"})},function(e,t){jQuery(document).ready((function(){jQuery(".yasr-log-pagenum").on("click",(function(){jQuery("#yasr-loader-log-metabox").show();var e={action:"yasr_change_log_page",pagenum:jQuery(this).val(),totalpages:jQuery("#yasr-log-total-pages").data("yasr-log-total-pages")};jQuery.post(ajaxurl,e,(function(e){jQuery("#yasr-loader-log-metabox").hide(),jQuery("#yasr-log-container").html(e)}))})),jQuery(document).ajaxComplete((function(e,t,r){var o=!0;
|
1 |
+
!function(e){var t={};function r(o){if(t[o])return t[o].exports;var a=t[o]={i:o,l:!1,exports:{}};return e[o].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(o,a,function(t){return e[t]}.bind(null,a));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){r(1),r(2),e.exports=r(3)},function(e,t){copyToClipboard=e=>{const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)},tippy(document.querySelectorAll(".yasr-copy-shortcode"),{content:"Copied! Insert into your post!",theme:"yasr",arrow:"true",arrowType:"round",trigger:"click"})},function(e,t){jQuery(document).ready((function(){jQuery(".yasr-log-pagenum").on("click",(function(){jQuery("#yasr-loader-log-metabox").show();var e={action:"yasr_change_log_page",pagenum:jQuery(this).val(),totalpages:jQuery("#yasr-log-total-pages").data("yasr-log-total-pages")};jQuery.post(ajaxurl,e,(function(e){jQuery("#yasr-loader-log-metabox").hide(),jQuery("#yasr-log-container").html(e)}))})),jQuery(document).ajaxComplete((function(e,t,r){var o=!0;void 0!==r.data&&(o=r.data.search("action=yasr_change_log_page")),-1!==o&&jQuery(".yasr-log-pagenum").on("click",(function(){jQuery("#yasr-loader-log-metabox").show();var e={action:"yasr_change_log_page",pagenum:jQuery(this).val(),totalpages:jQuery("#yasr-log-total-pages").data("yasr-log-total-pages")};jQuery.post(ajaxurl,e,(function(e){jQuery("#yasr-log-container").html(e)}))}))}))})),jQuery(document).ready((function(){jQuery(".yasr-user-log-page-num").on("click",(function(){jQuery("#yasr-loader-user-log-metabox").show();var e={action:"yasr_change_user_log_page",pagenum:jQuery(this).val(),totalpages:jQuery("#yasr-user-log-total-pages").data("yasr-log-total-pages")};jQuery.post(ajaxurl,e,(function(e){jQuery("#yasr-loader-log-metabox").hide(),jQuery("#yasr-user-log-container").html(e)}))})),jQuery(document).ajaxComplete((function(e,t,r){void 0!==r.data&&-1!==r.data.search("action=yasr_change_user_log_page")&&jQuery(".yasr-user-log-page-num").on("click",(function(){jQuery("#yasr-loader-user-log-metabox").show();var e={action:"yasr_change_user_log_page",pagenum:jQuery(this).val(),totalpages:jQuery("#yasr-user-log-total-pages").data("yasr-log-total-pages")};jQuery.post(ajaxurl,e,(function(e){jQuery("#yasr-user-log-container").html(e)}))}))}))}))},function(e,t){document.addEventListener("DOMContentLoaded",(function(e){if(void 0===document.getElementsByClassName("nav-tab-active")[0])return;let t=document.getElementsByClassName("nav-tab-active")[0].id;if("general_settings"===t){let e=document.getElementById("yasr_auto_insert_switch").checked,t=document.getElementById("yasr-general-options-stars-title-switch").checked,r=document.getElementById("yasr-general-options-text-before-stars-switch").checked;!1===e&&jQuery(".yasr-auto-insert-options-class").prop("disabled",!0),!1===t&&jQuery(".yasr-stars-title-options-class").prop("disabled",!0),jQuery("#yasr_auto_insert_switch").change((function(){jQuery(this).is(":checked")?jQuery(".yasr-auto-insert-options-class").prop("disabled",!1):jQuery(".yasr-auto-insert-options-class").prop("disabled",!0)})),jQuery("#yasr-general-options-stars-title-switch").change((function(){jQuery(this).is(":checked")?jQuery(".yasr-stars-title-options-class").prop("disabled",!1):jQuery(".yasr-stars-title-options-class").prop("disabled",!0)})),!1===r&&jQuery(".yasr-general-options-text-before").find(":input").prop("disabled",!0),jQuery("#yasr-general-options-text-before-stars-switch").change((function(){jQuery(this).is(":checked")?(jQuery(".yasr-general-options-text-before").find(":input").prop("disabled",!1),jQuery("#yasr-general-options-custom-text-before-overall").val("Our Score"),jQuery("#yasr-general-options-custom-text-before-visitor").val("Click to rate this post!"),jQuery("#yasr-general-options-custom-text-after-visitor").val("[Total: %total_count% Average: %average%]"),jQuery("#yasr-general-options-custom-text-must-sign-in").val("You must sign in to vote"),jQuery("#yasr-general-options-custom-text-already-rated").val("You have already voted for this article")):jQuery(".yasr-general-options-text-before").find(":input").prop("disabled",!0)})),jQuery("#yasr-doc-custom-text-link").on("click",(function(){return jQuery("#yasr-doc-custom-text-div").toggle("slow"),!1})),jQuery("#yasr-stats-explained-link").on("click",(function(){return jQuery("#yasr-stats-explained").toggle("slow"),!1}))}if("manage_multi"===t){let e=document.getElementById("n-multiset").value;if(jQuery("#yasr-multi-set-doc-link").on("click",(function(){jQuery("#yasr-multi-set-doc-box").toggle("slow")})),jQuery("#yasr-multi-set-doc-link-hide").on("click",(function(){jQuery("#yasr-multi-set-doc-box").toggle("slow")})),1===e){var r=jQuery("#yasr-edit-form-number-elements").attr("value");r++,jQuery("#yasr-add-field-edit-multiset").on("click",(function(){if(r>9)return jQuery("#yasr-element-limit").show(),jQuery("#yasr-add-field-edit-multiset").hide(),!1;var e=jQuery(document.createElement("tr"));e.html('<td colspan="2">Element #'+r+' <input type="text" name="edit-multi-set-element-'+r+'" value="" ></td>'),e.appendTo("#yasr-table-form-edit-multi-set"),r++}))}e>1&&(jQuery("#yasr-button-select-set-edit-form").on("click",(function(){var e={action:"yasr_get_multi_set",set_id:jQuery("#yasr_select_edit_set").val()};return jQuery.post(ajaxurl,e,(function(e){jQuery("#yasr-multi-set-response").show(),jQuery("#yasr-multi-set-response").html(e)})),!1})),jQuery(document).ajaxComplete((function(){var e=jQuery("#yasr-edit-form-number-elements").attr("value");e++,jQuery("#yasr-add-field-edit-multiset").on("click",(function(){if(e>9)return jQuery("#yasr-element-limit").show(),jQuery("#yasr-add-field-edit-multiset").hide(),!1;var t=jQuery(document.createElement("tr"));t.html('<td colspan="2">Element #'+e+' <input type="text" name="edit-multi-set-element-'+e+'" value="" ></td>'),t.appendTo("#yasr-table-form-edit-multi-set"),e++}))})))}"style_options"===t&&(wp.codeEditor.initialize(document.getElementById("yasr_style_options_textarea"),yasr_cm_settings),jQuery("#yasr-color-scheme-preview-link").on("click",(function(){return jQuery("#yasr-color-scheme-preview").toggle("slow"),!1}))),"migration_tools"===t&&(jQuery("#yasr-import-ratemypost-submit").on("click",(function(){document.getElementById("yasr-import-ratemypost-answer").innerHTML='<img src="'+yasrCommonDataAdmin.loaderHtml+'"</img>';var e={action:"yasr_import_ratemypost",nonce:document.getElementById("yasr-import-rmp-nonce").value};jQuery.post(ajaxurl,e,(function(e){e=JSON.parse(e),document.getElementById("yasr-import-ratemypost-answer").innerHTML=e}))})),jQuery("#yasr-import-wppr-submit").on("click",(function(){document.getElementById("yasr-import-wppr-answer").innerHTML='<img src="'+yasrCommonDataAdmin.loaderHtml+'"</img>';var e={action:"yasr_import_wppr",nonce:document.getElementById("yasr-import-wppr-nonce").value};jQuery.post(ajaxurl,e,(function(e){document.getElementById("yasr-import-wppr-answer").innerHTML=e}))})),jQuery("#yasr-import-kksr-submit").on("click",(function(){document.getElementById("yasr-import-kksr-answer").innerHTML='<img src="'+yasrCommonDataAdmin.loaderHtml+'"</img>';var e={action:"yasr_import_kksr",nonce:document.getElementById("yasr-import-kksr-nonce").value};jQuery.post(ajaxurl,e,(function(e){document.getElementById("yasr-import-kksr-answer").innerHTML=e}))})),jQuery("#yasr-import-mr-submit").on("click",(function(){document.getElementById("yasr-import-mr-answer").innerHTML='<img src="'+yasrCommonDataAdmin.loaderHtml+'"</img>';var e={action:"yasr_import_mr",nonce:document.getElementById("yasr-import-mr-nonce").value};jQuery.post(ajaxurl,e,(function(e){document.getElementById("yasr-import-mr-answer").innerHTML=e}))})))}))}]);
|
includes/css/yasr.css
CHANGED
@@ -5,6 +5,7 @@
|
|
5 |
background-position: 0 0;
|
6 |
background-repeat: repeat-x;
|
7 |
vertical-align: bottom;
|
|
|
8 |
}
|
9 |
|
10 |
.yasr-star-rating[data-title]:hover:after {
|
5 |
background-position: 0 0;
|
6 |
background-repeat: repeat-x;
|
7 |
vertical-align: bottom;
|
8 |
+
cursor: pointer;
|
9 |
}
|
10 |
|
11 |
.yasr-star-rating[data-title]:hover:after {
|
includes/rest/classes/YasrCustomEndpoint.php
CHANGED
@@ -19,10 +19,12 @@ class YasrCustomEndpoint extends WP_REST_Controller {
|
|
19 |
|
20 |
/**
|
21 |
* Load all register_rest_route
|
|
|
|
|
22 |
*/
|
23 |
public function customEndpoint () {
|
24 |
$this->namespace = 'yet-another-stars-rating/';
|
25 |
-
$this->version = 'v1
|
26 |
|
27 |
$this->multisetEndpoint();
|
28 |
$this->rankingEndpoint();
|
19 |
|
20 |
/**
|
21 |
* Load all register_rest_route
|
22 |
+
* Since version 2.5.6 this->version must not have the ending slash
|
23 |
+
* https://wordpress.org/support/topic/my-dashboard-is-error/#post-13748117
|
24 |
*/
|
25 |
public function customEndpoint () {
|
26 |
$this->namespace = 'yet-another-stars-rating/';
|
27 |
+
$this->version = 'v1';
|
28 |
|
29 |
$this->multisetEndpoint();
|
30 |
$this->rankingEndpoint();
|
includes/yasr-includes-db-functions.php
CHANGED
@@ -34,12 +34,10 @@ function yasr_get_itemType($term_id=false) {
|
|
34 |
//if term_id is not an int, use get_post_meta
|
35 |
if(!is_int($term_id)) {
|
36 |
$post_id = get_the_ID();
|
37 |
-
|
38 |
//should be useless, just to be safe
|
39 |
if (!$post_id) {
|
40 |
return false;
|
41 |
}
|
42 |
-
|
43 |
$result = get_post_meta($post_id, 'yasr_review_type', true);
|
44 |
} else {
|
45 |
$result = get_term_meta($term_id, 'yasr_review_type', true);
|
@@ -56,7 +54,6 @@ function yasr_get_itemType($term_id=false) {
|
|
56 |
if($snippet_type === 'Other') {
|
57 |
$snippet_type = 'BlogPosting';
|
58 |
}
|
59 |
-
|
60 |
if (!in_array($snippet_type, $review_types, true) ) {
|
61 |
$snippet_type = YASR_ITEMTYPE;
|
62 |
}
|
@@ -64,5 +61,15 @@ function yasr_get_itemType($term_id=false) {
|
|
64 |
} else {
|
65 |
$snippet_type = YASR_ITEMTYPE;
|
66 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
return $snippet_type;
|
68 |
}
|
34 |
//if term_id is not an int, use get_post_meta
|
35 |
if(!is_int($term_id)) {
|
36 |
$post_id = get_the_ID();
|
|
|
37 |
//should be useless, just to be safe
|
38 |
if (!$post_id) {
|
39 |
return false;
|
40 |
}
|
|
|
41 |
$result = get_post_meta($post_id, 'yasr_review_type', true);
|
42 |
} else {
|
43 |
$result = get_term_meta($term_id, 'yasr_review_type', true);
|
54 |
if($snippet_type === 'Other') {
|
55 |
$snippet_type = 'BlogPosting';
|
56 |
}
|
|
|
57 |
if (!in_array($snippet_type, $review_types, true) ) {
|
58 |
$snippet_type = YASR_ITEMTYPE;
|
59 |
}
|
61 |
} else {
|
62 |
$snippet_type = YASR_ITEMTYPE;
|
63 |
}
|
64 |
+
|
65 |
+
//to keep compatibility with version <2.2.3
|
66 |
+
if($snippet_type === 'Place') {
|
67 |
+
$snippet_type = 'LocalBusiness';
|
68 |
+
}
|
69 |
+
//to keep compatibility with version <2.2.3
|
70 |
+
if($snippet_type === 'Other') {
|
71 |
+
$snippet_type = 'BlogPosting';
|
72 |
+
}
|
73 |
+
|
74 |
return $snippet_type;
|
75 |
}
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Requires at least: 4.9.0
|
|
5 |
Contributors: Dudo
|
6 |
Tested up to: 5.6
|
7 |
Requires PHP: 5.3
|
8 |
-
Stable tag: 2.5.
|
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
|
@@ -181,6 +181,12 @@ If doesn't, you should work on your seo reputation.
|
|
181 |
|
182 |
The full changelog can be found in the plugin's directory. Recent entries:
|
183 |
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
= 2.5.5 =
|
185 |
* FIX: rich snippet's attribute name returns the post_id instead of the title in some circumstances
|
186 |
|
5 |
Contributors: Dudo
|
6 |
Tested up to: 5.6
|
7 |
Requires PHP: 5.3
|
8 |
+
Stable tag: 2.5.6
|
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
|
181 |
|
182 |
The full changelog can be found in the plugin's directory. Recent entries:
|
183 |
|
184 |
+
= 2.5.6 =
|
185 |
+
* FIX: register_rest_route called incorrectly in Gutenberg
|
186 |
+
* FIX: random js error into dashboard (thanks to @lwangaman)
|
187 |
+
* TWEAK: On stars hover, cursor is now displayed an an hand
|
188 |
+
* FIX: minor changes to support older versions
|
189 |
+
|
190 |
= 2.5.5 =
|
191 |
* FIX: rich snippet's attribute name returns the post_id instead of the title in some circumstances
|
192 |
|
yet-another-stars-rating.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: Yet Another Stars Rating
|
5 |
* Plugin URI: http://wordpress.org/plugins/yet-another-stars-rating/
|
6 |
* Description: 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
|
7 |
-
* Version: 2.5.
|
8 |
* Author: Dario Curvino
|
9 |
* Author URI: https://dariocurvino.it/
|
10 |
* Text Domain: yet-another-stars-rating
|
@@ -76,7 +76,7 @@ if ( !function_exists( 'yasr_fs' ) ) {
|
|
76 |
yasr_fs();
|
77 |
// Signal that SDK was initiated.
|
78 |
do_action( 'yasr_fs_loaded' );
|
79 |
-
define( 'YASR_VERSION_NUM', '2.5.
|
80 |
//Plugin absolute path
|
81 |
//e.g. /var/www/html/plugin_development/wp-content/plugins/yet-another-stars-rating
|
82 |
define( 'YASR_ABSOLUTE_PATH', __DIR__ );
|
4 |
* Plugin Name: Yet Another Stars Rating
|
5 |
* Plugin URI: http://wordpress.org/plugins/yet-another-stars-rating/
|
6 |
* Description: 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
|
7 |
+
* Version: 2.5.6
|
8 |
* Author: Dario Curvino
|
9 |
* Author URI: https://dariocurvino.it/
|
10 |
* Text Domain: yet-another-stars-rating
|
76 |
yasr_fs();
|
77 |
// Signal that SDK was initiated.
|
78 |
do_action( 'yasr_fs_loaded' );
|
79 |
+
define( 'YASR_VERSION_NUM', '2.5.6' );
|
80 |
//Plugin absolute path
|
81 |
//e.g. /var/www/html/plugin_development/wp-content/plugins/yet-another-stars-rating
|
82 |
define( 'YASR_ABSOLUTE_PATH', __DIR__ );
|