Version Description
- TWEAKED: removed "Pro only features" box in the editor screen
Download this release
Release Info
Developer | Dudo |
Plugin | Yasr – Yet Another Stars Rating |
Version | 2.9.9 |
Comparing to | |
See all releases |
Code changes from version 2.9.8 to 2.9.9
- admin/editor/yasr-metabox-top-right.php +1 -126
- admin/js/guten/yasr-guten-misc.js +1 -1
- admin/js/src/guten/yasr-guten-panel.js +1 -243
- readme.txt +18 -10
- yet-another-stars-rating.php +2 -2
admin/editor/yasr-metabox-top-right.php
CHANGED
@@ -113,132 +113,7 @@ wp_nonce_field('yasr_pro_nonce_fake_ratings_action', 'yasr_pro_nonce_fake_rating
|
|
113 |
<?php
|
114 |
|
115 |
} //End if auto insert enabled
|
116 |
-
?>
|
117 |
|
118 |
-
|
119 |
-
|
120 |
-
<div class="yasr-metabox-editor-pro-only-box">
|
121 |
-
<div class="yasr-metabox-editor-title-pro-only">
|
122 |
-
<?php
|
123 |
-
esc_html_e('Pro Only features', 'yet-another-stars-rating');
|
124 |
-
echo ' '.YASR_LOCKED_FEATURE;
|
125 |
-
?>
|
126 |
-
</div>
|
127 |
-
|
128 |
-
<hr style="width: 90%">
|
129 |
-
|
130 |
-
<!-- Begin Reviews in comment -->
|
131 |
-
<div>
|
132 |
-
<div class="yasr-metabox-editor-title">
|
133 |
-
<?php esc_html_e('Enable Comment Reviews', 'yet-another-stars-rating'); ?>
|
134 |
-
</div>
|
135 |
-
<div id="yasr-toprightmetabox-reviews-in-comments-switcher">
|
136 |
-
<div class="yasr-onoffswitch-big" id="yasr-switcher-enable-reviews-in-comments">
|
137 |
-
<input type="checkbox" name="yasr_pro_review_in_comments"
|
138 |
-
class="yasr-onoffswitch-checkbox" value="yes"
|
139 |
-
id="yasr-pro-comments-enabled-yes"
|
140 |
-
<?php
|
141 |
-
if ($comment_review_enabled === true) { echo " checked='checked' "; }
|
142 |
-
echo YASR_LOCKED_FEATURE_HTML_ATTRIBUTE;
|
143 |
-
?>
|
144 |
-
>
|
145 |
-
<label class="yasr-onoffswitch-label" for="yasr-pro-comments-enabled-yes">
|
146 |
-
<span class="yasr-onoffswitch-inner yasr-onoffswitch-onoff-inner"></span>
|
147 |
-
<span class="yasr-onoffswitch-switch"></span>
|
148 |
-
</label>
|
149 |
-
</div>
|
150 |
-
</div>
|
151 |
-
|
152 |
-
<div>
|
153 |
-
<?php
|
154 |
-
if ($comment_review_enabled === true ) {
|
155 |
-
esc_html_e('Reviews in comments for this post / page are ENABLED', 'yet-another-stars-rating');
|
156 |
-
} else {
|
157 |
-
esc_html_e('Reviews in comments for this post / page are DISABLED', 'yet-another-stars-rating');
|
158 |
-
}
|
159 |
-
?>
|
160 |
-
</div>
|
161 |
-
|
162 |
-
<div class="yasr-metabox-doc-link">
|
163 |
-
<a href="https://yetanotherstarsrating.com/yasr-pro/reviews-in-comments/?utm_source=wp-plugin&utm_medium=tinymce-popup&utm_campaign=yasr_top_right"
|
164 |
-
target="_blank">
|
165 |
-
<?php esc_html_e('Help', 'yet-another-stars-rating'); ?>
|
166 |
-
</a>
|
167 |
-
</div>
|
168 |
-
</div>
|
169 |
-
<!-- End reviews in comment -->
|
170 |
-
|
171 |
-
<hr style="width: 90%">
|
172 |
-
|
173 |
-
<!-- Begin Fake Ratings in comment -->
|
174 |
-
<div>
|
175 |
-
<div class="yasr-metabox-editor-title">
|
176 |
-
<?php esc_html_e('Add fake ratings', 'yet-another-stars-rating'); ?>
|
177 |
-
</div>
|
178 |
-
<div>
|
179 |
-
<?php esc_html_e('Number of votes', 'yet-another-stars-rating') ?>
|
180 |
-
<br />
|
181 |
-
<div>
|
182 |
-
<label for="yasr-pro-fake-number-of-votes">
|
183 |
-
<select name="yasr_pro_fake_number_of_votes" id="yasr-pro-fake-number-of-votes"
|
184 |
-
<?php
|
185 |
-
echo YASR_LOCKED_FEATURE_HTML_ATTRIBUTE;
|
186 |
-
?>
|
187 |
-
>
|
188 |
-
<option value="none" selected>0</option>
|
189 |
-
<option value="1">1</option>
|
190 |
-
<option value="2">2</option>
|
191 |
-
<option value="5">5</option>
|
192 |
-
<option value="10">10</option>
|
193 |
-
<option value="20">20</option>
|
194 |
-
<option value="50">50</option>
|
195 |
-
<option value="100">100</option>
|
196 |
-
<option value="200">200</option>
|
197 |
-
</select>
|
198 |
-
</label>
|
199 |
-
</div>
|
200 |
-
<?php
|
201 |
-
esc_html_e('Rating:', 'yet-another-stars-rating');
|
202 |
-
?>
|
203 |
-
<div>
|
204 |
-
<label for="yasr-pro-fake-ratings">
|
205 |
-
<select name="yasr_pro_fake_ratings" id="yasr-pro-fake-ratings"
|
206 |
-
<?php
|
207 |
-
echo YASR_LOCKED_FEATURE_HTML_ATTRIBUTE;
|
208 |
-
?>
|
209 |
-
>
|
210 |
-
<?php
|
211 |
-
for ($i=5; $i>0; $i--) {
|
212 |
-
if($i === 5) {
|
213 |
-
$selected = 'selected';
|
214 |
-
} else {
|
215 |
-
$selected = '';
|
216 |
-
}
|
217 |
-
echo '<option value="'.esc_attr($i).'" ' .esc_attr($selected).'>'.esc_attr($i).'</option>';
|
218 |
-
}
|
219 |
-
?>
|
220 |
-
</select>
|
221 |
-
</label>
|
222 |
-
<p />
|
223 |
-
<div>
|
224 |
-
<?php esc_html_e(
|
225 |
-
'This will add ratings for yasr_visitor_votes shortcode.',
|
226 |
-
'yet-another-stars-rating')
|
227 |
-
?>
|
228 |
-
</div>
|
229 |
-
<div class="yasr-metabox-doc-link">
|
230 |
-
<a href="https://yetanotherstarsrating.com/yasr_fake_ratings/?utm_source=wp-plugin&utm_medium=tinymce-popup&utm_campaign=yasr_top_right"
|
231 |
-
target="_blank">
|
232 |
-
<?php esc_html_e('Help', 'yet-another-stars-rating'); ?>
|
233 |
-
</a>
|
234 |
-
</div>
|
235 |
-
</div>
|
236 |
-
</div>
|
237 |
-
</div>
|
238 |
-
<!-- End Fake Ratings -->
|
239 |
-
|
240 |
-
</div>
|
241 |
-
|
242 |
-
<?php do_action( 'yasr_add_content_bottom_topright_metabox', $post_id ); ?>
|
243 |
|
244 |
</div>
|
113 |
<?php
|
114 |
|
115 |
} //End if auto insert enabled
|
|
|
116 |
|
117 |
+
do_action( 'yasr_add_content_bottom_topright_metabox', $post_id ); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
|
119 |
</div>
|
admin/js/guten/yasr-guten-misc.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(()=>{var e={245:(e,t,a)=>{"use strict";a.r(t),a.d(t,{YasrBlocksPanel:()=>b,YasrDivRatingOverall:()=>E,YasrNoSettingsPanel:()=>R,YasrPrintInputId:()=>g,YasrPrintSelectSize:()=>v,YasrProText:()=>h,yasrLabelSelectSize:()=>i,yasrLeaveThisBlankText:()=>p,yasrOptionalText:()=>o,yasrOverallDescription:()=>d,yasrSelectSizeChoose:()=>c,yasrSelectSizeLarge:()=>y,yasrSelectSizeMedium:()=>m,yasrSelectSizeSmall:()=>u,yasrVisitorVotesDescription:()=>f});var r=a(245),n=wp.i18n.__,s=wp.components.PanelBody,l=wp.blockEditor.InspectorControls,o=n("All these settings are optional","yet-another-stars-rating"),i=n("Choose Size","yet-another-stars-rating"),c=n("Choose stars size","yet-another-stars-rating"),u=n("Small","yet-another-stars-rating"),m=n("Medium","yet-another-stars-rating"),y=n("Large","yet-another-stars-rating"),p=n("Leave this blank if you don't know what you're doing.","yet-another-stars-rating"),d=n("Remember: only the post author can rate here.","yet-another-stars-rating"),f=n("This is the star set where your users will be able to vote","yet-another-stars-rating");function v(e){return React.createElement("form",null,React.createElement("select",{value:e.size,onChange:function(t){return(0,e.setAttributes)({size:(a=t).target.querySelector("option:checked").value}),void a.preventDefault();var a}},React.createElement("option",{value:"--"},r.yasrSelectSizeChoose),React.createElement("option",{value:"small"},r.yasrSelectSizeSmall),React.createElement("option",{value:"medium"},r.yasrSelectSizeMedium),React.createElement("option",{value:"large"},r.yasrSelectSizeLarge)))}function g(e){var t;return!1!==e.postId&&(t=e.postId),React.createElement("div",null,React.createElement("input",{type:"text",size:"4",defaultValue:t,onKeyPress:function(t){return function(e,t){if("Enter"===t.key){var a=t.target.value;!0!==/^\d+$/.test(a)&&""!==a||e({postId:a}),t.preventDefault()}}(e.setAttributes,t)}}))}function h(){var e=n("To be able to customize this ranking, you need","yet-another-stars-rating"),t=n("You can buy the plugin, including support, updates and upgrades, on","yet-another-stars-rating");return React.createElement("h3",null,e," ",React.createElement("a",{href:"https://yetanotherstarsrating.com/?utm_source=wp-plugin&utm_medium=gutenberg_panel&utm_campaign=yasr_editor_screen&utm_content=rankings#yasr-pro"},"Yasr Pro."),React.createElement("br",null),t," ",React.createElement("a",{href:"https://yetanotherstarsrating.com/?utm_source=wp-plugin&utm_medium=gutenberg_panel&utm_campaign=yasr_editor_screen&utm_content=rankings"},"yetanotherstarsrating.com"))}function R(e){return React.createElement("div",null,React.createElement(h,null))}function b(e){var t;return"visitors"===e.block&&(t=f),"overall"===e.block&&(t=d),React.createElement(l,null,"overall"===e.block&&React.createElement(E,null),React.createElement(s,{title:"Settings"},React.createElement("h3",null,o),React.createElement("div",{className:"yasr-guten-block-panel"},React.createElement("label",null,i),React.createElement("div",null,React.createElement(v,{size:e.size,setAttributes:e.setAttributes}))),React.createElement("div",{className:"yasr-guten-block-panel"},React.createElement("label",null,"Post ID"),React.createElement(g,{postId:e.postId,setAttributes:e.setAttributes}),React.createElement("div",{className:"yasr-guten-block-explain"},p)),React.createElement("div",{className:"yasr-guten-block-panel"},t)))}function E(e){if(!0===JSON.parse(yasrConstantGutenberg.isFseElement))return React.createElement("div",{className:"yasr-guten-block-panel yasr-guten-block-panel-center"},React.createElement("div",null,n("This is a template file, you can't rate here. You need to insert the rating inside the single post or page","yet-another-stars-rating")),React.createElement("br",null));var t=n("Rate this article / item","yet-another-stars-rating"),a=wp.data.select("core/editor").getCurrentPost().meta.yasr_overall_rating,r=function(e,t){e=e.toFixed(1),e=parseFloat(e),wp.data.dispatch("core/editor").editPost({meta:{yasr_overall_rating:e}}),this.setRating(e),t()};return React.createElement("div",{className:"yasr-guten-block-panel yasr-guten-block-panel-center"},t,React.createElement("div",{id:"overall-rater",ref:function(){return function(e,t){var a,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.1,n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],l=arguments.length>6&&void 0!==arguments[6]&&arguments[6];a=arguments.length>2&&void 0!==arguments[2]&&arguments[2]||document.getElementById(t),e=parseInt(e),raterJs({starSize:e,showToolTip:!1,element:a,step:r,readOnly:n,rating:s,rateCallback:l})}(32,"overall-rater",!1,.1,!1,a,r)}}))}}},t={};function a(r){var n=t[r];if(void 0!==n)return n.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,a),s.exports}a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function r(t,a){if(a&&("object"===e(a)||"function"==typeof a))return a;if(void 0!==a)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t)}function n(e){return n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(e)}var s=wp.i18n.__,l=wp.blocks.registerBlockType,o=wp.components,i=o.PanelBody,c=(o.PanelRow,wp.element.Fragment),u=wp.editor,m=(u.BlockControls,u.InspectorControls),y=s("All these settings are optional","yet-another-stars-rating"),p=s("Choose Size","yet-another-stars-rating"),d=s("Choose stars size","yet-another-stars-rating"),f=s("Small","yet-another-stars-rating"),v=s("Medium","yet-another-stars-rating"),g=s("Large","yet-another-stars-rating"),h=s("Leave this blank if you don't know what you're doing.","yet-another-stars-rating"),R=s("Remember: only the post author can rate here.","yet-another-stars-rating"),b=s("This is the star set where your users will be able to vote","yet-another-stars-rating"),E=s('This block is now deprecated. It will still work, but I suggest to replace it with the new one by simply removing it and adding "Yasr Overall Rating" again.',"yet-another-stars-rating"),w=s('This block is now deprecated. It will still work, but I suggest to replace it with the new one by simply removing it and adding "Yasr Visitors Votes" again.',"yet-another-stars-rating");l("yet-another-stars-rating/yasr-overall-rating",{title:s("[DEPRECATED]Yasr: Overall Rating","yet-another-stars-rating"),description:E,icon:"star-half",keywords:[s("rating","yet-another-stars-rating"),s("author","yet-another-stars-rating"),s("overall","yet-another-stars-rating")],attributes:{overallRatingMeta:{type:"number",source:"meta",meta:"yasr_overall_rating"},size:{type:"string",default:"--"},postId:{type:"string",default:"--"}},edit:function(e){var l,o=e.attributes,u=o.overallRatingMeta,b=o.size,E=o.postId,w=e.setAttributes,k=e.isSelected,_=u,S=null,P=null;"--"!==b&&(S=' size="'+b+'"'),l=/^\d+$/.test(E),"--"!==E&&!0===l&&(P=' postid="'+E+'"');var O=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(m,React.Component);var l,o,i,c,u=(i=m,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=n(i);if(c){var a=n(this).constructor;e=Reflect.construct(t,arguments,a)}else e=t.apply(this,arguments);return r(this,e)});function m(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,m),(t=u.call(this,e)).yasrOverallRateThis=s("Rate this article / item","yet-another-stars-rating"),t}return l=m,(o=[{key:"render",value:function(){return React.createElement("div",null,this.yasrOverallRateThis,React.createElement("div",null,React.createElement("div",{id:"overall-rater",ref:function(){return raterJs({starSize:32,step:.1,showToolTip:!1,rating:_,readOnly:!1,element:document.querySelector("#overall-rater"),rateCallback:function(e,t){e=e.toFixed(1),e=parseFloat(e),w({overallRatingMeta:e}),this.setRating(e),t()}})}})))}}])&&t(l.prototype,o),m}();function C(){return React.createElement("form",null,React.createElement("select",{value:b,onChange:N},React.createElement("option",{value:"--"},d),React.createElement("option",{value:"small"},f),React.createElement("option",{value:"medium"},v),React.createElement("option",{value:"large"},g)))}function N(e){var t=e.target.querySelector("option:checked");w({size:t.value}),e.preventDefault()}function x(){return React.createElement("div",null,React.createElement("input",{type:"text",size:"4",onKeyPress:I}))}function I(e){if("Enter"===e.key){var t=e.target.value;!0!==/^\d+$/.test(t)&&""!==t||w({postId:t}),e.preventDefault()}}function z(e){return React.createElement(m,null,React.createElement("div",{class:"yasr-guten-block-panel yasr-guten-block-panel-center"},React.createElement(O,null)),React.createElement(i,{title:"Settings"},React.createElement("h3",null,y),React.createElement("div",{className:"yasr-guten-block-panel"},React.createElement("label",null,p),React.createElement("div",null,React.createElement(C,null))),React.createElement("div",{className:"yasr-guten-block-panel"},React.createElement("label",null,"Post ID"),React.createElement(x,null),React.createElement("div",{className:"yasr-guten-block-explain"},h)),React.createElement("div",{className:"yasr-guten-block-panel"},R)))}return React.createElement(c,null,React.createElement(z,null),React.createElement("div",{className:e.className},"[yasr_overall_rating",S,P,"]",k&&React.createElement(C,null)))},save:function(e){var t=e.attributes,a=t.size,r=t.postId,n="",s=r;return a&&(n+='size="'+a+'"'),r&&("--"===r&&(s=wp.data.select("core/editor").getCurrentPostId()),n+=' postid="'+s+'"'),React.createElement("div",null,"[yasr_overall_rating ",n,"]")}}),l("yet-another-stars-rating/yasr-visitor-votes",{title:s("[DEPRECATED]Yasr: Visitor Votes","yet-another-stars-rating"),description:w,icon:"star-half",keywords:[s("rating","yet-another-stars-rating"),s("visitor","yet-another-stars-rating"),s("votes","yet-another-stars-rating")],attributes:{size:{type:"string",default:"--"},postId:{type:"string",default:"--"}},edit:function(e){var t,a=e.attributes,r=a.size,n=a.postId,s=e.setAttributes,l=e.isSelected,o=null,u=null;function R(){return React.createElement("form",null,React.createElement("select",{value:r,onChange:E},React.createElement("option",{value:"--"},d),React.createElement("option",{value:"small"},f),React.createElement("option",{value:"medium"},v),React.createElement("option",{value:"large"},g)))}function E(e){var t=e.target.querySelector("option:checked");s({size:t.value}),e.preventDefault()}function w(){return React.createElement("div",null,React.createElement("input",{type:"text",size:"4",onKeyPress:k}))}function k(e){if("Enter"===e.key){var t=e.target.value;!0!==/^\d+$/.test(t)&&""!==t||s({postId:t}),e.preventDefault()}}function _(e){return React.createElement(m,null,React.createElement(i,{title:"Settings"},React.createElement("h3",null,y),React.createElement("div",{className:"yasr-guten-block-panel"},React.createElement("label",null,p),React.createElement("div",null,React.createElement(R,null))),React.createElement("div",{className:"yasr-guten-block-panel"},React.createElement("label",null,"Post ID"),React.createElement(w,null),React.createElement("div",{className:"yasr-guten-block-explain"},h)),React.createElement("div",{className:"yasr-guten-block-panel"},b)))}return t=/^\d+$/.test(n),"--"!==r&&(o=' size="'+r+'"'),"--"!==n&&!0===t&&(u=' postid="'+n+'"'),React.createElement(c,null,React.createElement(_,null),React.createElement("div",{className:e.className},"[yasr_visitor_votes",o,u,"]",l&&React.createElement(R,null)))},save:function(e){var t=e.attributes,a=t.size,r=t.postId,n="",s=r;return a&&(n+='size="'+a+'"'),r&&("--"===r&&(s=wp.data.select("core/editor").getCurrentPostId()),n+=' postid="'+s+'"'),React.createElement("div",null,"[yasr_visitor_votes ",n,"]")}}),wp.data.dispatch("core/edit-post").hideBlockTypes("yet-another-stars-rating/yasr-overall-rating"),wp.data.dispatch("core/edit-post").hideBlockTypes("yet-another-stars-rating/yasr-visitor-votes")})(),(()=>{"use strict";var e=a(245);function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,a){return t&&n(e.prototype,t),a&&n(e,a),e}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}function i(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=m(e);if(t){var n=m(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return c(this,a)}}function c(e,a){if(a&&("object"===t(a)||"function"==typeof a))return a;if(void 0!==a)throw new TypeError("Derived constructors may only return object or undefined");return u(e)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}var y=wp.i18n.__,p=wp.plugins.registerPlugin,d=wp.editPost,f=d.PluginSidebar,v=d.PluginSidebarMoreMenuItem,g=wp.components.PanelBody,h=wp.element.Fragment,R=function(){return React.createElement("div",null)},b=function(e){l(a,React.Component);var t=i(a);function a(e){var n;r(this,a),n=t.call(this,e);var s=!1;return"yes"===wp.data.select("core/editor").getCurrentPost().meta.yasr_auto_insert_disabled&&(s=!0),n.state={postExcluded:s},n.yasrUpdatePostMetaAutoInsert=n.yasrUpdatePostMetaAutoInsert.bind(u(n)),n}return s(a,[{key:"yasrUpdatePostMetaAutoInsert",value:function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value;this.setState({postExcluded:a}),!0===a?wp.data.dispatch("core/editor").editPost({meta:{yasr_auto_insert_disabled:"yes"}}):wp.data.dispatch("core/editor").editPost({meta:{yasr_auto_insert_disabled:"no"}})}},{key:"render",value:function(){return React.createElement("div",{className:"yasr-guten-block-panel-center"},React.createElement("hr",null),React.createElement("label",null,React.createElement("span",null,y("Disable auto insert for this post or page?","yet-another-stars-rating"))),React.createElement("div",{className:"yasr-onoffswitch-big yasr-onoffswitch-big-center",id:"yasr-switcher-disable-auto-insert"},React.createElement("input",{type:"checkbox",name:"yasr_auto_insert_disabled",className:"yasr-onoffswitch-checkbox",value:"yes",id:"yasr-auto-insert-disabled-switch",defaultChecked:this.state.postExcluded,onChange:this.yasrUpdatePostMetaAutoInsert}),React.createElement("label",{className:"yasr-onoffswitch-label",htmlFor:"yasr-auto-insert-disabled-switch"},React.createElement("span",{className:"yasr-onoffswitch-inner"}),React.createElement("span",{className:"yasr-onoffswitch-switch"}))))}}]),a}(),E=function(e){l(a,React.Component);var t=i(a);function a(e){var n,s,l,o;r(this,a),o=void 0,(l="yasrProLabelReviewsEnabled")in(s=u(n=t.call(this,e)))?Object.defineProperty(s,l,{value:o,enumerable:!0,configurable:!0,writable:!0}):s[l]=o,n.yasrProLabelReviewsEnabled=y("Reviews in comments for this post / page are disabled","yet-another-stars-rating");var i=+wp.data.select("core/editor").getCurrentPost().yasr_pro_comment_review_enabled;return 1===i&&(n.yasrProLabelReviewsEnabled=y("Reviews in comments for this post / page are enabled","yet-another-stars-rating")),n.state={reviewEnabled:i},n.yasrUpdatePostMetaReviewsEnabled=n.yasrUpdatePostMetaReviewsEnabled.bind(u(n)),n}return s(a,[{key:"yasrUpdatePostMetaReviewsEnabled",value:function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value,r=document.getElementById("yasr-pro-multiset-review-switcher");this.setState({reviewEnabled:a}),!0===a?wp.data.dispatch("core/editor").editPost({meta:{yasr_pro_reviews_in_comment_enabled:"1"}}):(r.checked=!1,wp.data.dispatch("core/editor").editPost({meta:{yasr_pro_reviews_in_comment_enabled:"0"}}))}},{key:"render",value:function(){return React.createElement("div",null,React.createElement("hr",null),React.createElement("label",null,React.createElement("span",null,this.yasrProLabelReviewsEnabled)),React.createElement("div",{className:"yasr-onoffswitch-big yasr-onoffswitch-big-center",id:"yasr-switcher-disable-comment-reviews"},React.createElement("input",{type:"checkbox",name:"yasr_comment_reviews_disabled",className:"yasr-onoffswitch-checkbox",value:"1",id:"yasr-comment-reviews-disabled-switch",defaultChecked:this.state.reviewEnabled,onChange:this.yasrUpdatePostMetaReviewsEnabled}),React.createElement("label",{className:"yasr-onoffswitch-label",htmlFor:"yasr-comment-reviews-disabled-switch"},React.createElement("span",{className:"yasr-onoffswitch-inner yasr-onoffswitch-onoff-inner"}),React.createElement("span",{className:"yasr-onoffswitch-switch"}))),React.createElement("div",{className:"yasr-metabox-doc-link"},React.createElement("a",{href:"https://yetanotherstarsrating.com/yasr-pro/reviews-in-comments/?utm_source=wp-plugin&utm_medium=tinymce-popup&utm_campaign=yasr_top_right",target:"_blank"},y("Help","yet-another-stars-rating"))))}}]),a}(),w=function(e){l(a,React.Component);var t=i(a);function a(e){var n;return r(this,a),(n=t.call(this,e)).state={numberFakeRatings:0},n.state={fakeRating:5},n.state={ajaxResponse:""},n.yasrNumberFakeRatings=n.yasrNumberFakeRatings.bind(u(n)),n.yasrFakeRating=n.yasrFakeRating.bind(u(n)),n.yasrSaveFakeRatings=n.yasrSaveFakeRatings.bind(u(n)),n}return s(a,[{key:"yasrNumberFakeRatings",value:function(e){this.setState({numberFakeRatings:e.target.value})}},{key:"yasrFakeRating",value:function(e){this.setState({fakeRating:e.target.value})}},{key:"yasrSaveFakeRatings",value:function(e){var t=wp.data.select("core/editor").getCurrentPostId();if(this.state.numberFakeRatings>0&&this.state.numberFakeRatings<201){var a=function(e){"OK"===e?s.setState({ajaxResponse:y("Done!","yet-another-stars-rating")}):s.setState({ajaxResponse:y("Error","yet-another-stars-rating")})};this.setState({ajaxResponse:y("Loading, please wait","yet-another-stars-rating")});var r=this.state.fakeRating,n=this.state.numberFakeRatings;null==r&&(r=5);var s=this,l={action:"yasr_adds_fake_ratings",yasr_pro_nonce_fake_ratings:yasrConstantGutenberg.yasr_pro_nonce_fake_ratings,yasr_pro_fake_number_of_votes:n,yasr_pro_fake_ratings:r,post_id:t};jQuery.post(ajaxurl,l,(function(e){a(e)})).fail((function(e,t,r,n){a("KO")}))}}},{key:"render",value:function(){var e=!0;return!0===JSON.parse(yasrConstantGutenberg.proVersion)&&(e=!1),React.createElement("div",null,React.createElement("hr",null),React.createElement("strong",null,y("Add fake ratings","yet-another-stars-rating")),React.createElement("p",null),React.createElement("div",null,y("Number of votes","yet-another-stars-rating"),React.createElement("br",null),React.createElement("div",null,React.createElement("label",{htmlFor:"yasr-pro-fake-number-of-votes"},React.createElement("select",{name:"yasr-pro-fake-number-of-votes",id:"yasr-pro-fake-number-of-votes",onChange:this.yasrNumberFakeRatings,disabled:e},React.createElement("option",{value:"none",defaultValue:!0},"0"),React.createElement("option",{value:"1"},"1"),React.createElement("option",{value:"2"},"2"),React.createElement("option",{value:"5"},"5"),React.createElement("option",{value:"10"},"10"),React.createElement("option",{value:"20"},"20"),React.createElement("option",{value:"50"},"50"),React.createElement("option",{value:"100"},"100"),React.createElement("option",{value:"200"},"200"))))),y("Rating:","yet-another-stars-rating"),React.createElement("div",null,React.createElement("label",{htmlFor:"yasr-pro-fake-ratings"},React.createElement("select",{name:"yasr-pro-fake-ratings",id:"yasr-pro-fake-ratings",value:this.state.fakeRating,onChange:this.yasrFakeRating,disabled:e},React.createElement("option",{value:"5"},"5"),React.createElement("option",{value:"4"},"4"),React.createElement("option",{value:"3"},"3"),React.createElement("option",{value:"2"},"2"),React.createElement("option",{value:"1"},"1"))),React.createElement("p",null),React.createElement("div",null,y("This will add ratings for yasr_visitor_votes shortcode.","yet-another-stars-rating"))),React.createElement("div",null,React.createElement("br",null),React.createElement("button",{onClick:this.yasrSaveFakeRatings,disabled:e},"Save"),React.createElement("br",null),this.state.ajaxResponse),React.createElement("div",{className:"yasr-metabox-doc-link"},React.createElement("a",{href:"https://yetanotherstarsrating.com/yasr_fake_ratings/?utm_source=wp-plugin&utm_medium=tinymce-popup&utm_campaign=yasr_top_right",target:"_blank"},y("Help","yet-another-stars-rating"))))}}]),a}(),k=function(t){l(n,React.Component);var a=i(n);function n(e){var t;r(this,n),t=a.call(this,e);var s=!1;return"disabled"!==yasrConstantGutenberg.autoInsert&&(s=!0),t.state={yasrAutoInsertEnabled:s},t}return s(n,[{key:"render",value:function(){var t=[React.createElement(R,{key:0})];return wp.hooks.doAction("yasr_below_panel",t),React.createElement(h,null,React.createElement(v,{name:"yasr-sidebar",type:"sidebar",target:"yasr-guten-sidebar"},y("YASR post settings","yet-another-stars-rating")),React.createElement(f,{name:"yasr-guten-sidebar",title:"YASR Settings"},React.createElement(g,null,React.createElement("div",{className:"yasr-guten-block-panel yasr-guten-block-panel-center"},React.createElement(e.YasrDivRatingOverall,null),React.createElement("div",null,y('This is the same value that you find the "Yasr: Overall Rating" block.',"yet-another-stars-rating")),this.state.yasrAutoInsertEnabled&&React.createElement(b,null),React.createElement("p",null),React.createElement("div",{className:"yasr-metabox-editor-pro-only-box"},React.createElement("div",{className:"yasr-metabox-editor-title-pro-only"},y("Pro Only features","yet-another-stars-rating"),React.createElement("span",{className:yasrConstantGutenberg.lockedClass,title:yasrConstantGutenberg.lockedText})),React.createElement(E,null),React.createElement(w,null)),t))))}}]),n}();p("yasr-sidebar",{name:"Yet Another Stars Rating",icon:"star-half",title:y("Yasr: Settings","yet-another-stars-rating"),render:k})})()})();
|
1 |
+
(()=>{var e={245:(e,t,a)=>{"use strict";a.r(t),a.d(t,{YasrBlocksPanel:()=>R,YasrDivRatingOverall:()=>E,YasrNoSettingsPanel:()=>b,YasrPrintInputId:()=>h,YasrPrintSelectSize:()=>g,YasrProText:()=>v,yasrLabelSelectSize:()=>i,yasrLeaveThisBlankText:()=>m,yasrOptionalText:()=>s,yasrOverallDescription:()=>d,yasrSelectSizeChoose:()=>c,yasrSelectSizeLarge:()=>p,yasrSelectSizeMedium:()=>y,yasrSelectSizeSmall:()=>u,yasrVisitorVotesDescription:()=>f});var r=a(245),n=wp.i18n.__,o=wp.components.PanelBody,l=wp.blockEditor.InspectorControls,s=n("All these settings are optional","yet-another-stars-rating"),i=n("Choose Size","yet-another-stars-rating"),c=n("Choose stars size","yet-another-stars-rating"),u=n("Small","yet-another-stars-rating"),y=n("Medium","yet-another-stars-rating"),p=n("Large","yet-another-stars-rating"),m=n("Leave this blank if you don't know what you're doing.","yet-another-stars-rating"),d=n("Remember: only the post author can rate here.","yet-another-stars-rating"),f=n("This is the star set where your users will be able to vote","yet-another-stars-rating");function g(e){return React.createElement("form",null,React.createElement("select",{value:e.size,onChange:function(t){return(0,e.setAttributes)({size:(a=t).target.querySelector("option:checked").value}),void a.preventDefault();var a}},React.createElement("option",{value:"--"},r.yasrSelectSizeChoose),React.createElement("option",{value:"small"},r.yasrSelectSizeSmall),React.createElement("option",{value:"medium"},r.yasrSelectSizeMedium),React.createElement("option",{value:"large"},r.yasrSelectSizeLarge)))}function h(e){var t;return!1!==e.postId&&(t=e.postId),React.createElement("div",null,React.createElement("input",{type:"text",size:"4",defaultValue:t,onKeyPress:function(t){return function(e,t){if("Enter"===t.key){var a=t.target.value;!0!==/^\d+$/.test(a)&&""!==a||e({postId:a}),t.preventDefault()}}(e.setAttributes,t)}}))}function v(){var e=n("To be able to customize this ranking, you need","yet-another-stars-rating"),t=n("You can buy the plugin, including support, updates and upgrades, on","yet-another-stars-rating");return React.createElement("h3",null,e," ",React.createElement("a",{href:"https://yetanotherstarsrating.com/?utm_source=wp-plugin&utm_medium=gutenberg_panel&utm_campaign=yasr_editor_screen&utm_content=rankings#yasr-pro"},"Yasr Pro."),React.createElement("br",null),t," ",React.createElement("a",{href:"https://yetanotherstarsrating.com/?utm_source=wp-plugin&utm_medium=gutenberg_panel&utm_campaign=yasr_editor_screen&utm_content=rankings"},"yetanotherstarsrating.com"))}function b(e){return React.createElement("div",null,React.createElement(v,null))}function R(e){var t;return"visitors"===e.block&&(t=f),"overall"===e.block&&(t=d),React.createElement(l,null,"overall"===e.block&&React.createElement(E,null),React.createElement(o,{title:"Settings"},React.createElement("h3",null,s),React.createElement("div",{className:"yasr-guten-block-panel"},React.createElement("label",null,i),React.createElement("div",null,React.createElement(g,{size:e.size,setAttributes:e.setAttributes}))),React.createElement("div",{className:"yasr-guten-block-panel"},React.createElement("label",null,"Post ID"),React.createElement(h,{postId:e.postId,setAttributes:e.setAttributes}),React.createElement("div",{className:"yasr-guten-block-explain"},m)),React.createElement("div",{className:"yasr-guten-block-panel"},t)))}function E(e){if(!0===JSON.parse(yasrConstantGutenberg.isFseElement))return React.createElement("div",{className:"yasr-guten-block-panel yasr-guten-block-panel-center"},React.createElement("div",null,n("This is a template file, you can't rate here. You need to insert the rating inside the single post or page","yet-another-stars-rating")),React.createElement("br",null));var t=n("Rate this article / item","yet-another-stars-rating"),a=wp.data.select("core/editor").getCurrentPost().meta.yasr_overall_rating,r=function(e,t){e=e.toFixed(1),e=parseFloat(e),wp.data.dispatch("core/editor").editPost({meta:{yasr_overall_rating:e}}),this.setRating(e),t()};return React.createElement("div",{className:"yasr-guten-block-panel yasr-guten-block-panel-center"},t,React.createElement("div",{id:"overall-rater",ref:function(){return function(e,t){var a,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.1,n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],l=arguments.length>6&&void 0!==arguments[6]&&arguments[6];a=arguments.length>2&&void 0!==arguments[2]&&arguments[2]||document.getElementById(t),e=parseInt(e),raterJs({starSize:e,showToolTip:!1,element:a,step:r,readOnly:n,rating:o,rateCallback:l})}(32,"overall-rater",!1,.1,!1,a,r)}}))}}},t={};function a(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,a),o.exports}a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function r(t,a){if(a&&("object"===e(a)||"function"==typeof a))return a;if(void 0!==a)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t)}function n(e){return n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(e)}var o=wp.i18n.__,l=wp.blocks.registerBlockType,s=wp.components,i=s.PanelBody,c=(s.PanelRow,wp.element.Fragment),u=wp.editor,y=(u.BlockControls,u.InspectorControls),p=o("All these settings are optional","yet-another-stars-rating"),m=o("Choose Size","yet-another-stars-rating"),d=o("Choose stars size","yet-another-stars-rating"),f=o("Small","yet-another-stars-rating"),g=o("Medium","yet-another-stars-rating"),h=o("Large","yet-another-stars-rating"),v=o("Leave this blank if you don't know what you're doing.","yet-another-stars-rating"),b=o("Remember: only the post author can rate here.","yet-another-stars-rating"),R=o("This is the star set where your users will be able to vote","yet-another-stars-rating"),E=o('This block is now deprecated. It will still work, but I suggest to replace it with the new one by simply removing it and adding "Yasr Overall Rating" again.',"yet-another-stars-rating"),w=o('This block is now deprecated. It will still work, but I suggest to replace it with the new one by simply removing it and adding "Yasr Visitors Votes" again.',"yet-another-stars-rating");l("yet-another-stars-rating/yasr-overall-rating",{title:o("[DEPRECATED]Yasr: Overall Rating","yet-another-stars-rating"),description:E,icon:"star-half",keywords:[o("rating","yet-another-stars-rating"),o("author","yet-another-stars-rating"),o("overall","yet-another-stars-rating")],attributes:{overallRatingMeta:{type:"number",source:"meta",meta:"yasr_overall_rating"},size:{type:"string",default:"--"},postId:{type:"string",default:"--"}},edit:function(e){var l,s=e.attributes,u=s.overallRatingMeta,R=s.size,E=s.postId,w=e.setAttributes,k=e.isSelected,_=u,S=null,P=null;"--"!==R&&(S=' size="'+R+'"'),l=/^\d+$/.test(E),"--"!==E&&!0===l&&(P=' postid="'+E+'"');var O=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(y,React.Component);var l,s,i,c,u=(i=y,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=n(i);if(c){var a=n(this).constructor;e=Reflect.construct(t,arguments,a)}else e=t.apply(this,arguments);return r(this,e)});function y(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,y),(t=u.call(this,e)).yasrOverallRateThis=o("Rate this article / item","yet-another-stars-rating"),t}return l=y,(s=[{key:"render",value:function(){return React.createElement("div",null,this.yasrOverallRateThis,React.createElement("div",null,React.createElement("div",{id:"overall-rater",ref:function(){return raterJs({starSize:32,step:.1,showToolTip:!1,rating:_,readOnly:!1,element:document.querySelector("#overall-rater"),rateCallback:function(e,t){e=e.toFixed(1),e=parseFloat(e),w({overallRatingMeta:e}),this.setRating(e),t()}})}})))}}])&&t(l.prototype,s),y}();function z(){return React.createElement("form",null,React.createElement("select",{value:R,onChange:I},React.createElement("option",{value:"--"},d),React.createElement("option",{value:"small"},f),React.createElement("option",{value:"medium"},g),React.createElement("option",{value:"large"},h)))}function I(e){var t=e.target.querySelector("option:checked");w({size:t.value}),e.preventDefault()}function T(){return React.createElement("div",null,React.createElement("input",{type:"text",size:"4",onKeyPress:C}))}function C(e){if("Enter"===e.key){var t=e.target.value;!0!==/^\d+$/.test(t)&&""!==t||w({postId:t}),e.preventDefault()}}function N(e){return React.createElement(y,null,React.createElement("div",{class:"yasr-guten-block-panel yasr-guten-block-panel-center"},React.createElement(O,null)),React.createElement(i,{title:"Settings"},React.createElement("h3",null,p),React.createElement("div",{className:"yasr-guten-block-panel"},React.createElement("label",null,m),React.createElement("div",null,React.createElement(z,null))),React.createElement("div",{className:"yasr-guten-block-panel"},React.createElement("label",null,"Post ID"),React.createElement(T,null),React.createElement("div",{className:"yasr-guten-block-explain"},v)),React.createElement("div",{className:"yasr-guten-block-panel"},b)))}return React.createElement(c,null,React.createElement(N,null),React.createElement("div",{className:e.className},"[yasr_overall_rating",S,P,"]",k&&React.createElement(z,null)))},save:function(e){var t=e.attributes,a=t.size,r=t.postId,n="",o=r;return a&&(n+='size="'+a+'"'),r&&("--"===r&&(o=wp.data.select("core/editor").getCurrentPostId()),n+=' postid="'+o+'"'),React.createElement("div",null,"[yasr_overall_rating ",n,"]")}}),l("yet-another-stars-rating/yasr-visitor-votes",{title:o("[DEPRECATED]Yasr: Visitor Votes","yet-another-stars-rating"),description:w,icon:"star-half",keywords:[o("rating","yet-another-stars-rating"),o("visitor","yet-another-stars-rating"),o("votes","yet-another-stars-rating")],attributes:{size:{type:"string",default:"--"},postId:{type:"string",default:"--"}},edit:function(e){var t,a=e.attributes,r=a.size,n=a.postId,o=e.setAttributes,l=e.isSelected,s=null,u=null;function b(){return React.createElement("form",null,React.createElement("select",{value:r,onChange:E},React.createElement("option",{value:"--"},d),React.createElement("option",{value:"small"},f),React.createElement("option",{value:"medium"},g),React.createElement("option",{value:"large"},h)))}function E(e){var t=e.target.querySelector("option:checked");o({size:t.value}),e.preventDefault()}function w(){return React.createElement("div",null,React.createElement("input",{type:"text",size:"4",onKeyPress:k}))}function k(e){if("Enter"===e.key){var t=e.target.value;!0!==/^\d+$/.test(t)&&""!==t||o({postId:t}),e.preventDefault()}}function _(e){return React.createElement(y,null,React.createElement(i,{title:"Settings"},React.createElement("h3",null,p),React.createElement("div",{className:"yasr-guten-block-panel"},React.createElement("label",null,m),React.createElement("div",null,React.createElement(b,null))),React.createElement("div",{className:"yasr-guten-block-panel"},React.createElement("label",null,"Post ID"),React.createElement(w,null),React.createElement("div",{className:"yasr-guten-block-explain"},v)),React.createElement("div",{className:"yasr-guten-block-panel"},R)))}return t=/^\d+$/.test(n),"--"!==r&&(s=' size="'+r+'"'),"--"!==n&&!0===t&&(u=' postid="'+n+'"'),React.createElement(c,null,React.createElement(_,null),React.createElement("div",{className:e.className},"[yasr_visitor_votes",s,u,"]",l&&React.createElement(b,null)))},save:function(e){var t=e.attributes,a=t.size,r=t.postId,n="",o=r;return a&&(n+='size="'+a+'"'),r&&("--"===r&&(o=wp.data.select("core/editor").getCurrentPostId()),n+=' postid="'+o+'"'),React.createElement("div",null,"[yasr_visitor_votes ",n,"]")}}),wp.data.dispatch("core/edit-post").hideBlockTypes("yet-another-stars-rating/yasr-overall-rating"),wp.data.dispatch("core/edit-post").hideBlockTypes("yet-another-stars-rating/yasr-visitor-votes")})(),(()=>{"use strict";var e=a(245);function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,a){return t&&n(e.prototype,t),a&&n(e,a),e}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}function i(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=y(e);if(t){var n=y(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return c(this,a)}}function c(e,a){if(a&&("object"===t(a)||"function"==typeof a))return a;if(void 0!==a)throw new TypeError("Derived constructors may only return object or undefined");return u(e)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}var p=wp.i18n.__,m=wp.plugins.registerPlugin,d=wp.editPost,f=d.PluginSidebar,g=d.PluginSidebarMoreMenuItem,h=wp.components.PanelBody,v=wp.element.Fragment,b=function(){return React.createElement("div",null)},R=function(e){l(a,React.Component);var t=i(a);function a(e){var n;r(this,a),n=t.call(this,e);var o=!1;return"yes"===wp.data.select("core/editor").getCurrentPost().meta.yasr_auto_insert_disabled&&(o=!0),n.state={postExcluded:o},n.yasrUpdatePostMetaAutoInsert=n.yasrUpdatePostMetaAutoInsert.bind(u(n)),n}return o(a,[{key:"yasrUpdatePostMetaAutoInsert",value:function(e){var t=e.target,a="checkbox"===t.type?t.checked:t.value;this.setState({postExcluded:a}),!0===a?wp.data.dispatch("core/editor").editPost({meta:{yasr_auto_insert_disabled:"yes"}}):wp.data.dispatch("core/editor").editPost({meta:{yasr_auto_insert_disabled:"no"}})}},{key:"render",value:function(){return React.createElement("div",{className:"yasr-guten-block-panel-center"},React.createElement("hr",null),React.createElement("label",null,React.createElement("span",null,p("Disable auto insert for this post or page?","yet-another-stars-rating"))),React.createElement("div",{className:"yasr-onoffswitch-big yasr-onoffswitch-big-center",id:"yasr-switcher-disable-auto-insert"},React.createElement("input",{type:"checkbox",name:"yasr_auto_insert_disabled",className:"yasr-onoffswitch-checkbox",value:"yes",id:"yasr-auto-insert-disabled-switch",defaultChecked:this.state.postExcluded,onChange:this.yasrUpdatePostMetaAutoInsert}),React.createElement("label",{className:"yasr-onoffswitch-label",htmlFor:"yasr-auto-insert-disabled-switch"},React.createElement("span",{className:"yasr-onoffswitch-inner"}),React.createElement("span",{className:"yasr-onoffswitch-switch"}))))}}]),a}(),E=function(t){l(n,React.Component);var a=i(n);function n(e){var t;r(this,n),t=a.call(this,e);var o=!1;return"disabled"!==yasrConstantGutenberg.autoInsert&&(o=!0),t.state={yasrAutoInsertEnabled:o},t}return o(n,[{key:"render",value:function(){var t=[React.createElement(b,{key:0})];return wp.hooks.doAction("yasr_below_panel",t),React.createElement(v,null,React.createElement(g,{name:"yasr-sidebar",type:"sidebar",target:"yasr-guten-sidebar"},p("YASR post settings","yet-another-stars-rating")),React.createElement(f,{name:"yasr-guten-sidebar",title:"YASR Settings"},React.createElement(h,null,React.createElement("div",{className:"yasr-guten-block-panel yasr-guten-block-panel-center"},React.createElement(e.YasrDivRatingOverall,null),React.createElement("div",null,p('This is the same value that you find the "Yasr: Overall Rating" block.',"yet-another-stars-rating")),this.state.yasrAutoInsertEnabled&&React.createElement(R,null),t))))}}]),n}();m("yasr-sidebar",{icon:"star-half",title:p("Yasr: Settings","yet-another-stars-rating"),render:E})})()})();
|
admin/js/src/guten/yasr-guten-panel.js
CHANGED
@@ -72,238 +72,6 @@ class YasrSideBarAutoInsert extends React.Component {
|
|
72 |
|
73 |
}
|
74 |
|
75 |
-
/**
|
76 |
-
* Auto insert Comment Reviews
|
77 |
-
*/
|
78 |
-
class YasrCommentReviewsEnabled extends React.Component {
|
79 |
-
yasrProLabelReviewsEnabled;
|
80 |
-
|
81 |
-
constructor(props) {
|
82 |
-
super(props);
|
83 |
-
|
84 |
-
//by default, set to disable
|
85 |
-
this.yasrProLabelReviewsEnabled = __('Reviews in comments for this post / page are disabled', 'yet-another-stars-rating');
|
86 |
-
|
87 |
-
//get rest yasr_pro_comment_review_enabled
|
88 |
-
//YOURSITE.COM/wp-json/wp/v2/posts/<POSTID>?_fields=yasr_pro_comment_review_enabled
|
89 |
-
//with + convert bool to int
|
90 |
-
let reviewEnabledForPost = + wp.data.select('core/editor').getCurrentPost().yasr_pro_comment_review_enabled;
|
91 |
-
|
92 |
-
if (reviewEnabledForPost === 1) {
|
93 |
-
this.yasrProLabelReviewsEnabled = __('Reviews in comments for this post / page are enabled', 'yet-another-stars-rating');
|
94 |
-
}
|
95 |
-
|
96 |
-
this.state = {reviewEnabled: reviewEnabledForPost};
|
97 |
-
|
98 |
-
this.yasrUpdatePostMetaReviewsEnabled = this.yasrUpdatePostMetaReviewsEnabled.bind(this);
|
99 |
-
}
|
100 |
-
|
101 |
-
yasrUpdatePostMetaReviewsEnabled(event) {
|
102 |
-
const target = event.target;
|
103 |
-
const reviewEnabled = target.type === 'checkbox' ? target.checked : target.value;
|
104 |
-
|
105 |
-
const multiSetinReview = document.getElementById('yasr-pro-multiset-review-switcher');
|
106 |
-
|
107 |
-
this.setState({reviewEnabled: reviewEnabled});
|
108 |
-
|
109 |
-
//MUST be saved as a string
|
110 |
-
if (reviewEnabled === true) {
|
111 |
-
wp.data.dispatch('core/editor').editPost(
|
112 |
-
{ meta: { yasr_pro_reviews_in_comment_enabled: '1' } }
|
113 |
-
);
|
114 |
-
} else {
|
115 |
-
multiSetinReview.checked = false;
|
116 |
-
wp.data.dispatch('core/editor').editPost(
|
117 |
-
{ meta: { yasr_pro_reviews_in_comment_enabled: '0' } }
|
118 |
-
);
|
119 |
-
}
|
120 |
-
}
|
121 |
-
|
122 |
-
render () {
|
123 |
-
return (
|
124 |
-
<div>
|
125 |
-
<hr/>
|
126 |
-
<label><span>{this.yasrProLabelReviewsEnabled}</span></label>
|
127 |
-
<div className="yasr-onoffswitch-big yasr-onoffswitch-big-center" id="yasr-switcher-disable-comment-reviews">
|
128 |
-
<input type="checkbox"
|
129 |
-
name="yasr_comment_reviews_disabled"
|
130 |
-
className="yasr-onoffswitch-checkbox"
|
131 |
-
value="1"
|
132 |
-
id="yasr-comment-reviews-disabled-switch"
|
133 |
-
defaultChecked={this.state.reviewEnabled}
|
134 |
-
onChange={this.yasrUpdatePostMetaReviewsEnabled}
|
135 |
-
/>
|
136 |
-
|
137 |
-
<label className="yasr-onoffswitch-label" htmlFor="yasr-comment-reviews-disabled-switch">
|
138 |
-
<span className="yasr-onoffswitch-inner yasr-onoffswitch-onoff-inner" />
|
139 |
-
<span className="yasr-onoffswitch-switch" />
|
140 |
-
</label>
|
141 |
-
</div>
|
142 |
-
<div className="yasr-metabox-doc-link">
|
143 |
-
<a href="https://yetanotherstarsrating.com/yasr-pro/reviews-in-comments/?utm_source=wp-plugin&utm_medium=tinymce-popup&utm_campaign=yasr_top_right"
|
144 |
-
target="_blank"
|
145 |
-
>
|
146 |
-
{__('Help', 'yet-another-stars-rating')}
|
147 |
-
</a>
|
148 |
-
</div>
|
149 |
-
</div>
|
150 |
-
);
|
151 |
-
}
|
152 |
-
}
|
153 |
-
|
154 |
-
/**
|
155 |
-
* Fake Ratings
|
156 |
-
*/
|
157 |
-
class YasrFakeRatings extends React.Component {
|
158 |
-
|
159 |
-
constructor(props) {
|
160 |
-
super(props);
|
161 |
-
|
162 |
-
this.state = {numberFakeRatings: 0};
|
163 |
-
this.state = {fakeRating: 5};
|
164 |
-
|
165 |
-
this.state = {ajaxResponse: ''};
|
166 |
-
|
167 |
-
this.yasrNumberFakeRatings = this.yasrNumberFakeRatings.bind(this);
|
168 |
-
this.yasrFakeRating = this.yasrFakeRating.bind(this);
|
169 |
-
this.yasrSaveFakeRatings = this.yasrSaveFakeRatings.bind(this);
|
170 |
-
}
|
171 |
-
|
172 |
-
yasrNumberFakeRatings(event) {
|
173 |
-
this.setState({numberFakeRatings: event.target.value});
|
174 |
-
}
|
175 |
-
|
176 |
-
yasrFakeRating(event) {
|
177 |
-
this.setState({fakeRating: event.target.value});
|
178 |
-
}
|
179 |
-
|
180 |
-
yasrSaveFakeRatings(event) {
|
181 |
-
|
182 |
-
const currentPostId = wp.data.select("core/editor").getCurrentPostId();
|
183 |
-
|
184 |
-
if(this.state.numberFakeRatings > 0 && this.state.numberFakeRatings < 201) {
|
185 |
-
this.setState({ajaxResponse: __('Loading, please wait', 'yet-another-stars-rating')});
|
186 |
-
|
187 |
-
let rating = this.state.fakeRating;
|
188 |
-
let number_of_votes = this.state.numberFakeRatings
|
189 |
-
|
190 |
-
//if select doesn't change value is undefined
|
191 |
-
if(rating == null) {
|
192 |
-
rating = 5;
|
193 |
-
}
|
194 |
-
|
195 |
-
//declaring function to set response
|
196 |
-
let self = this;
|
197 |
-
function setResponse(response) {
|
198 |
-
if(response === 'OK') {
|
199 |
-
self.setState({
|
200 |
-
ajaxResponse: __('Done!', 'yet-another-stars-rating'),
|
201 |
-
});
|
202 |
-
} else {
|
203 |
-
self.setState({
|
204 |
-
ajaxResponse: __('Error', 'yet-another-stars-rating'),
|
205 |
-
});
|
206 |
-
}
|
207 |
-
}
|
208 |
-
|
209 |
-
let data = {
|
210 |
-
action: 'yasr_adds_fake_ratings',
|
211 |
-
yasr_pro_nonce_fake_ratings: yasrConstantGutenberg.yasr_pro_nonce_fake_ratings,
|
212 |
-
yasr_pro_fake_number_of_votes: number_of_votes,
|
213 |
-
yasr_pro_fake_ratings: rating,
|
214 |
-
post_id: currentPostId
|
215 |
-
};
|
216 |
-
|
217 |
-
//Send value to the Server
|
218 |
-
jQuery.post(ajaxurl, data, function (response) {
|
219 |
-
setResponse(response);
|
220 |
-
}).fail(
|
221 |
-
function(e, x, settings, exception) {
|
222 |
-
setResponse('KO');
|
223 |
-
}
|
224 |
-
);
|
225 |
-
|
226 |
-
}
|
227 |
-
|
228 |
-
}
|
229 |
-
|
230 |
-
render () {
|
231 |
-
let selectDisabled = true;
|
232 |
-
|
233 |
-
if(JSON.parse(yasrConstantGutenberg.proVersion) === true) {
|
234 |
-
selectDisabled = false;
|
235 |
-
}
|
236 |
-
|
237 |
-
return (
|
238 |
-
<div>
|
239 |
-
<hr/>
|
240 |
-
<strong>{__('Add fake ratings', 'yet-another-stars-rating')}</strong>
|
241 |
-
<p />
|
242 |
-
<div>
|
243 |
-
{__('Number of votes', 'yet-another-stars-rating')}
|
244 |
-
<br />
|
245 |
-
<div>
|
246 |
-
<label htmlFor="yasr-pro-fake-number-of-votes">
|
247 |
-
<select name="yasr-pro-fake-number-of-votes"
|
248 |
-
id="yasr-pro-fake-number-of-votes"
|
249 |
-
onChange={this.yasrNumberFakeRatings}
|
250 |
-
disabled={selectDisabled}
|
251 |
-
>
|
252 |
-
<option value="none" defaultValue>0</option>
|
253 |
-
<option value="1">1</option>
|
254 |
-
<option value="2">2</option>
|
255 |
-
<option value="5">5</option>
|
256 |
-
<option value="10">10</option>
|
257 |
-
<option value="20">20</option>
|
258 |
-
<option value="50">50</option>
|
259 |
-
<option value="100">100</option>
|
260 |
-
<option value="200">200</option>
|
261 |
-
</select>
|
262 |
-
</label>
|
263 |
-
</div>
|
264 |
-
</div>
|
265 |
-
{__('Rating:', 'yet-another-stars-rating')}
|
266 |
-
<div>
|
267 |
-
<label htmlFor="yasr-pro-fake-ratings">
|
268 |
-
<select name="yasr-pro-fake-ratings"
|
269 |
-
id="yasr-pro-fake-ratings"
|
270 |
-
value={this.state.fakeRating}
|
271 |
-
onChange={this.yasrFakeRating}
|
272 |
-
disabled={selectDisabled}
|
273 |
-
>
|
274 |
-
<option value="5">5</option>
|
275 |
-
<option value="4">4</option>
|
276 |
-
<option value="3">3</option>
|
277 |
-
<option value="2">2</option>
|
278 |
-
<option value="1">1</option>
|
279 |
-
</select>
|
280 |
-
</label>
|
281 |
-
<p />
|
282 |
-
<div>
|
283 |
-
{__(
|
284 |
-
'This will add ratings for yasr_visitor_votes shortcode.',
|
285 |
-
'yet-another-stars-rating')
|
286 |
-
}
|
287 |
-
</div>
|
288 |
-
</div>
|
289 |
-
<div>
|
290 |
-
<br />
|
291 |
-
<button onClick={this.yasrSaveFakeRatings} disabled={selectDisabled}>Save</button>
|
292 |
-
<br />
|
293 |
-
{this.state.ajaxResponse}
|
294 |
-
</div>
|
295 |
-
<div className="yasr-metabox-doc-link">
|
296 |
-
<a href="https://yetanotherstarsrating.com/yasr_fake_ratings/?utm_source=wp-plugin&utm_medium=tinymce-popup&utm_campaign=yasr_top_right"
|
297 |
-
target="_blank"
|
298 |
-
>
|
299 |
-
{__('Help', 'yet-another-stars-rating')}
|
300 |
-
</a>
|
301 |
-
</div>
|
302 |
-
</div>
|
303 |
-
);
|
304 |
-
}
|
305 |
-
}
|
306 |
-
|
307 |
class yasrSidebar extends React.Component {
|
308 |
|
309 |
constructor(props) {
|
@@ -334,18 +102,9 @@ class yasrSidebar extends React.Component {
|
|
334 |
<YasrDivRatingOverall />
|
335 |
<div>
|
336 |
{__('This is the same value that you find the "Yasr: Overall Rating" block.',
|
337 |
-
|
338 |
</div>
|
339 |
{this.state.yasrAutoInsertEnabled && <YasrSideBarAutoInsert />}
|
340 |
-
<p />
|
341 |
-
<div className='yasr-metabox-editor-pro-only-box'>
|
342 |
-
<div className="yasr-metabox-editor-title-pro-only">
|
343 |
-
{__('Pro Only features', 'yet-another-stars-rating')}
|
344 |
-
<span className={yasrConstantGutenberg.lockedClass} title={yasrConstantGutenberg.lockedText}/>
|
345 |
-
</div>
|
346 |
-
<YasrCommentReviewsEnabled />
|
347 |
-
<YasrFakeRatings />
|
348 |
-
</div>
|
349 |
{YasrBelowSidebar}
|
350 |
</div>
|
351 |
</PanelBody>
|
@@ -357,7 +116,6 @@ class yasrSidebar extends React.Component {
|
|
357 |
|
358 |
//Custom sidebar
|
359 |
registerPlugin( 'yasr-sidebar', {
|
360 |
-
name: 'Yet Another Stars Rating',
|
361 |
icon: 'star-half',
|
362 |
title: __( 'Yasr: Settings', 'yet-another-stars-rating' ),
|
363 |
render: yasrSidebar
|
72 |
|
73 |
}
|
74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
class yasrSidebar extends React.Component {
|
76 |
|
77 |
constructor(props) {
|
102 |
<YasrDivRatingOverall />
|
103 |
<div>
|
104 |
{__('This is the same value that you find the "Yasr: Overall Rating" block.',
|
105 |
+
'yet-another-stars-rating')}
|
106 |
</div>
|
107 |
{this.state.yasrAutoInsertEnabled && <YasrSideBarAutoInsert />}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
{YasrBelowSidebar}
|
109 |
</div>
|
110 |
</PanelBody>
|
116 |
|
117 |
//Custom sidebar
|
118 |
registerPlugin( 'yasr-sidebar', {
|
|
|
119 |
icon: 'star-half',
|
120 |
title: __( 'Yasr: Settings', 'yet-another-stars-rating' ),
|
121 |
render: yasrSidebar
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: rating, rate post, rate page, star rating, google rating, votes
|
|
4 |
Requires at least: 5.0
|
5 |
Contributors: Dudo
|
6 |
Tested up to: 5.9
|
7 |
-
Stable tag: 2.9.
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
10 |
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
|
@@ -114,10 +114,8 @@ It is the first (and for now only) rating plugin that uses REST API.
|
|
114 |
Further, it comes with a lot of hooks, you can find more info [here](https://yetanotherstarsrating.com/docs/developers/) .
|
115 |
|
116 |
== Related Link ==
|
|
|
117 |
* Documentation at [Yasr Official Site](https://yetanotherstarsrating.com/docs/)
|
118 |
-
* [Demo page for Overall Rating and Vistor Rating](https://yetanotherstarsrating.com/yasr-basics-shortcode/)
|
119 |
-
* [Demo page for Multi Sets](https://yetanotherstarsrating.com/yasr-multi-sets/)
|
120 |
-
* [Demo page for Rankings](https://yetanotherstarsrating.com/yasr-rankings/)
|
121 |
|
122 |
Do you want more feature? [Check out Yasr Pro!](https://yetanotherstarsrating.com/#yasr-pro)
|
123 |
|
@@ -137,12 +135,12 @@ It is the vote given by who writes the review: readers are able to see this vote
|
|
137 |
= What is "Visitor Rating"? =
|
138 |
It is the vote that allows your visitors to vote: just paste this shortcode **[yasr_visitor_votes]** where you want the stars to appear.
|
139 |
|
140 |
-
[Demo page for Overall Rating and Vistor Rating](https://yetanotherstarsrating.com/yasr-
|
141 |
|
142 |
= What is "Multi Set"? =
|
143 |
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.
|
144 |
|
145 |
-
[Demo page for Multi Sets](https://yetanotherstarsrating.com/yasr-
|
146 |
|
147 |
= What is "Ranking reviews" ? =
|
148 |
It is the 10 highest rated item ranking by reviewer. In order to insert it into a post or page, just paste this shortcode **[yasr_ov_ranking]**
|
@@ -158,7 +156,7 @@ If in your site there are more than 1 person writing reviews, this chart will sh
|
|
158 |
= What is "Most active users" ? =
|
159 |
When a visitor (logged in or not) rates a post/page, his rating is stored in the database. This chart will show the 10 most active users, displaying the login name if logged in or "Anonymous" otherwise. The shortcode : **[yasr_most_active_users]**
|
160 |
|
161 |
-
[Demo page for Rankings](https://yetanotherstarsrating.com/yasr-rankings
|
162 |
|
163 |
= Wait, wait! Do I need to keep in mind all this shortcode? =
|
164 |
If you're using the new Gutenberg editor, you don't need at all: just use the blocks.
|
@@ -177,7 +175,7 @@ YASR has been tested with:
|
|
177 |
* Wp Rocket
|
178 |
|
179 |
= Why I don't see stars in google? =
|
180 |
-
[Read here](https://yetanotherstarsrating.com/
|
181 |
You can use the [Structured Data Testing Tool](https://search.google.com/structured-data/testing-tool/u/0/) to validate your pages.
|
182 |
Also [read this](https://webmasters.googleblog.com/2019/09/making-review-rich-results-more-helpful.html) google announcement.
|
183 |
If you set up everything fine, in 99% of cases your stars will appear in a week.
|
@@ -197,6 +195,9 @@ Yes, YASR is 100% fully compatible with PHP 8
|
|
197 |
|
198 |
The full changelog can be found in the plugin's directory. Recent entries:
|
199 |
|
|
|
|
|
|
|
200 |
= 2.9.8 =
|
201 |
* TWEAKED: updated rest api
|
202 |
* FIX: softwareApplication itemType didn't get saved
|
@@ -209,12 +210,19 @@ The full changelog can be found in the plugin's directory. Recent entries:
|
|
209 |
* TWEAKED: nonces are checked only for logged in users.
|
210 |
* TWEAKED: "Stats" page is now renamed in "Manage Ratings"
|
211 |
* TWEAKED: below the editor is now easier to manage Multi Sets
|
212 |
-
|
|
|
|
|
|
|
|
|
213 |
|
214 |
= 2.9.6 =
|
215 |
* FIXED: support for wp_template and wp_template_part CPT, used by FSE
|
216 |
* FIXED: html tags in custom texts didn't work
|
217 |
-
|
|
|
|
|
|
|
218 |
|
219 |
= 2.9.5 =
|
220 |
* NEW FEATURE: In the settings, is now possible to customize the text when a rating is saved / updated
|
4 |
Requires at least: 5.0
|
5 |
Contributors: Dudo
|
6 |
Tested up to: 5.9
|
7 |
+
Stable tag: 2.9.9
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
10 |
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
|
114 |
Further, it comes with a lot of hooks, you can find more info [here](https://yetanotherstarsrating.com/docs/developers/) .
|
115 |
|
116 |
== Related Link ==
|
117 |
+
* [All available shortcodes in free version](https://yetanotherstarsrating.com/yasr-shortcodes/)
|
118 |
* Documentation at [Yasr Official Site](https://yetanotherstarsrating.com/docs/)
|
|
|
|
|
|
|
119 |
|
120 |
Do you want more feature? [Check out Yasr Pro!](https://yetanotherstarsrating.com/#yasr-pro)
|
121 |
|
135 |
= What is "Visitor Rating"? =
|
136 |
It is the vote that allows your visitors to vote: just paste this shortcode **[yasr_visitor_votes]** where you want the stars to appear.
|
137 |
|
138 |
+
[Demo page for Overall Rating and Vistor Rating](https://yetanotherstarsrating.com/yasr-shortcodes/)
|
139 |
|
140 |
= What is "Multi Set"? =
|
141 |
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.
|
142 |
|
143 |
+
[Demo page for Multi Sets](https://yetanotherstarsrating.com/yasr-shortcodes/#yasr-multiset-shortcodes)
|
144 |
|
145 |
= What is "Ranking reviews" ? =
|
146 |
It is the 10 highest rated item ranking by reviewer. In order to insert it into a post or page, just paste this shortcode **[yasr_ov_ranking]**
|
156 |
= What is "Most active users" ? =
|
157 |
When a visitor (logged in or not) rates a post/page, his rating is stored in the database. This chart will show the 10 most active users, displaying the login name if logged in or "Anonymous" otherwise. The shortcode : **[yasr_most_active_users]**
|
158 |
|
159 |
+
[Demo page for Rankings](https://yetanotherstarsrating.com/yasr-shortcodes/#yasr-rankings-shortcodes)
|
160 |
|
161 |
= Wait, wait! Do I need to keep in mind all this shortcode? =
|
162 |
If you're using the new Gutenberg editor, you don't need at all: just use the blocks.
|
175 |
* Wp Rocket
|
176 |
|
177 |
= Why I don't see stars in google? =
|
178 |
+
[Read here](https://yetanotherstarsrating.com/yasr-rich-snippets/) and find out how to set up rich snippets.
|
179 |
You can use the [Structured Data Testing Tool](https://search.google.com/structured-data/testing-tool/u/0/) to validate your pages.
|
180 |
Also [read this](https://webmasters.googleblog.com/2019/09/making-review-rich-results-more-helpful.html) google announcement.
|
181 |
If you set up everything fine, in 99% of cases your stars will appear in a week.
|
195 |
|
196 |
The full changelog can be found in the plugin's directory. Recent entries:
|
197 |
|
198 |
+
= 2.9.9 =
|
199 |
+
* TWEAKED: removed "Pro only features" box in the editor screen
|
200 |
+
|
201 |
= 2.9.8 =
|
202 |
* TWEAKED: updated rest api
|
203 |
* FIX: softwareApplication itemType didn't get saved
|
210 |
* TWEAKED: nonces are checked only for logged in users.
|
211 |
* TWEAKED: "Stats" page is now renamed in "Manage Ratings"
|
212 |
* TWEAKED: below the editor is now easier to manage Multi Sets
|
213 |
+
[//]: # fs_premium_only_begin
|
214 |
+
PREMIUM ONLY:
|
215 |
+
* NEW FEATURE: is now possible to use Multi Set along with user reviews!
|
216 |
+
To enable it, just select "YES" to "Insert this Multi Set in the comment form?"
|
217 |
+
[//]: # fs_premium_only_end
|
218 |
|
219 |
= 2.9.6 =
|
220 |
* FIXED: support for wp_template and wp_template_part CPT, used by FSE
|
221 |
* FIXED: html tags in custom texts didn't work
|
222 |
+
[//]: # fs_premium_only_begin
|
223 |
+
PREMIUM ONLY:
|
224 |
+
* FIXED: comments feed didn't work if reviews in comment are enabled
|
225 |
+
[//]: # fs_premium_only_end
|
226 |
|
227 |
= 2.9.5 =
|
228 |
* NEW FEATURE: In the settings, is now possible to customize the text when a rating is saved / updated
|
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.9.
|
8 |
* Requires at least: 5.6
|
9 |
* Requires PHP: 5.4
|
10 |
* Author: Dario Curvino
|
@@ -78,7 +78,7 @@ if ( !function_exists( 'yasr_fs' ) ) {
|
|
78 |
yasr_fs();
|
79 |
// Signal that SDK was initiated.
|
80 |
do_action( 'yasr_fs_loaded' );
|
81 |
-
define( 'YASR_VERSION_NUM', '2.9.
|
82 |
//Plugin absolute path
|
83 |
//e.g. /var/www/html/plugin_development/wp-content/plugins/yet-another-stars-rating
|
84 |
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.9.9
|
8 |
* Requires at least: 5.6
|
9 |
* Requires PHP: 5.4
|
10 |
* Author: Dario Curvino
|
78 |
yasr_fs();
|
79 |
// Signal that SDK was initiated.
|
80 |
do_action( 'yasr_fs_loaded' );
|
81 |
+
define( 'YASR_VERSION_NUM', '2.9.9' );
|
82 |
//Plugin absolute path
|
83 |
//e.g. /var/www/html/plugin_development/wp-content/plugins/yet-another-stars-rating
|
84 |
define( 'YASR_ABSOLUTE_PATH', __DIR__ );
|