Version Description
- FIXED: support for wp_template and wp_template_part CPT, used by FSE
- FIXED: html tags in custom texts didn't work
Download this release
Release Info
Developer | Dudo |
Plugin | Yasr – Yet Another Stars Rating |
Version | 2.9.6 |
Comparing to | |
See all releases |
Code changes from version 2.9.5 to 2.9.6
- admin/editor/YasrEditorHooks.php +57 -29
- admin/js/guten/blocks/noStarsRankings.js +1 -1
- admin/js/guten/blocks/overallRating.js +1 -1
- admin/js/guten/blocks/rankings.js +1 -1
- admin/js/guten/blocks/visitorVotes.js +1 -1
- admin/js/guten/blocks/yasrGutenUtils.js +1 -1
- admin/js/guten/yasr-guten-misc.js +1 -1
- admin/js/src/guten/blocks/yasrGutenUtils.js +13 -0
- admin/js/src/guten/yasr-guten-panel.js +1 -1
- admin/settings/classes/YasrSettings.php +3 -5
- admin/yasr-admin-functions.php +4 -1
- changelog.txt +133 -0
- includes/shortcodes/classes/YasrOverallRating.php +3 -1
- includes/shortcodes/classes/YasrShortcode.php +64 -59
- includes/shortcodes/classes/YasrShortcodesAjax.php +3 -2
- includes/shortcodes/classes/YasrVisitorMultiSet.php +1 -1
- includes/shortcodes/classes/YasrVisitorVotes.php +3 -3
- readme.txt +6 -100
- yet-another-stars-rating.php +2 -2
admin/editor/YasrEditorHooks.php
CHANGED
@@ -34,31 +34,31 @@ class YasrEditorHooks {
|
|
34 |
public function init() {
|
35 |
|
36 |
//enqueue gutenberg stuff outside blocks
|
37 |
-
add_action('enqueue_block_editor_assets',
|
38 |
|
39 |
add_action('admin_init', array($this, 'initGutenBlocks'));
|
40 |
|
41 |
//This filter is used to add a new category in gutenberg
|
42 |
-
add_filter('block_categories_all',
|
43 |
|
44 |
//Add yasr constant in gutenberg
|
45 |
-
add_action('yasr_add_admin_scripts_end',
|
46 |
|
47 |
//Save auto insert value to yasrConstantGutenberg
|
48 |
-
add_filter('yasr_gutenberg_constants',
|
49 |
|
50 |
// Create 2 metaboxes in post and pages
|
51 |
-
add_action('add_meta_boxes',
|
52 |
|
53 |
// Add a media content button
|
54 |
-
add_action('media_buttons',
|
55 |
|
56 |
// Create the content for the button shortcode in Tinymce
|
57 |
//Add ajax action that will be called from the .js for button in tinymce
|
58 |
add_action('wp_ajax_yasr_create_shortcode', array($this, 'tinymceButtonContent'));
|
59 |
|
60 |
// Get Set name from post or page and output the set used in yasr-metabox-multiple-rating
|
61 |
-
add_action('wp_ajax_yasr_send_id_nameset',
|
62 |
|
63 |
$yasr_save_post = new YasrOnSavePost();
|
64 |
add_action('save_post', array($yasr_save_post, 'yasrSavePost'));
|
@@ -69,22 +69,24 @@ class YasrEditorHooks {
|
|
69 |
public function initGutenMisc() {
|
70 |
//I need to enqueue this only in post-new.php or post.php
|
71 |
$current_screen = get_current_screen();
|
72 |
-
if (
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
|
|
|
|
88 |
}
|
89 |
}
|
90 |
|
@@ -313,7 +315,8 @@ class YasrEditorHooks {
|
|
313 |
}
|
314 |
|
315 |
public function addJsConstantInGutenberg($hook) {
|
316 |
-
if (($hook === 'post.php' || $hook === 'post-new.php'
|
|
|
317 |
|
318 |
//create an empty array
|
319 |
$constants_array = array();
|
@@ -352,8 +355,9 @@ class YasrEditorHooks {
|
|
352 |
}
|
353 |
|
354 |
$auto_insert_array = array (
|
355 |
-
'adminurl'
|
356 |
-
'autoInsert'
|
|
|
357 |
);
|
358 |
|
359 |
return $constants_array + $auto_insert_array;
|
@@ -367,7 +371,7 @@ class YasrEditorHooks {
|
|
367 |
public function addMetaboxes() {
|
368 |
|
369 |
//Default post type where display metabox
|
370 |
-
$post_type_where_display_metabox = array('post', 'page');
|
371 |
|
372 |
//get the custom post type
|
373 |
$custom_post_types = YasrCustomPostTypes::getCustomPostTypes();
|
@@ -736,7 +740,7 @@ class YasrEditorHooks {
|
|
736 |
$html_to_return .= '<input type="button"
|
737 |
class="button-secondary yasr-tinymce-shortcode-buttons"
|
738 |
value="' . esc_attr__($size, 'yet-another-stars-rating') . '"
|
739 |
-
data-shortcode=\''
|
740 |
/> ';
|
741 |
}
|
742 |
}
|
@@ -745,7 +749,7 @@ class YasrEditorHooks {
|
|
745 |
$html_to_return .= '<input type="button"
|
746 |
class="button-primary yasr-tinymce-shortcode-buttons"
|
747 |
value="' . esc_attr__($value, 'yet-another-stars-rating') . '"
|
748 |
-
data-shortcode=\''
|
749 |
/> ';
|
750 |
}
|
751 |
|
@@ -775,4 +779,28 @@ class YasrEditorHooks {
|
|
775 |
|
776 |
die();
|
777 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
778 |
}//End Class
|
34 |
public function init() {
|
35 |
|
36 |
//enqueue gutenberg stuff outside blocks
|
37 |
+
add_action('enqueue_block_editor_assets', array($this, 'initGutenMisc'));
|
38 |
|
39 |
add_action('admin_init', array($this, 'initGutenBlocks'));
|
40 |
|
41 |
//This filter is used to add a new category in gutenberg
|
42 |
+
add_filter('block_categories_all', array($this, 'addGutenbergCategory'), 10, 2);
|
43 |
|
44 |
//Add yasr constant in gutenberg
|
45 |
+
add_action('yasr_add_admin_scripts_end', array($this, 'addJsConstantInGutenberg'));
|
46 |
|
47 |
//Save auto insert value to yasrConstantGutenberg
|
48 |
+
add_filter('yasr_gutenberg_constants', array($this, 'yasrGutenbergConstants'));
|
49 |
|
50 |
// Create 2 metaboxes in post and pages
|
51 |
+
add_action('add_meta_boxes', array($this, 'addMetaboxes'));
|
52 |
|
53 |
// Add a media content button
|
54 |
+
add_action('media_buttons', array($this, 'tinymceButton'), 99);
|
55 |
|
56 |
// Create the content for the button shortcode in Tinymce
|
57 |
//Add ajax action that will be called from the .js for button in tinymce
|
58 |
add_action('wp_ajax_yasr_create_shortcode', array($this, 'tinymceButtonContent'));
|
59 |
|
60 |
// Get Set name from post or page and output the set used in yasr-metabox-multiple-rating
|
61 |
+
add_action('wp_ajax_yasr_send_id_nameset', array($this, 'metaboxOutputMultisets'));
|
62 |
|
63 |
$yasr_save_post = new YasrOnSavePost();
|
64 |
add_action('save_post', array($yasr_save_post, 'yasrSavePost'));
|
69 |
public function initGutenMisc() {
|
70 |
//I need to enqueue this only in post-new.php or post.php
|
71 |
$current_screen = get_current_screen();
|
72 |
+
if ($current_screen !== null
|
73 |
+
&& (property_exists($current_screen, 'base') && $current_screen->base === 'post')
|
74 |
+
&& ($this->isFseElement($current_screen) === false)
|
75 |
+
) {
|
76 |
+
//Script
|
77 |
+
wp_enqueue_script(
|
78 |
+
'yasr-gutenberg',
|
79 |
+
YASR_JS_GUTEN . 'yasr-guten-misc.js',
|
80 |
+
array(
|
81 |
+
'wp-blocks',
|
82 |
+
'wp-components',
|
83 |
+
'wp-editor',
|
84 |
+
'wp-edit-post',
|
85 |
+
'wp-element',
|
86 |
+
'wp-i18n',
|
87 |
+
'wp-plugins',
|
88 |
+
)
|
89 |
+
);
|
90 |
}
|
91 |
}
|
92 |
|
315 |
}
|
316 |
|
317 |
public function addJsConstantInGutenberg($hook) {
|
318 |
+
if (($hook === 'post.php' || $hook === 'post-new.php' || $hook === 'appearance_page_gutenberg-edit-site')
|
319 |
+
&& yasr_is_gutenberg_page() ) {
|
320 |
|
321 |
//create an empty array
|
322 |
$constants_array = array();
|
355 |
}
|
356 |
|
357 |
$auto_insert_array = array (
|
358 |
+
'adminurl' => get_admin_url(),
|
359 |
+
'autoInsert' => $auto_insert,
|
360 |
+
'isFseElement' => json_encode($this->isFseElement())
|
361 |
);
|
362 |
|
363 |
return $constants_array + $auto_insert_array;
|
371 |
public function addMetaboxes() {
|
372 |
|
373 |
//Default post type where display metabox
|
374 |
+
$post_type_where_display_metabox = array('post', 'page', 'wp_template', 'wp_template_part');
|
375 |
|
376 |
//get the custom post type
|
377 |
$custom_post_types = YasrCustomPostTypes::getCustomPostTypes();
|
740 |
$html_to_return .= '<input type="button"
|
741 |
class="button-secondary yasr-tinymce-shortcode-buttons"
|
742 |
value="' . esc_attr__($size, 'yet-another-stars-rating') . '"
|
743 |
+
data-shortcode=\''.esc_attr($data_attribute).'\'
|
744 |
/> ';
|
745 |
}
|
746 |
}
|
749 |
$html_to_return .= '<input type="button"
|
750 |
class="button-primary yasr-tinymce-shortcode-buttons"
|
751 |
value="' . esc_attr__($value, 'yet-another-stars-rating') . '"
|
752 |
+
data-shortcode=\''.esc_attr($data_attribute).'\'
|
753 |
/> ';
|
754 |
}
|
755 |
|
779 |
|
780 |
die();
|
781 |
}
|
782 |
+
|
783 |
+
/**
|
784 |
+
* Return true if the post type of the current screen base is 'appearance_page_gutenberg-edit-site'
|
785 |
+
*
|
786 |
+
* @author Dario Curvino <@dudo>
|
787 |
+
* @since 2.9.6
|
788 |
+
*
|
789 |
+
* @param null $current_screen
|
790 |
+
*
|
791 |
+
* @return bool
|
792 |
+
*/
|
793 |
+
public function isFseElement($current_screen = null) {
|
794 |
+
if(!$current_screen) {
|
795 |
+
$current_screen = get_current_screen();
|
796 |
+
}
|
797 |
+
|
798 |
+
if (property_exists($current_screen, 'base')
|
799 |
+
&& $current_screen->base === 'appearance_page_gutenberg-edit-site'
|
800 |
+
) {
|
801 |
+
return true;
|
802 |
+
}
|
803 |
+
|
804 |
+
return false;
|
805 |
+
}
|
806 |
}//End Class
|
admin/js/guten/blocks/noStarsRankings.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(()=>{"use strict";var e,t,a,r,n,s,l,o={245:(e,t,a)=>{a.r(t),a.d(t,{YasrBlocksPanel:()=>b,YasrDivRatingOverall:()=>
|
1 |
+
(()=>{"use strict";var e,t,a,r,n,s,l,o={245:(e,t,a)=>{a.r(t),a.d(t,{YasrBlocksPanel:()=>b,YasrDivRatingOverall:()=>S,YasrNoSettingsPanel:()=>R,YasrPrintInputId:()=>h,YasrPrintSelectSize:()=>d,YasrProText:()=>E,yasrLabelSelectSize:()=>c,yasrLeaveThisBlankText:()=>y,yasrOptionalText:()=>o,yasrOverallDescription:()=>v,yasrSelectSizeChoose:()=>i,yasrSelectSizeLarge:()=>p,yasrSelectSizeMedium:()=>m,yasrSelectSizeSmall:()=>u,yasrVisitorVotesDescription:()=>g});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"),c=n("Choose Size","yet-another-stars-rating"),i=n("Choose stars size","yet-another-stars-rating"),u=n("Small","yet-another-stars-rating"),m=n("Medium","yet-another-stars-rating"),p=n("Large","yet-another-stars-rating"),y=n("Leave this blank if you don't know what you're doing.","yet-another-stars-rating"),v=n("Remember: only the post author can rate here.","yet-another-stars-rating"),g=n("This is the star set where your users will be able to vote","yet-another-stars-rating");function d(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 E(){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(E,null))}function b(e){var t;return"visitors"===e.block&&(t=g),"overall"===e.block&&(t=v),React.createElement(l,null,"overall"===e.block&&React.createElement(S,null),React.createElement(s,{title:"Settings"},React.createElement("h3",null,o),React.createElement("div",{className:"yasr-guten-block-panel"},React.createElement("label",null,c),React.createElement("div",null,React.createElement(d,{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"},y)),React.createElement("div",{className:"yasr-guten-block-panel"},t)))}function S(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)}}))}}},c={};function i(e){var t=c[e];if(void 0!==t)return t.exports;var a=c[e]={exports:{}};return o[e](a,a.exports,i),a.exports}i.d=(e,t)=>{for(var a in t)i.o(t,a)&&!i.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},e=i(245),t=wp.blocks.registerBlockType,a=wp.components.PanelBody,r=wp.element.Fragment,n=wp.blockEditor,s=n.useBlockProps,l=n.InspectorControls,t("yet-another-stars-rating/most-active-users",{edit:function(t){var n=s({className:"yasr-active-users-block"}),o=[React.createElement(e.YasrNoSettingsPanel,{key:0})];function c(e){return React.createElement(l,null,React.createElement(a,{title:"Settings"},React.createElement("div",{className:"yasr-guten-block-panel"},React.createElement("div",null,o))))}return wp.hooks.doAction("yasr_top_visitor_setting",o),React.createElement(r,null,React.createElement(c,null),React.createElement("div",n,"[yasr_most_active_users]"))},save:function(e){var t=s.save({className:"yasr-active-users-block"});return React.createElement("div",t,"[yasr_most_active_users]")}}),t("yet-another-stars-rating/most-active-reviewers",{edit:function(t){var n=s({className:"yasr-reviewers-block"}),o=[React.createElement(e.YasrNoSettingsPanel,{key:0})];function c(e){return React.createElement(l,null,React.createElement(a,{title:"Settings"},React.createElement("div",{className:"yasr-guten-block-panel"},React.createElement("div",null,o))))}return wp.hooks.doAction("yasr_top_reviewers_setting",o),React.createElement(r,null,React.createElement(c,null),React.createElement("div",n,"[yasr_top_reviewers]"))},save:function(e){var t=s.save({className:"yasr-reviewers-block"});return React.createElement("div",t,"[yasr_top_reviewers]")}})})();
|
admin/js/guten/blocks/overallRating.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(()=>{"use strict";var e,t,a,r,n={245:(e,t,a)=>{a.r(t),a.d(t,{YasrBlocksPanel:()=>R,YasrDivRatingOverall:()=>S,YasrNoSettingsPanel:()=>E,YasrPrintInputId:()=>h,YasrPrintSelectSize:()=>v,YasrProText:()=>b,yasrLabelSelectSize:()=>i,yasrLeaveThisBlankText:()=>d,yasrOptionalText:()=>o,yasrOverallDescription:()=>g,yasrSelectSizeChoose:()=>c,yasrSelectSizeLarge:()=>p,yasrSelectSizeMedium:()=>m,yasrSelectSizeSmall:()=>u,yasrVisitorVotesDescription:()=>y});var r=a(245),n=wp.i18n.__,l=wp.components.PanelBody,s=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"),p=n("Large","yet-another-stars-rating"),d=n("Leave this blank if you don't know what you're doing.","yet-another-stars-rating"),g=n("Remember: only the post author can rate here.","yet-another-stars-rating"),y=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 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 b(){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 E(e){return React.createElement("div",null,React.createElement(b,null))}function R(e){var t;return"visitors"===e.block&&(t=y),"overall"===e.block&&(t=g),React.createElement(s,null,"overall"===e.block&&React.createElement(S,null),React.createElement(l,{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(h,{postId:e.postId,setAttributes:e.setAttributes}),React.createElement("div",{className:"yasr-guten-block-explain"},d)),React.createElement("div",{className:"yasr-guten-block-panel"},t)))}function S(e){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],l=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=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:l,rateCallback:s})}(32,"overall-rater",!1,.1,!1,a,r)}}))}}},l={};function s(e){var t=l[e];if(void 0!==t)return t.exports;var a=l[e]={exports:{}};return n[e](a,a.exports,s),a.exports}s.d=(e,t)=>{for(var a in t)s.o(t,a)&&!s.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},e=s(245),wp.i18n.__,t=wp.blocks.registerBlockType,a=wp.element.Fragment,r=wp.blockEditor.useBlockProps,t("yet-another-stars-rating/overall-rating",{edit:function(t){var n=r({className:"yasr-overall-block"}),l=t.attributes,s=l.size,o=l.postId,i=t.setAttributes,c=t.isSelected,u=null,m=null;return"large"!==s&&(u=' size="'+s+'"'),!0===/^\d+$/.test(o)&&(m=' postid="'+o+'"'),React.createElement(a,null,c&&React.createElement(e.YasrBlocksPanel,{block:"overall",size:s,postId:o,setAttributes:i}),React.createElement("div",n,"[yasr_overall_rating",u,m,"]",c&&React.createElement(e.YasrPrintSelectSize,{size:s,setAttributes:i})))},save:function(e){var t=r.save({className:"yasr-overall-block"}),a=e.attributes,n=a.size,l=a.postId,s="";return n&&(s+='size="'+n+'"'),l&&(s+=' postid="'+l+'"'),React.createElement("div",t,"[yasr_overall_rating ",s,"]")}})})();
|
1 |
+
(()=>{"use strict";var e,t,a,r,n={245:(e,t,a)=>{a.r(t),a.d(t,{YasrBlocksPanel:()=>R,YasrDivRatingOverall:()=>S,YasrNoSettingsPanel:()=>E,YasrPrintInputId:()=>h,YasrPrintSelectSize:()=>v,YasrProText:()=>b,yasrLabelSelectSize:()=>i,yasrLeaveThisBlankText:()=>d,yasrOptionalText:()=>o,yasrOverallDescription:()=>g,yasrSelectSizeChoose:()=>c,yasrSelectSizeLarge:()=>p,yasrSelectSizeMedium:()=>m,yasrSelectSizeSmall:()=>u,yasrVisitorVotesDescription:()=>y});var r=a(245),n=wp.i18n.__,l=wp.components.PanelBody,s=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"),p=n("Large","yet-another-stars-rating"),d=n("Leave this blank if you don't know what you're doing.","yet-another-stars-rating"),g=n("Remember: only the post author can rate here.","yet-another-stars-rating"),y=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 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 b(){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 E(e){return React.createElement("div",null,React.createElement(b,null))}function R(e){var t;return"visitors"===e.block&&(t=y),"overall"===e.block&&(t=g),React.createElement(s,null,"overall"===e.block&&React.createElement(S,null),React.createElement(l,{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(h,{postId:e.postId,setAttributes:e.setAttributes}),React.createElement("div",{className:"yasr-guten-block-explain"},d)),React.createElement("div",{className:"yasr-guten-block-panel"},t)))}function S(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],l=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=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:l,rateCallback:s})}(32,"overall-rater",!1,.1,!1,a,r)}}))}}},l={};function s(e){var t=l[e];if(void 0!==t)return t.exports;var a=l[e]={exports:{}};return n[e](a,a.exports,s),a.exports}s.d=(e,t)=>{for(var a in t)s.o(t,a)&&!s.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},e=s(245),wp.i18n.__,t=wp.blocks.registerBlockType,a=wp.element.Fragment,r=wp.blockEditor.useBlockProps,t("yet-another-stars-rating/overall-rating",{edit:function(t){var n=r({className:"yasr-overall-block"}),l=t.attributes,s=l.size,o=l.postId,i=t.setAttributes,c=t.isSelected,u=null,m=null;return"large"!==s&&(u=' size="'+s+'"'),!0===/^\d+$/.test(o)&&(m=' postid="'+o+'"'),React.createElement(a,null,c&&React.createElement(e.YasrBlocksPanel,{block:"overall",size:s,postId:o,setAttributes:i}),React.createElement("div",n,"[yasr_overall_rating",u,m,"]",c&&React.createElement(e.YasrPrintSelectSize,{size:s,setAttributes:i})))},save:function(e){var t=r.save({className:"yasr-overall-block"}),a=e.attributes,n=a.size,l=a.postId,s="";return n&&(s+='size="'+n+'"'),l&&(s+=' postid="'+l+'"'),React.createElement("div",t,"[yasr_overall_rating ",s,"]")}})})();
|
admin/js/guten/blocks/rankings.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(()=>{"use strict";var e,t,a,r,n,l,s,o={245:(e,t,a)=>{a.r(t),a.d(t,{YasrBlocksPanel:()=>b,YasrDivRatingOverall:()=>k,YasrNoSettingsPanel:()=>R,YasrPrintInputId:()=>h,YasrPrintSelectSize:()=>d,YasrProText:()=>E,yasrLabelSelectSize:()=>c,yasrLeaveThisBlankText:()=>
|
1 |
+
(()=>{"use strict";var e,t,a,r,n,l,s,o={245:(e,t,a)=>{a.r(t),a.d(t,{YasrBlocksPanel:()=>b,YasrDivRatingOverall:()=>k,YasrNoSettingsPanel:()=>R,YasrPrintInputId:()=>h,YasrPrintSelectSize:()=>d,YasrProText:()=>E,yasrLabelSelectSize:()=>c,yasrLeaveThisBlankText:()=>p,yasrOptionalText:()=>o,yasrOverallDescription:()=>v,yasrSelectSizeChoose:()=>i,yasrSelectSizeLarge:()=>g,yasrSelectSizeMedium:()=>m,yasrSelectSizeSmall:()=>u,yasrVisitorVotesDescription:()=>y});var r=a(245),n=wp.i18n.__,l=wp.components.PanelBody,s=wp.blockEditor.InspectorControls,o=n("All these settings are optional","yet-another-stars-rating"),c=n("Choose Size","yet-another-stars-rating"),i=n("Choose stars size","yet-another-stars-rating"),u=n("Small","yet-another-stars-rating"),m=n("Medium","yet-another-stars-rating"),g=n("Large","yet-another-stars-rating"),p=n("Leave this blank if you don't know what you're doing.","yet-another-stars-rating"),v=n("Remember: only the post author can rate here.","yet-another-stars-rating"),y=n("This is the star set where your users will be able to vote","yet-another-stars-rating");function d(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 E(){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(E,null))}function b(e){var t;return"visitors"===e.block&&(t=y),"overall"===e.block&&(t=v),React.createElement(s,null,"overall"===e.block&&React.createElement(k,null),React.createElement(l,{title:"Settings"},React.createElement("h3",null,o),React.createElement("div",{className:"yasr-guten-block-panel"},React.createElement("label",null,c),React.createElement("div",null,React.createElement(d,{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"},p)),React.createElement("div",{className:"yasr-guten-block-panel"},t)))}function k(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],l=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=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:l,rateCallback:s})}(32,"overall-rater",!1,.1,!1,a,r)}}))}}},c={};function i(e){var t=c[e];if(void 0!==t)return t.exports;var a=c[e]={exports:{}};return o[e](a,a.exports,i),a.exports}i.d=(e,t)=>{for(var a in t)i.o(t,a)&&!i.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},e=i(245),t=wp.blocks.registerBlockType,a=wp.components.PanelBody,r=wp.element.Fragment,n=wp.blockEditor,l=n.useBlockProps,s=n.InspectorControls,t("yet-another-stars-rating/overall-rating-ranking",{edit:function(t){var n=l({className:"yasr-ov-ranking-block"}),o=[React.createElement(e.YasrNoSettingsPanel,{key:0})];function c(e){return React.createElement(s,null,React.createElement(a,{title:"Settings"},React.createElement("div",{className:"yasr-guten-block-panel"},React.createElement("div",null,o))))}return wp.hooks.doAction("yasr_overall_rating_rankings",o),React.createElement(r,null,React.createElement(c,null),React.createElement("div",n,"[yasr_ov_ranking]"))},save:function(e){var t=l.save({className:"yasr-ov-ranking-block"});return React.createElement("div",t,"[yasr_ov_ranking]")}}),t("yet-another-stars-rating/visitor-votes-ranking",{edit:function(t){var n=l({className:"yasr-vv-ranking-block"}),o=[React.createElement(e.YasrNoSettingsPanel,{key:0})];function c(e){return React.createElement(s,null,React.createElement(a,{title:"Settings"},React.createElement("div",{className:"yasr-guten-block-panel"},React.createElement("div",null,o))))}return wp.hooks.doAction("yasr_visitor_votes_rankings",o),React.createElement(r,null,React.createElement(c,null),React.createElement("div",n,"[yasr_most_or_highest_rated_posts]"))},save:function(e){var t=l.save({className:"yasr-vv-ranking-block"});return React.createElement("div",t,"[yasr_most_or_highest_rated_posts]")}})})();
|
admin/js/guten/blocks/visitorVotes.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(()=>{"use strict";var e,t,a,r,n={245:(e,t,a)=>{a.r(t),a.d(t,{YasrBlocksPanel:()=>R,YasrDivRatingOverall:()=>S,YasrNoSettingsPanel:()=>E,YasrPrintInputId:()=>h,YasrPrintSelectSize:()=>
|
1 |
+
(()=>{"use strict";var e,t,a,r,n={245:(e,t,a)=>{a.r(t),a.d(t,{YasrBlocksPanel:()=>R,YasrDivRatingOverall:()=>S,YasrNoSettingsPanel:()=>E,YasrPrintInputId:()=>h,YasrPrintSelectSize:()=>v,YasrProText:()=>b,yasrLabelSelectSize:()=>i,yasrLeaveThisBlankText:()=>d,yasrOptionalText:()=>o,yasrOverallDescription:()=>g,yasrSelectSizeChoose:()=>c,yasrSelectSizeLarge:()=>p,yasrSelectSizeMedium:()=>m,yasrSelectSizeSmall:()=>u,yasrVisitorVotesDescription:()=>y});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"),p=n("Large","yet-another-stars-rating"),d=n("Leave this blank if you don't know what you're doing.","yet-another-stars-rating"),g=n("Remember: only the post author can rate here.","yet-another-stars-rating"),y=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 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 b(){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 E(e){return React.createElement("div",null,React.createElement(b,null))}function R(e){var t;return"visitors"===e.block&&(t=y),"overall"===e.block&&(t=g),React.createElement(l,null,"overall"===e.block&&React.createElement(S,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(h,{postId:e.postId,setAttributes:e.setAttributes}),React.createElement("div",{className:"yasr-guten-block-explain"},d)),React.createElement("div",{className:"yasr-guten-block-panel"},t)))}function S(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)}}))}}},s={};function l(e){var t=s[e];if(void 0!==t)return t.exports;var a=s[e]={exports:{}};return n[e](a,a.exports,l),a.exports}l.d=(e,t)=>{for(var a in t)l.o(t,a)&&!l.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},e=l(245),wp.i18n.__,t=wp.blocks.registerBlockType,a=wp.element.Fragment,r=wp.blockEditor.useBlockProps,t("yet-another-stars-rating/visitor-votes",{edit:function(t){var n=r({className:"yasr-vv-block"}),s=t.attributes,l=s.size,o=s.postId,i=t.setAttributes,c=t.isSelected,u=null,m=null;return"large"!==l&&(u=' size="'+l+'"'),!0===/^\d+$/.test(o)&&(m=' postid="'+o+'"'),React.createElement(a,null,React.createElement(e.YasrBlocksPanel,{block:"visitors",size:l,setAttributes:i,postId:o}),React.createElement("div",n,"[yasr_visitor_votes",u,m,"]",c&&React.createElement(e.YasrPrintSelectSize,{size:l,setAttributes:i})))},save:function(e){var t=r.save({className:"yasr-vv-block"}),a=e.attributes,n=a.size,s=a.postId,l="";return n&&(l+='size="'+n+'"'),s&&(l+=' postid="'+s+'"'),React.createElement("div",t,"[yasr_visitor_votes ",l,"]")}})})();
|
admin/js/guten/blocks/yasrGutenUtils.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(()=>{"use strict";var e={245:(e,t,a)=>{a.r(t),a.d(t,{YasrBlocksPanel:()=>
|
1 |
+
(()=>{"use strict";var e={245:(e,t,a)=>{a.r(t),a.d(t,{YasrBlocksPanel:()=>R,YasrDivRatingOverall:()=>S,YasrNoSettingsPanel:()=>E,YasrPrintInputId:()=>v,YasrPrintSelectSize:()=>h,YasrProText:()=>b,yasrLabelSelectSize:()=>i,yasrLeaveThisBlankText:()=>g,yasrOptionalText:()=>o,yasrOverallDescription:()=>d,yasrSelectSizeChoose:()=>c,yasrSelectSizeLarge:()=>p,yasrSelectSizeMedium:()=>m,yasrSelectSizeSmall:()=>u,yasrVisitorVotesDescription:()=>y});var r=a(245),n=wp.i18n.__,l=wp.components.PanelBody,s=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"),p=n("Large","yet-another-stars-rating"),g=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"),y=n("This is the star set where your users will be able to vote","yet-another-stars-rating");function h(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 v(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 b(){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 E(e){return React.createElement("div",null,React.createElement(b,null))}function R(e){var t;return"visitors"===e.block&&(t=y),"overall"===e.block&&(t=d),React.createElement(s,null,"overall"===e.block&&React.createElement(S,null),React.createElement(l,{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(h,{size:e.size,setAttributes:e.setAttributes}))),React.createElement("div",{className:"yasr-guten-block-panel"},React.createElement("label",null,"Post ID"),React.createElement(v,{postId:e.postId,setAttributes:e.setAttributes}),React.createElement("div",{className:"yasr-guten-block-explain"},g)),React.createElement("div",{className:"yasr-guten-block-panel"},t)))}function S(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],l=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=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:l,rateCallback:s})}(32,"overall-rater",!1,.1,!1,a,r)}}))}}},t={};function a(r){var n=t[r];if(void 0!==n)return n.exports;var l=t[r]={exports:{}};return e[r](l,l.exports,a),l.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})},a(245)})();
|
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:()=>R,YasrDivRatingOverall:()=>E,YasrNoSettingsPanel:()=>b,YasrPrintInputId:()=>v,YasrPrintSelectSize:()=>g,YasrProText:()=>h,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 v(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 b(e){return React.createElement("div",null,React.createElement(h,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(v,{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){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"),v=o("Large","yet-another-stars-rating"),h=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,_=e.isSelected,k=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:k,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"},v)))}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 x(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"},h)),React.createElement("div",{className:"yasr-guten-block-panel"},b)))}return React.createElement(c,null,React.createElement(x,null),React.createElement("div",{className:e.className},"[yasr_overall_rating",S,P,"]",_&&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"},v)))}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:_}))}function _(e){if("Enter"===e.key){var t=e.target.value;!0!==/^\d+$/.test(t)&&""!==t||o({postId:t}),e.preventDefault()}}function k(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"},h)),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(k,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,v=wp.components.PanelBody,h=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(h,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(v,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: Page Settings","yet-another-stars-rating"),render:E})})()})();
|
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: Page Settings","yet-another-stars-rating"),render:E})})()})();
|
admin/js/src/guten/blocks/yasrGutenUtils.js
CHANGED
@@ -146,6 +146,19 @@ export function YasrBlocksPanel (props) {
|
|
146 |
}
|
147 |
|
148 |
export function YasrDivRatingOverall (props) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
const yasrOverallRateThis = __("Rate this article / item", 'yet-another-stars-rating');
|
150 |
let overallRating = wp.data.select('core/editor').getCurrentPost().meta.yasr_overall_rating;
|
151 |
|
146 |
}
|
147 |
|
148 |
export function YasrDivRatingOverall (props) {
|
149 |
+
|
150 |
+
if(JSON.parse(yasrConstantGutenberg.isFseElement) === true) {
|
151 |
+
return (
|
152 |
+
<div className="yasr-guten-block-panel yasr-guten-block-panel-center">
|
153 |
+
<div>
|
154 |
+
{__('This is a template file, you can\'t rate here. You need to insert the rating inside the single post or page',
|
155 |
+
'yet-another-stars-rating')}
|
156 |
+
</div>
|
157 |
+
<br />
|
158 |
+
</div>
|
159 |
+
);
|
160 |
+
}
|
161 |
+
|
162 |
const yasrOverallRateThis = __("Rate this article / item", 'yet-another-stars-rating');
|
163 |
let overallRating = wp.data.select('core/editor').getCurrentPost().meta.yasr_overall_rating;
|
164 |
|
admin/js/src/guten/yasr-guten-panel.js
CHANGED
@@ -18,7 +18,7 @@ class YasrSideBarAutoInsert extends React.Component {
|
|
18 |
constructor(props) {
|
19 |
super(props);
|
20 |
|
21 |
-
let isThisPostExluded
|
22 |
let isThisPostExludedCheckbox = false;
|
23 |
|
24 |
if (isThisPostExluded === 'yes') {
|
18 |
constructor(props) {
|
19 |
super(props);
|
20 |
|
21 |
+
let isThisPostExluded = wp.data.select('core/editor').getCurrentPost().meta.yasr_auto_insert_disabled;
|
22 |
let isThisPostExludedCheckbox = false;
|
23 |
|
24 |
if (isThisPostExluded === 'yes') {
|
admin/settings/classes/YasrSettings.php
CHANGED
@@ -824,7 +824,8 @@ class YasrSettings {
|
|
824 |
|
825 |
//except these ones
|
826 |
if ($key === 'text_before_overall' || $key === 'text_before_visitor_rating' ||
|
827 |
-
$key === 'text_after_visitor_rating' || $key === 'custom_text_must_sign_in'
|
|
|
828 |
$key === 'custom_text_user_voted') {
|
829 |
|
830 |
$allowed_tags = '<strong><p>';
|
@@ -844,9 +845,6 @@ class YasrSettings {
|
|
844 |
$output[$key] = strip_tags(stripslashes($option[$key]), $allowed_tags);
|
845 |
}
|
846 |
|
847 |
-
//Always use esc_html
|
848 |
-
$output[$key] = esc_html($output[$key]);
|
849 |
-
|
850 |
if ($key === 'publisher_logo') {
|
851 |
//if is not a valid url get_site_icon_url instead
|
852 |
if (filter_var($value, FILTER_VALIDATE_URL) === false) {
|
@@ -951,7 +949,7 @@ class YasrSettings {
|
|
951 |
);
|
952 |
}
|
953 |
|
954 |
-
echo $string_input;
|
955 |
|
956 |
if(isset($property['description']) && $property['description'] !== '') {
|
957 |
echo '<div class="yasr-element-row-container-description">';
|
824 |
|
825 |
//except these ones
|
826 |
if ($key === 'text_before_overall' || $key === 'text_before_visitor_rating' ||
|
827 |
+
$key === 'text_after_visitor_rating' || $key === 'custom_text_must_sign_in' ||
|
828 |
+
$key === 'custom_text_rating_saved' || $key === 'custom_text_rating_updated' ||
|
829 |
$key === 'custom_text_user_voted') {
|
830 |
|
831 |
$allowed_tags = '<strong><p>';
|
845 |
$output[$key] = strip_tags(stripslashes($option[$key]), $allowed_tags);
|
846 |
}
|
847 |
|
|
|
|
|
|
|
848 |
if ($key === 'publisher_logo') {
|
849 |
//if is not a valid url get_site_icon_url instead
|
850 |
if (filter_var($value, FILTER_VALIDATE_URL) === false) {
|
949 |
);
|
950 |
}
|
951 |
|
952 |
+
echo htmlspecialchars_decode($string_input);
|
953 |
|
954 |
if(isset($property['description']) && $property['description'] !== '') {
|
955 |
echo '<div class="yasr-element-row-container-description">';
|
admin/yasr-admin-functions.php
CHANGED
@@ -80,6 +80,7 @@ function yasr_add_admin_scripts($hook) {
|
|
80 |
|| $hook === 'post-new.php'
|
81 |
|| $hook === 'edit-comments.php'
|
82 |
|| $hook === 'term.php'
|
|
|
83 |
|| $hook === $yasr_settings_page
|
84 |
|| $hook === 'yet-another-stars-rating_page_yasr_stats_page'
|
85 |
|| $hook === 'yet-another-stars-rating_page_yasr_pricing_page'
|
@@ -236,7 +237,9 @@ function yasr_is_gutenberg_page() {
|
|
236 |
|
237 |
$current_screen = get_current_screen();
|
238 |
|
239 |
-
if (
|
|
|
|
|
240 |
// Gutenberg page on 5+.
|
241 |
return true;
|
242 |
}
|
80 |
|| $hook === 'post-new.php'
|
81 |
|| $hook === 'edit-comments.php'
|
82 |
|| $hook === 'term.php'
|
83 |
+
|| $hook === 'appearance_page_gutenberg-edit-site'
|
84 |
|| $hook === $yasr_settings_page
|
85 |
|| $hook === 'yet-another-stars-rating_page_yasr_stats_page'
|
86 |
|| $hook === 'yet-another-stars-rating_page_yasr_pricing_page'
|
237 |
|
238 |
$current_screen = get_current_screen();
|
239 |
|
240 |
+
if ($current_screen !== null
|
241 |
+
&& method_exists($current_screen, 'is_block_editor')
|
242 |
+
&& $current_screen->is_block_editor() ) {
|
243 |
// Gutenberg page on 5+.
|
244 |
return true;
|
245 |
}
|
changelog.txt
CHANGED
@@ -1,3 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
= 2.6.8 =
|
2 |
* FIX: in some circumstances, the text "you've already voted" displayed even in when this is not true
|
3 |
* TWEAKED: YASR is now saving a lot less data in _postmeta table
|
1 |
+
|
2 |
+
[//]: # fs_premium_only_begin
|
3 |
+
= 2.9.0.1 =
|
4 |
+
PREMIUM ONLY:
|
5 |
+
* FIXED: schema from reviews were not generated
|
6 |
+
* FIXED: stars in comment form didn't shows up in some circumstances
|
7 |
+
* FIXED: yasr_pro_ur_ranking row attribute didn't work
|
8 |
+
[//]: # fs_premium_only_end
|
9 |
+
|
10 |
+
= 2.9.0 =
|
11 |
+
* FIXED: ranking yasr_most_or_highest_rated_posts doesn't load in some circumstances
|
12 |
+
|
13 |
+
= 2.8.9 =
|
14 |
+
* FIXED: stars next to the title didn't work if shortcode doesn't exists in a post or page
|
15 |
+
* TWEAKED: minor changes
|
16 |
+
|
17 |
+
= 2.8.8 =
|
18 |
+
* TWEAKED: rich snippets are now included only if shortcode exists in post or page
|
19 |
+
* TWEAKED: global yasr_plugin_imported is now refactored into a constant
|
20 |
+
* FIXED: removed duplicated query
|
21 |
+
* FIXED: Import functions from external plugins is now compatible with mysql8
|
22 |
+
* FIXED: itemTypename didn't get saved into Rich snippet options above the editor
|
23 |
+
[//]: # fs_premium_only_begin
|
24 |
+
PREMIUM ONLY:
|
25 |
+
* FIXED: [yasr_pro_average_comments_ratings] didn't shows up
|
26 |
+
[//]: # fs_premium_only_end
|
27 |
+
|
28 |
+
= 2.8.7 =
|
29 |
+
* TWEAKED: added a check to improve compatibility with external plugins
|
30 |
+
* TWEAKED: removed old and useless languages files: only three were left to use as example
|
31 |
+
* FIXED: litespeed compatibility
|
32 |
+
|
33 |
+
= 2.8.6 =
|
34 |
+
* FIXED: Missing dependency for rankings shortcodes
|
35 |
+
|
36 |
+
= 2.8.5 =
|
37 |
+
* TWEAKED: YASR js assets are now loaded only if shortcode exists, and every shortcode has is ows js file. This will reduce
|
38 |
+
the unused js code, increasing lighthouse/pagespeed results.
|
39 |
+
* NEW FEATURE: new shortcode, ' yasr_user_rate_history ' : this will works only for logged in users, and will show
|
40 |
+
all the ratings that the user has give.
|
41 |
+
* FIX: js console error in widget page
|
42 |
+
|
43 |
+
= 2.8.4 =
|
44 |
+
* ENHANCEMENT: All gutenberg's blocks have been updated to apiVersion 2. This mean that YASR now requires at least
|
45 |
+
WordPress version 5.6
|
46 |
+
* FIX: some errors that occur using yasr_overall_rating and yasr_visitor_votes gutenberg blocks
|
47 |
+
* ENHANCEMENT: All gutenberg's blocks now support alignment
|
48 |
+
|
49 |
+
= 2.8.3 =
|
50 |
+
* FIXED: compatibility with WordPress 5.8
|
51 |
+
* FIXED: link to trial page
|
52 |
+
* TWEAKED: added some hooks
|
53 |
+
[//]: # fs_premium_only_begin
|
54 |
+
PREMIUM ONLY:
|
55 |
+
* FIXED: js error in admin side.
|
56 |
+
[//]: # fs_premium_only_end
|
57 |
+
|
58 |
+
= 2.8.2 =
|
59 |
+
* FIXED: if "Enable stars next to the title?" is activated, the ratings also appears in rss feed.
|
60 |
+
[//]: # fs_premium_only_begin
|
61 |
+
PREMIUM ONLY:
|
62 |
+
* FIXED: could not set size of stars in comment.
|
63 |
+
* TWEAKED: More granular control of number of fake ratings in gutenberg
|
64 |
+
[//]: # fs_premium_only_end
|
65 |
+
|
66 |
+
= 2.8.1 =
|
67 |
+
* FIXED: error that could occurs in some circumstances
|
68 |
+
|
69 |
+
= 2.8.0 =
|
70 |
+
* FIXED: if blogPosting itemType is selected, and a non valid url image is is supplied in the rich snippets settings,
|
71 |
+
a php warning is returned
|
72 |
+
* TWEAKED: The ajax method yasr_stats_visitors_votes now returns only json data, instead of HTML
|
73 |
+
* TWEAKED: Ajax error responses are now json_encoded
|
74 |
+
* TWEAKED: stats tooltip in yasr_visitor_votes works now with flexbox
|
75 |
+
* TWEAKED: minor changes
|
76 |
+
|
77 |
+
= 2.7.9 =
|
78 |
+
* FIXED: missing stats in some circumstances for yasr_visitor_votes shortcode
|
79 |
+
[//]: # fs_premium_only_begin
|
80 |
+
PREMIUM ONLY:
|
81 |
+
* NEW FEATURE: added start_date and end_date parameters for ranking's shortcodes
|
82 |
+
[//]: # fs_premium_only_end
|
83 |
+
|
84 |
+
= 2.7.8 =
|
85 |
+
* FIXED: error when "Load results with AJAX?" is enabled, and the attribute "readonly" is set to yasr_visitor_votes shortcode
|
86 |
+
* TWEAKED: css minor changes
|
87 |
+
|
88 |
+
= 2.7.7 =
|
89 |
+
* TWEAKED: When "Load results with AJAX?" is enabled, data is loaded through admin-ajax.php instead of REST API.
|
90 |
+
* TWEAKED: most of caching plugins are automatically detected: if one is found, "load results with ajax" is enabled by default.
|
91 |
+
* Minor changes
|
92 |
+
|
93 |
+
= 2.7.6 =
|
94 |
+
* TWEAKED: new pricing page
|
95 |
+
* Minor changes
|
96 |
+
|
97 |
+
= 2.7.5 =
|
98 |
+
* TWEAKED: in yasr_visitor_votes, chart icon now has same color of the text.
|
99 |
+
|
100 |
+
= 2.7.4 =
|
101 |
+
* TWEAKED: in front end, dashicons are not required anymore!
|
102 |
+
* TWEAKED: Vertical align of text and stars on yasr_visitor_votes shortcode.
|
103 |
+
The class yasr-total-average-container has be renamed yasr-vv-stats-text-container.
|
104 |
+
* TWEAKED: Custom texts support.
|
105 |
+
* TWEAKED: Updated support for Autoptimize, Litespeed, Cache Enabler and WpRocket.
|
106 |
+
* TWEAKED: Removed "itemListElement" from Recipe microdata.
|
107 |
+
* TWEAKED: added samesite attribute when cookie is set.
|
108 |
+
|
109 |
+
= 2.7.3 =
|
110 |
+
* NEW FEATURE: new shortcode: yasr_multi_set_ranking : this will show rankings from yasr_multiset
|
111 |
+
* TWEAKED: code cleanup.
|
112 |
+
|
113 |
+
= 2.7.2 =
|
114 |
+
* NEW FEATURE: new shortcode: yasr_visitor_multi_set_ranking : this will show rankings from yasr_visitor_multiset
|
115 |
+
* TWEAKED: minor fixes
|
116 |
+
[//]: # fs_premium_only_begin
|
117 |
+
PREMIUM ONLY:
|
118 |
+
* NEW FEATURE: new shortcode: yasr_pro_ur_ranking: this will show rankings with most reviews from comments
|
119 |
+
[//]: # fs_premium_only_end
|
120 |
+
|
121 |
+
= 2.7.1 =
|
122 |
+
* FIXED: minor bugs that could happen in rare circumstances
|
123 |
+
[//]: # fs_premium_only_begin
|
124 |
+
PREMIUM ONLY:
|
125 |
+
* TWEAKED: is now possible to add 1,2,5 and 10 fake ratings.
|
126 |
+
[//]: # fs_premium_only_end
|
127 |
+
|
128 |
+
= 2.7.0 =
|
129 |
+
* FIXED: fixed warning that can return on fresh installations
|
130 |
+
|
131 |
+
= 2.6.9 =
|
132 |
+
* FIXED: error YasrMultiSetData.php on line 61 if multiSet are not used
|
133 |
+
|
134 |
= 2.6.8 =
|
135 |
* FIX: in some circumstances, the text "you've already voted" displayed even in when this is not true
|
136 |
* TWEAKED: YASR is now saving a lot less data in _postmeta table
|
includes/shortcodes/classes/YasrOverallRating.php
CHANGED
@@ -126,7 +126,9 @@ class YasrOverallRating extends YasrShortcode {
|
|
126 |
$text_before_star = apply_filters('yasr_cstm_text_before_overall', $this->overall_rating);
|
127 |
|
128 |
return "<div class='yasr-container-custom-text-and-overall'>
|
129 |
-
<span id='yasr-custom-text-before-overall'>".
|
|
|
|
|
130 |
</div>";
|
131 |
|
132 |
}
|
126 |
$text_before_star = apply_filters('yasr_cstm_text_before_overall', $this->overall_rating);
|
127 |
|
128 |
return "<div class='yasr-container-custom-text-and-overall'>
|
129 |
+
<span id='yasr-custom-text-before-overall'>".
|
130 |
+
wp_kses_post(htmlspecialchars_decode($text_before_star)).
|
131 |
+
"</span>
|
132 |
</div>";
|
133 |
|
134 |
}
|
includes/shortcodes/classes/YasrShortcode.php
CHANGED
@@ -46,6 +46,11 @@ abstract class YasrShortcode
|
|
46 |
//Enqueue Scripts
|
47 |
self::enqueueScripts();
|
48 |
$this->shortcode_name = $shortcode_name;
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
if ( $atts !== false ) {
|
51 |
$atts = shortcode_atts( array(
|
@@ -70,65 +75,6 @@ abstract class YasrShortcode
|
|
70 |
|
71 |
}
|
72 |
|
73 |
-
/**
|
74 |
-
* Enqueue js scripts
|
75 |
-
* Js files for vv shortcodes are loaded with method in his own class
|
76 |
-
*
|
77 |
-
* @author Dario Curvino <@dudo>
|
78 |
-
* @since 2.8.5
|
79 |
-
*/
|
80 |
-
public static function enqueueScripts()
|
81 |
-
{
|
82 |
-
//scripts required for all shortocdes
|
83 |
-
yasr_enqueue_includes_js_scripts();
|
84 |
-
do_action( 'yasr_enqueue_assets_shortcode' );
|
85 |
-
}
|
86 |
-
|
87 |
-
/***
|
88 |
-
* This function is called by all the shortcodes that works in read only and in multiset
|
89 |
-
*
|
90 |
-
* @author Dario Curvino <@dudo>
|
91 |
-
* @since 2.8.8
|
92 |
-
*/
|
93 |
-
public static function enqueueReadonlyAndMultisetScript()
|
94 |
-
{
|
95 |
-
wp_enqueue_script(
|
96 |
-
'yasr-ov-multi',
|
97 |
-
YASR_JS_DIR_INCLUDES . 'shortcodes/overall-multiset.js',
|
98 |
-
array(
|
99 |
-
'jquery',
|
100 |
-
'rater',
|
101 |
-
'wp-i18n',
|
102 |
-
'yasr-global-data'
|
103 |
-
),
|
104 |
-
YASR_VERSION_NUM,
|
105 |
-
true
|
106 |
-
);
|
107 |
-
}
|
108 |
-
|
109 |
-
/**
|
110 |
-
* Enqueue scripts for rankings
|
111 |
-
*
|
112 |
-
* @author Dario Curvino <@dudo>
|
113 |
-
* @since 2.8.8
|
114 |
-
*/
|
115 |
-
public static function enqueueRankingScript()
|
116 |
-
{
|
117 |
-
wp_enqueue_script(
|
118 |
-
'yasr-rankings',
|
119 |
-
YASR_JS_DIR_INCLUDES . 'shortcodes/rankings.js',
|
120 |
-
array(
|
121 |
-
'jquery',
|
122 |
-
'rater',
|
123 |
-
'wp-i18n',
|
124 |
-
'wp-element',
|
125 |
-
'yasr-global-data'
|
126 |
-
),
|
127 |
-
YASR_VERSION_NUM,
|
128 |
-
true
|
129 |
-
);
|
130 |
-
}
|
131 |
-
|
132 |
/**
|
133 |
* Return the stars size according to size attribute in shortcode.
|
134 |
* If not used, return 32 (default value)
|
@@ -195,5 +141,64 @@ abstract class YasrShortcode
|
|
195 |
//this should never happen
|
196 |
return false;
|
197 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
|
199 |
}
|
46 |
//Enqueue Scripts
|
47 |
self::enqueueScripts();
|
48 |
$this->shortcode_name = $shortcode_name;
|
49 |
+
$this->initProperties( $atts, $shortcode_name );
|
50 |
+
}
|
51 |
+
|
52 |
+
protected function initProperties( $atts, $shortcode_name )
|
53 |
+
{
|
54 |
|
55 |
if ( $atts !== false ) {
|
56 |
$atts = shortcode_atts( array(
|
75 |
|
76 |
}
|
77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
/**
|
79 |
* Return the stars size according to size attribute in shortcode.
|
80 |
* If not used, return 32 (default value)
|
141 |
//this should never happen
|
142 |
return false;
|
143 |
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Enqueue js scripts
|
147 |
+
* Js files for vv shortcodes are loaded with method in his own class
|
148 |
+
*
|
149 |
+
* @author Dario Curvino <@dudo>
|
150 |
+
* @since 2.8.5
|
151 |
+
*/
|
152 |
+
public static function enqueueScripts()
|
153 |
+
{
|
154 |
+
//scripts required for all shortocdes
|
155 |
+
yasr_enqueue_includes_js_scripts();
|
156 |
+
do_action( 'yasr_enqueue_assets_shortcode' );
|
157 |
+
}
|
158 |
+
|
159 |
+
/***
|
160 |
+
* This function is called by all the shortcodes that works in read only and in multiset
|
161 |
+
*
|
162 |
+
* @author Dario Curvino <@dudo>
|
163 |
+
* @since 2.8.8
|
164 |
+
*/
|
165 |
+
public static function enqueueReadonlyAndMultisetScript()
|
166 |
+
{
|
167 |
+
wp_enqueue_script(
|
168 |
+
'yasr-ov-multi',
|
169 |
+
YASR_JS_DIR_INCLUDES . 'shortcodes/overall-multiset.js',
|
170 |
+
array(
|
171 |
+
'jquery',
|
172 |
+
'rater',
|
173 |
+
'wp-i18n',
|
174 |
+
'yasr-global-data'
|
175 |
+
),
|
176 |
+
YASR_VERSION_NUM,
|
177 |
+
true
|
178 |
+
);
|
179 |
+
}
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Enqueue scripts for rankings
|
183 |
+
*
|
184 |
+
* @author Dario Curvino <@dudo>
|
185 |
+
* @since 2.8.8
|
186 |
+
*/
|
187 |
+
public static function enqueueRankingScript()
|
188 |
+
{
|
189 |
+
wp_enqueue_script(
|
190 |
+
'yasr-rankings',
|
191 |
+
YASR_JS_DIR_INCLUDES . 'shortcodes/rankings.js',
|
192 |
+
array(
|
193 |
+
'jquery',
|
194 |
+
'rater',
|
195 |
+
'wp-i18n',
|
196 |
+
'wp-element',
|
197 |
+
'yasr-global-data'
|
198 |
+
),
|
199 |
+
YASR_VERSION_NUM,
|
200 |
+
true
|
201 |
+
);
|
202 |
+
}
|
203 |
|
204 |
}
|
includes/shortcodes/classes/YasrShortcodesAjax.php
CHANGED
@@ -209,8 +209,9 @@ class YasrShortcodesAjax {
|
|
209 |
$rating_saved_text = apply_filters('yasr_vv_saved_text', $rating_saved_text);
|
210 |
}
|
211 |
|
212 |
-
$rating_saved_span = '<span class="yasr-small-block-bold" id="yasr-vote-saved">'
|
213 |
-
.
|
|
|
214 |
|
215 |
return array(
|
216 |
'status' => 'success',
|
209 |
$rating_saved_text = apply_filters('yasr_vv_saved_text', $rating_saved_text);
|
210 |
}
|
211 |
|
212 |
+
$rating_saved_span = '<span class="yasr-small-block-bold" id="yasr-vote-saved">'
|
213 |
+
. wp_kses_post(htmlspecialchars_decode($rating_saved_text)) .
|
214 |
+
'</span>';
|
215 |
|
216 |
return array(
|
217 |
'status' => 'success',
|
includes/shortcodes/classes/YasrVisitorMultiSet.php
CHANGED
@@ -163,7 +163,7 @@ class YasrVisitorMultiSet extends YasrMultiSet {
|
|
163 |
$this->button = $this->button_html_disabled;
|
164 |
$this->star_readonly = 'true';
|
165 |
$this->span_message_content = '<span class="yasr-visitor-votes-must-sign-in">';
|
166 |
-
$this->span_message_content .=
|
167 |
$this->span_message_content .= '</span>';
|
168 |
}
|
169 |
}
|
163 |
$this->button = $this->button_html_disabled;
|
164 |
$this->star_readonly = 'true';
|
165 |
$this->span_message_content = '<span class="yasr-visitor-votes-must-sign-in">';
|
166 |
+
$this->span_message_content .= wp_kses_post(htmlspecialchars_decode(apply_filters('yasr_must_sign_in', '')));
|
167 |
$this->span_message_content .= '</span>';
|
168 |
}
|
169 |
}
|
includes/shortcodes/classes/YasrVisitorVotes.php
CHANGED
@@ -253,7 +253,7 @@ class YasrVisitorVotes extends YasrShortcode {
|
|
253 |
//If only logged in users can vote
|
254 |
elseif ($stars_enabled === 'false_not_logged') {
|
255 |
$span_bottom_line_content = "<span class='yasr-visitor-votes-must-sign-in'>";
|
256 |
-
$span_bottom_line_content .=
|
257 |
//if custom text is defined
|
258 |
$span_bottom_line_content .= '</span>';
|
259 |
}
|
@@ -283,7 +283,7 @@ class YasrVisitorVotes extends YasrShortcode {
|
|
283 |
$class_text_before = 'yasr-custom-text-vv-before yasr-custom-text-vv-before-'.$this->post_id;
|
284 |
|
285 |
return '<div class="'.$class_text_before.'">'
|
286 |
-
. wp_kses_post($custom_text_before_star) .
|
287 |
'</div>';
|
288 |
}
|
289 |
|
@@ -323,7 +323,7 @@ class YasrVisitorVotes extends YasrShortcode {
|
|
323 |
*/
|
324 |
protected function textAfterStars($number_of_votes, $average_rating) {
|
325 |
$custom_text = apply_filters('yasr_cstm_text_after_vv', $number_of_votes, $average_rating, $this->unique_id);
|
326 |
-
return wp_kses_post($custom_text);
|
327 |
}
|
328 |
|
329 |
|
253 |
//If only logged in users can vote
|
254 |
elseif ($stars_enabled === 'false_not_logged') {
|
255 |
$span_bottom_line_content = "<span class='yasr-visitor-votes-must-sign-in'>";
|
256 |
+
$span_bottom_line_content .= wp_kses_post(htmlspecialchars_decode(apply_filters('yasr_must_sign_in', '')));
|
257 |
//if custom text is defined
|
258 |
$span_bottom_line_content .= '</span>';
|
259 |
}
|
283 |
$class_text_before = 'yasr-custom-text-vv-before yasr-custom-text-vv-before-'.$this->post_id;
|
284 |
|
285 |
return '<div class="'.$class_text_before.'">'
|
286 |
+
. wp_kses_post(htmlspecialchars_decode($custom_text_before_star)) .
|
287 |
'</div>';
|
288 |
}
|
289 |
|
323 |
*/
|
324 |
protected function textAfterStars($number_of_votes, $average_rating) {
|
325 |
$custom_text = apply_filters('yasr_cstm_text_after_vv', $number_of_votes, $average_rating, $this->unique_id);
|
326 |
+
return wp_kses_post(htmlspecialchars_decode($custom_text));
|
327 |
}
|
328 |
|
329 |
|
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
|
@@ -197,6 +197,11 @@ 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.5 =
|
201 |
* NEW FEATURE: In the settings, is now possible to customize the text when a rating is saved / updated
|
202 |
* minor fixes
|
@@ -215,104 +220,5 @@ The full changelog can be found in the plugin's directory. Recent entries:
|
|
215 |
= 2.9.1 =
|
216 |
* FIXED: if shortcode exists for a post or page, but there are no ratings, wrong rich snippets are returned
|
217 |
|
218 |
-
= 2.9.0 =
|
219 |
-
* FIXED: ranking yasr_most_or_highest_rated_posts doesn't load in some circumstances
|
220 |
-
|
221 |
-
= 2.8.9 =
|
222 |
-
* FIXED: stars next to the title didn't work if shortcode doesn't exists in a post or page
|
223 |
-
* TWEAKED: minor changes
|
224 |
-
|
225 |
-
= 2.8.8 =
|
226 |
-
* TWEAKED: rich snippets are now included only if shortcode exists in post or page
|
227 |
-
* TWEAKED: global yasr_plugin_imported is now refactored into a constant
|
228 |
-
* FIXED: removed duplicated query
|
229 |
-
* FIXED: Import functions from external plugins is now compatible with mysql8
|
230 |
-
* FIXED: itemTypename didn't get saved into Rich snippet options above the editor
|
231 |
-
|
232 |
-
= 2.8.7 =
|
233 |
-
* TWEAKED: added a check to improve compatibility with external plugins
|
234 |
-
* TWEAKED: removed old and useless languages files: only three were left to use as example
|
235 |
-
* FIXED: litespeed compatibility
|
236 |
-
|
237 |
-
= 2.8.6 =
|
238 |
-
* FIXED: Missing dependency for rankings shortcodes
|
239 |
-
|
240 |
-
= 2.8.5 =
|
241 |
-
* TWEAKED: YASR js assets are now loaded only if shortcode exists, and every shortcode has is ows js file. This will reduce
|
242 |
-
the unused js code, increasing lighthouse/pagespeed results.
|
243 |
-
* NEW FEATURE: new shortcode, ' yasr_user_rate_history ' : this will works only for logged in users, and will show
|
244 |
-
all the ratings that the user has give.
|
245 |
-
* FIX: js console error in widget page
|
246 |
-
|
247 |
-
= 2.8.4 =
|
248 |
-
* ENHANCEMENT: All gutenberg's blocks have been updated to apiVersion 2. This mean that YASR now requires at least
|
249 |
-
WordPress version 5.6
|
250 |
-
* FIX: some errors that occur using yasr_overall_rating and yasr_visitor_votes gutenberg blocks
|
251 |
-
* ENHANCEMENT: All gutenberg's blocks now support alignment
|
252 |
-
|
253 |
-
= 2.8.3 =
|
254 |
-
* FIXED: compatibility with WordPress 5.8
|
255 |
-
* FIXED: link to trial page
|
256 |
-
* TWEAKED: added some hooks
|
257 |
-
|
258 |
-
= 2.8.2 =
|
259 |
-
* FIXED: if "Enable stars next to the title?" is activated, the ratings also appears in rss feed.
|
260 |
-
|
261 |
-
= 2.8.1 =
|
262 |
-
* FIXED: error that could occurs in some circumstances
|
263 |
-
|
264 |
-
= 2.8.0 =
|
265 |
-
* FIXED: if blogPosting itemType is selected, and a non valid url image is is supplied in the rich snippets settings,
|
266 |
-
a php warning is returned
|
267 |
-
* TWEAKED: The ajax method yasr_stats_visitors_votes now returns only json data, instead of HTML
|
268 |
-
* TWEAKED: Ajax error responses are now json_encoded
|
269 |
-
* TWEAKED: stats tooltip in yasr_visitor_votes works now with flexbox
|
270 |
-
* TWEAKED: minor changes
|
271 |
-
|
272 |
-
= 2.7.9 =
|
273 |
-
* FIXED: missing stats in some circumstances for yasr_visitor_votes shortcode
|
274 |
-
|
275 |
-
= 2.7.8 =
|
276 |
-
* FIXED: error when "Load results with AJAX?" is enabled, and the attribute "readonly" is set to yasr_visitor_votes shortcode
|
277 |
-
* TWEAKED: css minor changes
|
278 |
-
|
279 |
-
= 2.7.7 =
|
280 |
-
* TWEAKED: When "Load results with AJAX?" is enabled, data is loaded through admin-ajax.php instead of REST API.
|
281 |
-
* TWEAKED: most of caching plugins are automatically detected: if one is found, "load results with ajax" is enabled by default.
|
282 |
-
* Minor changes
|
283 |
-
|
284 |
-
= 2.7.6 =
|
285 |
-
* TWEAKED: new pricing page
|
286 |
-
* Minor changes
|
287 |
-
|
288 |
-
= 2.7.5 =
|
289 |
-
* TWEAKED: in yasr_visitor_votes, chart icon now has same color of the text.
|
290 |
-
|
291 |
-
= 2.7.4 =
|
292 |
-
* TWEAKED: in front end, dashicons are not required anymore!
|
293 |
-
* TWEAKED: Vertical align of text and stars on yasr_visitor_votes shortcode.
|
294 |
-
The class yasr-total-average-container has be renamed yasr-vv-stats-text-container.
|
295 |
-
* TWEAKED: Custom texts support.
|
296 |
-
* TWEAKED: Updated support for Autoptimize, Litespeed, Cache Enabler and WpRocket.
|
297 |
-
* TWEAKED: Removed "itemListElement" from Recipe microdata.
|
298 |
-
* TWEAKED: added samesite attribute when cookie is set.
|
299 |
-
|
300 |
-
= 2.7.3 =
|
301 |
-
* NEW FEATURE: new shortcode: yasr_multi_set_ranking : this will show rankings from yasr_multiset
|
302 |
-
* TWEAKED: code cleanup.
|
303 |
-
|
304 |
-
= 2.7.2 =
|
305 |
-
* NEW FEATURE: new shortcode: yasr_visitor_multi_set_ranking : this will show rankings from yasr_visitor_multiset
|
306 |
-
* TWEAKED: minor fixes
|
307 |
-
|
308 |
-
= 2.7.1 =
|
309 |
-
* FIXED: minor bugs that could happen in rare circumstances
|
310 |
-
|
311 |
-
= 2.7.0 =
|
312 |
-
* FIXED: fixed warning that can return on fresh installations
|
313 |
-
|
314 |
-
= 2.6.9 =
|
315 |
-
* FIXED: error YasrMultiSetData.php on line 61 if multiSet are not used
|
316 |
-
|
317 |
= Additional Info =
|
318 |
See credits.txt file
|
4 |
Requires at least: 5.0
|
5 |
Contributors: Dudo
|
6 |
Tested up to: 5.9
|
7 |
+
Stable tag: 2.9.6
|
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
|
197 |
|
198 |
The full changelog can be found in the plugin's directory. Recent entries:
|
199 |
|
200 |
+
= 2.9.6 =
|
201 |
+
* FIXED: support for wp_template and wp_template_part CPT, used by FSE
|
202 |
+
* FIXED: html tags in custom texts didn't work
|
203 |
+
|
204 |
+
|
205 |
= 2.9.5 =
|
206 |
* NEW FEATURE: In the settings, is now possible to customize the text when a rating is saved / updated
|
207 |
* minor fixes
|
220 |
= 2.9.1 =
|
221 |
* FIXED: if shortcode exists for a post or page, but there are no ratings, wrong rich snippets are returned
|
222 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
= Additional Info =
|
224 |
See credits.txt file
|
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.6
|
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.6' );
|
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__ );
|