From 7b6ef48cd823b687288df27d02deeb5846d77c90 Mon Sep 17 00:00:00 2001 From: Ashish Ravi Date: Tue, 4 Aug 2020 10:09:25 +0530 Subject: [PATCH 1/5] Product review disappears in AMPforWP plugin --- includes/public/class-wppr-public.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/includes/public/class-wppr-public.php b/includes/public/class-wppr-public.php index e4679ed..1b14bc9 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 ( ! 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(); From c42be3308fd00fcfbecadc19b8eee770a2260cfa Mon Sep 17 00:00:00 2001 From: Ashish Ravi Date: Tue, 4 Aug 2020 10:16:45 +0530 Subject: [PATCH 2/5] Product review disappears in AMPforWP plugin --- includes/public/class-wppr-public.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/public/class-wppr-public.php b/includes/public/class-wppr-public.php index 1b14bc9..2ddad8d 100644 --- a/includes/public/class-wppr-public.php +++ b/includes/public/class-wppr-public.php @@ -190,7 +190,7 @@ public function amp_support() { return; } - if ( ! is_amp_page() ) { + if ( ! $this->is_amp_page() ) { return; } From 6475a746a58082e64e17ac780243638ea2129361 Mon Sep 17 00:00:00 2001 From: Ashish Ravi Date: Fri, 14 Aug 2020 14:03:16 +0530 Subject: [PATCH 3/5] add permission_callback --- includes/gutenberg/class-wppr-gutenberg.php | 3 +++ 1 file changed, 3 insertions(+) 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' ); + }, ) ); From 417745bb1d26b02c74d42344cf566f25cf3e5f08 Mon Sep 17 00:00:00 2001 From: Rodica-Elena Irodiu Date: Fri, 21 Aug 2020 13:56:57 +0300 Subject: [PATCH 4/5] chore: version bump --- includes/class-wppr.php | 2 +- package.json | 2 +- wp-product-review.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) 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/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/wp-product-review.php b/wp-product-review.php index 7b73ada..5f47ae5 100644 --- a/wp-product-review.php +++ b/wp-product-review.php @@ -15,7 +15,7 @@ * Plugin Name: WP Product Review Lite * Plugin URI: https://themeisle.com/plugins/wp-product-review/ * Description: The highest rated and most complete review plugin, now with rich snippets support. Easily turn your basic posts into in-depth reviews. - * Version: 3.7.10 + * Version: 3.7.11 * Author: ThemeIsle * Author URI: https://themeisle.com/ * Requires at least: 3.5 @@ -66,7 +66,7 @@ function deactivate_wppr() { */ function run_wppr() { - define( 'WPPR_LITE_VERSION', '3.7.10' ); + define( 'WPPR_LITE_VERSION', '3.7.11' ); define( 'WPPR_PATH', dirname( __FILE__ ) ); define( 'WPPR_SLUG', 'wppr' ); define( 'WPPR_UPSELL_LINK', 'https://themeisle.com/plugins/wp-product-review/' ); From 590cdbf1df1c506e2a0aacc6febf1c0d99f959b3 Mon Sep 17 00:00:00 2001 From: Rodica-Elena Irodiu Date: Fri, 21 Aug 2020 13:58:16 +0300 Subject: [PATCH 5/5] chore: update tested up to 5.5 --- readme.md | 34 ++--- readme.txt | 368 ++++++++++++++++++++++++++--------------------------- 2 files changed, 201 insertions(+), 201 deletions(-) diff --git a/readme.md b/readme.md index 5f3e246..0de6c04 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,22 +37,22 @@ If you wanna learn more about the