Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

Commit

Permalink
release
Browse files Browse the repository at this point in the history
[Fix] Compatibility with WP 5.5
[Fix] Compatibility with AMP for WP plugin
  • Loading branch information
rodica-andronache authored Aug 21, 2020
2 parents 02d1f8f + e3a88b9 commit 4de6181
Show file tree
Hide file tree
Showing 7 changed files with 219 additions and 203 deletions.
2 changes: 1 addition & 1 deletion includes/class-wppr.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 3 additions & 0 deletions includes/gutenberg/class-wppr-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ public function update_posts_endpoints() {
'sanitize_callback' => 'sanitize_text_field',
),
),
'permission_callback' => function () {
return current_user_can( 'edit_posts' );
},
)
);

Expand Down
21 changes: 16 additions & 5 deletions includes/public/class-wppr-public.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,28 @@ 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.
*/
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;
}

Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
49 changes: 25 additions & 24 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -37,29 +37,30 @@ If you wanna learn more about the <a href="http://www.codeinwp.com/blog/fastest-
**Please note that WP Product Review PRO has been retired and is no longer available**

## Changelog ##
### 3.7.10 - 2020-06-24 ###

* [Fix] Load schema.org just for PHP 7.0 and above
* [Fix] Take into account the rating scale option for schema.org
* [Fix] Dequeue jquery-ui-slider when not used


### 3.7.9 - 2020-06-15 ###

* [Fix] Schema.org in both the new and classic editor
* [Fix] Do not display reviews in content outside the loop


### 3.7.8 - 2020-05-22 ###

* [Fix] Sanitize values


### 3.7.7 - 2020-05-21 ###

* [Fix] Security vulnerability



### 3.7.10 - 2020-06-24 ###

* [Fix] Load schema.org just for PHP 7.0 and above
* [Fix] Take into account the rating scale option for schema.org
* [Fix] Dequeue jquery-ui-slider when not used


### 3.7.9 - 2020-06-15 ###

* [Fix] Schema.org in both the new and classic editor
* [Fix] Do not display reviews in content outside the loop


### 3.7.8 - 2020-05-22 ###

* [Fix] Sanitize values


### 3.7.7 - 2020-05-21 ###

* [Fix] Security vulnerability


### 3.7.6 - 2020-05-14 ###

* - [Fix] Security vulnerability
Expand Down
Loading

0 comments on commit 4de6181

Please sign in to comment.