diff --git a/includes/class-wppr.php b/includes/class-wppr.php index c2cf7cb..2f4ec9c 100644 --- a/includes/class-wppr.php +++ b/includes/class-wppr.php @@ -67,7 +67,7 @@ class WPPR { */ public function __construct() { $this->plugin_name = 'wppr'; - $this->version = '3.7.10'; + $this->version = '3.7.11'; $this->load_dependencies(); $this->set_locale(); diff --git a/includes/gutenberg/class-wppr-gutenberg.php b/includes/gutenberg/class-wppr-gutenberg.php index bc5fb9a..ec47f55 100644 --- a/includes/gutenberg/class-wppr-gutenberg.php +++ b/includes/gutenberg/class-wppr-gutenberg.php @@ -133,6 +133,9 @@ public function update_posts_endpoints() { 'sanitize_callback' => 'sanitize_text_field', ), ), + 'permission_callback' => function () { + return current_user_can( 'edit_posts' ); + }, ) ); diff --git a/includes/public/class-wppr-public.php b/includes/public/class-wppr-public.php index e4679ed..2ddad8d 100644 --- a/includes/public/class-wppr-public.php +++ b/includes/public/class-wppr-public.php @@ -169,6 +169,19 @@ function load_template_css( $review = null ) { wp_add_inline_style( $this->plugin_name . '-common', $style ); } + /** + * Is this an AMP page? + */ + private function is_amp_page() { + if ( ! function_exists( 'ampforwp_is_amp_endpoint' ) || ! function_exists( 'is_amp_endpoint' ) ) { + return false; + } + if ( ! ampforwp_is_amp_endpoint() || ! is_amp_endpoint() ) { + return false; + } + return true; + } + /** * Load AMP logic. */ @@ -176,10 +189,8 @@ public function amp_support() { if ( ! $this->review->is_active() ) { return; } - if ( ! function_exists( 'ampforwp_is_amp_endpoint' ) || ! function_exists( 'is_amp_endpoint' ) ) { - return; - } - if ( ! ampforwp_is_amp_endpoint() || ! is_amp_endpoint() ) { + + if ( ! $this->is_amp_page() ) { return; } @@ -485,7 +496,7 @@ public function display_on_front( $content ) { return $content; } - if ( $this->review->is_active() && is_singular() && in_the_loop() ) { + if ( $this->review->is_active() && is_singular() && ( $this->is_amp_page() || in_the_loop() ) ) { $output = ''; $review_object = $this->review; $template = new WPPR_Template(); diff --git a/package.json b/package.json index 5ac8be0..9119727 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wp-product-review", - "version": "3.7.10", + "version": "3.7.11", "description": "WP Product Review WordPress plugin.", "repository": { "type": "git", diff --git a/readme.md b/readme.md index 9c4c4f6..c02af1d 100644 --- a/readme.md +++ b/readme.md @@ -3,7 +3,7 @@ **Tags:** review, rating, posts, widget, review blogger, review blogging, affiliate, product reviews,plugin, google rating, product review, rating, review, star rating, user rating, wp rating, wp review, google, hreview,rich snippets,seo,snippet **Author URI:** http://themeisle.com **Requires at least:** 3.5 -**Tested up to:** 5.4 +**Tested up to:** 5.5 **Stable tag:** trunk **License:** GPLv2 or later **License URI:** http://www.gnu.org/licenses/gpl-2.0.html @@ -37,29 +37,30 @@ If you wanna learn more about the