Site Reviews - Version 5.8.5

Version Description

(2021-04-17) =

  • Fixed anonymous reviews from inheriting the author ID of the logged in user after being edited
Download this release

Release Info

Developer geminilabs
Plugin Icon 128x128 Site Reviews
Version 5.8.5
Comparing to
See all releases

Code changes from version 5.8.4 to 5.8.5

plugin/Controllers/ReviewController.php CHANGED
@@ -55,6 +55,26 @@ class ReviewController extends Controller
55
  return $posts;
56
  }
57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  /**
59
  * @param string $template
60
  * @return string
55
  return $posts;
56
  }
57
 
58
+ /**
59
+ * @param array $data
60
+ * @param array $postArr
61
+ * @return array
62
+ * @filter wp_insert_post_data
63
+ */
64
+ public function filterReviewPostData($data, $postArr)
65
+ {
66
+ if (empty($postArr['ID']) || glsr()->post_type !== glsr_get($postArr, 'post_type')) {
67
+ return $data;
68
+ }
69
+ if (empty(filter_input(INPUT_POST, 'post_author'))) {
70
+ $data['post_author'] = 0; // the review has an unknown author
71
+ }
72
+ if (isset($_POST['post_author_override'])) {
73
+ $data['post_author'] = $_POST['post_author_override']; // use the value from the author meta box
74
+ }
75
+ return $data;
76
+ }
77
+
78
  /**
79
  * @param string $template
80
  * @return string
plugin/Defaults/PostTypeDefaults.php CHANGED
@@ -31,7 +31,7 @@ class PostTypeDefaults extends Defaults
31
  'show_in_menu' => true,
32
  'show_in_rest' => true,
33
  'show_ui' => true,
34
- 'supports' => ['title', 'editor', 'revisions'],
35
  'taxonomies' => [],
36
  ];
37
  }
31
  'show_in_menu' => true,
32
  'show_in_rest' => true,
33
  'show_ui' => true,
34
+ 'supports' => ['author', 'title', 'editor', 'revisions'],
35
  'taxonomies' => [],
36
  ];
37
  }
plugin/Hooks.php CHANGED
@@ -200,6 +200,7 @@ class Hooks implements HooksContract
200
  add_filter('script_loader_tag', [$this->public, 'filterEnqueuedScriptTags'], 10, 2);
201
  add_filter('site-reviews/config/forms/review-form', [$this->public, 'filterFieldOrder'], 11);
202
  add_filter('site-reviews/render/view', [$this->public, 'filterRenderView']);
 
203
  add_filter('site-reviews/rendered/template/review', [$this->review, 'filterReviewTemplate'], 10, 2);
204
  add_filter('site-reviews/query/sql/clause/operator', [$this->review, 'filterSqlClauseOperator'], 1);
205
  add_filter('site-reviews/review/build/after', [$this->review, 'filterTemplateTags'], 10, 3);
200
  add_filter('script_loader_tag', [$this->public, 'filterEnqueuedScriptTags'], 10, 2);
201
  add_filter('site-reviews/config/forms/review-form', [$this->public, 'filterFieldOrder'], 11);
202
  add_filter('site-reviews/render/view', [$this->public, 'filterRenderView']);
203
+ add_filter('wp_insert_post_data', [$this->review, 'filterReviewPostData'], 10, 2);
204
  add_filter('site-reviews/rendered/template/review', [$this->review, 'filterReviewTemplate'], 10, 2);
205
  add_filter('site-reviews/query/sql/clause/operator', [$this->review, 'filterSqlClauseOperator'], 1);
206
  add_filter('site-reviews/review/build/after', [$this->review, 'filterTemplateTags'], 10, 3);
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: reviews, ratings, testimonials, woocommerce, product reviews
5
  Tested up to: 5.7
6
  Requires at least: 5.5
7
  Requires PHP: 5.6
8
- Stable tag: 5.8.4
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -133,6 +133,10 @@ All documentation can be found in the "Help" page of the plugin. If your questio
133
 
134
  ## Changelog
135
 
 
 
 
 
136
  = 5.8.4 (2021-04-15) =
137
 
138
  - Fixed a potential problem introduced by the previous widget compatibility fix
5
  Tested up to: 5.7
6
  Requires at least: 5.5
7
  Requires PHP: 5.6
8
+ Stable tag: 5.8.5
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
133
 
134
  ## Changelog
135
 
136
+ = 5.8.5 (2021-04-17) =
137
+
138
+ - Fixed anonymous reviews from inheriting the author ID of the logged in user after being edited
139
+
140
  = 5.8.4 (2021-04-15) =
141
 
142
  - Fixed a potential problem introduced by the previous widget compatibility fix
site-reviews.php CHANGED
@@ -7,7 +7,7 @@
7
  * Plugin Name: Site Reviews
8
  * Plugin URI: https://wordpress.org/plugins/site-reviews
9
  * Description: Receive and display reviews on your website
10
- * Version: 5.8.4
11
  * Author: Paul Ryley
12
  * Author URI: https://geminilabs.io
13
  * License: GPL2
7
  * Plugin Name: Site Reviews
8
  * Plugin URI: https://wordpress.org/plugins/site-reviews
9
  * Description: Receive and display reviews on your website
10
+ * Version: 5.8.5
11
  * Author: Paul Ryley
12
  * Author URI: https://geminilabs.io
13
  * License: GPL2