WP Review - Version 4.0.8

Version Description

  • Improved support for older PHP versions
Download this release

Release Info

Developer MyThemeShop
Plugin Icon 128x128 WP Review
Version 4.0.8
Comparing to
See all releases

Code changes from version 4.0.7 to 4.0.8

Files changed (3) hide show
  1. includes/functions.php +14 -15
  2. readme.txt +6 -3
  3. wp-review.php +2 -2
includes/functions.php CHANGED
@@ -328,16 +328,7 @@ function wp_review_ajax_rate() {
328
  exit;
329
  }
330
 
331
- add_action( 'comment_duplicate_trigger', function ( $commentdata ) {
332
- $post_reviews = mts_get_post_reviews( $commentdata['comment_post_ID'] );
333
- $output['status'] = 'fail';
334
- $output['error'] = 'duplicate';
335
- $output['rating_total'] = $post_reviews['rating'];
336
- $output['rating_count'] = $post_reviews['count'];
337
- $output['html'] = wp_review_rating( $post_reviews['rating'], $commentdata['comment_post_ID'], array( 'user_rating' => true ) );
338
- echo wp_json_encode( $output );
339
- exit;
340
- } );
341
 
342
  // don't allow higher rating than max
343
  if ($review > $wp_review_rating_types[$type]['max']) {
@@ -393,6 +384,17 @@ function wp_review_ajax_rate() {
393
  exit;
394
  }
395
 
 
 
 
 
 
 
 
 
 
 
 
396
  /*
397
  * Get review with Ajax
398
  */
@@ -409,10 +411,7 @@ function mts_review_get_review() {
409
 
410
  $uip = wp_review_get_user_ip();
411
 
412
- add_action( 'comment_duplicate_trigger', function () {
413
- echo 'MTS_REVIEW_DUP_ERROR';
414
- exit;
415
- } );
416
 
417
  if ( $review > 0 &&
418
  ! hasPreviousReview( $post_id, $user_id, $uip, WP_REVIEW_COMMENT_TYPE_VISITOR ) &&
@@ -1373,4 +1372,4 @@ function wp_review_admin_notice_ignore() {
1373
  if ( isset($_GET['wp_review_admin_notice_ignore']) && '0' == $_GET['wp_review_admin_notice_ignore'] ) {
1374
  add_user_meta($user_id, 'wp_review_ignore_notice', 'true', true);
1375
  }
1376
- }
328
  exit;
329
  }
330
 
331
+ add_action( 'comment_duplicate_trigger', 'wp_review_comment_duplicate_trigger' );
 
 
 
 
 
 
 
 
 
332
 
333
  // don't allow higher rating than max
334
  if ($review > $wp_review_rating_types[$type]['max']) {
384
  exit;
385
  }
386
 
387
+ function wp_review_comment_duplicate_trigger( $commentdata ) {
388
+ $post_reviews = mts_get_post_reviews( $commentdata['comment_post_ID'] );
389
+ $output['status'] = 'fail';
390
+ $output['error'] = 'duplicate';
391
+ $output['rating_total'] = $post_reviews['rating'];
392
+ $output['rating_count'] = $post_reviews['count'];
393
+ $output['html'] = wp_review_rating( $post_reviews['rating'], $commentdata['comment_post_ID'], array( 'user_rating' => true ) );
394
+ echo wp_json_encode( $output );
395
+ exit;
396
+ }
397
+
398
  /*
399
  * Get review with Ajax
400
  */
411
 
412
  $uip = wp_review_get_user_ip();
413
 
414
+ add_action( 'comment_duplicate_trigger', 'wp_review_comment_duplicate_trigger' );
 
 
 
415
 
416
  if ( $review > 0 &&
417
  ! hasPreviousReview( $post_id, $user_id, $uip, WP_REVIEW_COMMENT_TYPE_VISITOR ) &&
1372
  if ( isset($_GET['wp_review_admin_notice_ignore']) && '0' == $_GET['wp_review_admin_notice_ignore'] ) {
1373
  add_user_meta($user_id, 'wp_review_ignore_notice', 'true', true);
1374
  }
1375
+ }
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: mythemeshop
3
  Creator's website link: http://mythemeshop.com/plugins/wp-review/
4
  Tags: review, wp review, rating, wp rating, user rating, google rating, star rating, product review
5
  Requires at least: 3.0.1
6
- Tested up to: 4.7
7
- Stable tag: 4.0.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -102,6 +102,9 @@ Please disable all plugins and check if rating is working properly. Then you can
102
 
103
  == Changelog ==
104
 
 
 
 
105
  = 4.0.7 =
106
  * Fixed widget title issue
107
 
@@ -234,4 +237,4 @@ Please disable all plugins and check if rating is working properly. Then you can
234
  * Made small CSS and responsive improvements.
235
 
236
  = 1.0 =
237
- * Official plugin release.
3
  Creator's website link: http://mythemeshop.com/plugins/wp-review/
4
  Tags: review, wp review, rating, wp rating, user rating, google rating, star rating, product review
5
  Requires at least: 3.0.1
6
+ Tested up to: 4.7.2
7
+ Stable tag: 4.0.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
102
 
103
  == Changelog ==
104
 
105
+ = 4.0.8 =
106
+ * Improved support for older PHP versions
107
+
108
  = 4.0.7 =
109
  * Fixed widget title issue
110
 
237
  * Made small CSS and responsive improvements.
238
 
239
  = 1.0 =
240
+ * Official plugin release.
wp-review.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WP Review
4
  * Plugin URI: http://mythemeshop.com/plugins/wp-review/
5
  * Description: Create reviews! Choose from stars, percentages or points for review scores. Supports Retina Display, WPMU and Unlimited Color Schemes.
6
- * Version: 4.0.7
7
  * Author: MyThemesShop
8
  * Author URI: http://mythemeshop.com/
9
  *
@@ -125,4 +125,4 @@ if ( ! defined( 'MTS_WP_REVIEW_DB_TABLE' )) {
125
 
126
  }
127
 
128
- ?>
3
  * Plugin Name: WP Review
4
  * Plugin URI: http://mythemeshop.com/plugins/wp-review/
5
  * Description: Create reviews! Choose from stars, percentages or points for review scores. Supports Retina Display, WPMU and Unlimited Color Schemes.
6
+ * Version: 4.0.8
7
  * Author: MyThemesShop
8
  * Author URI: http://mythemeshop.com/
9
  *
125
 
126
  }
127
 
128
+ ?>