Skip to content

Commit

Permalink
v7.2.2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
pryley committed Oct 25, 2024
1 parent ae7b43b commit e03893d
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 22 deletions.
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
== Changelog ==

= 7.2.2 (2024-10-25) =

- Fixed form validation to catch manually modified hidden fields

= 7.2.1 (2024-10-24) =

- Added global color support to the Elementor widgets.
Expand Down
Binary file modified languages/site-reviews-en_US.mo
Binary file not shown.
12 changes: 6 additions & 6 deletions languages/site-reviews-en_US.po
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ msgstr "This review is based on my own experience and is my genuine opinion."
msgid "Show more"
msgstr "Show more"

#: plugin/Commands/CreateReview.php:162, views/pages/documentation/support/common-problems-and-solutions.php:89
#: plugin/Commands/CreateReview.php:162, views/pages/documentation/support/common-problems-and-solutions.php:95
msgid ""
"Your review could not be submitted and the error has been logged. Please "
"notify the site administrator."
Expand Down Expand Up @@ -408,7 +408,7 @@ msgstr "The CAPTCHA failed to load, please refresh the page and try again."
msgid "The CAPTCHA verification failed, please try again."
msgstr "The CAPTCHA verification failed, please try again."

#: plugin/Modules/Validator/CustomValidator.php:21, views/pages/documentation/support/common-problems-and-solutions.php:119
#: plugin/Modules/Validator/CustomValidator.php:21, views/pages/documentation/support/common-problems-and-solutions.php:125
msgid "The review submission failed. Please notify the site administrator."
msgstr "The review submission failed. Please notify the site administrator."

Expand All @@ -428,9 +428,9 @@ msgstr "You must be logged in to submit a review."
msgid "You have already submitted a review."
msgstr "You have already submitted a review."

#: plugin/Modules/Validator/SignatureValidator.php:29
msgid "This review cannot be submitted because the form was modified."
msgstr "This review cannot be submitted because the form was modified."
#: plugin/Modules/Validator/SignatureValidator.php:29, views/pages/documentation/support/common-problems-and-solutions.php:89
msgid "This review cannot be submitted, please refresh the page and try again."
msgstr "This review cannot be submitted, please refresh the page and try again."

#: plugin/Integrations/UltimateMember/Controllers/ProfileController.php:41
msgid "Reviews"
Expand Down Expand Up @@ -512,7 +512,7 @@ msgstr "No Title"
msgid "Verified"
msgstr "Verified"

#: views/pages/documentation/support/common-problems-and-solutions.php:125
#: views/pages/documentation/support/common-problems-and-solutions.php:131
msgid "Service Unavailable."
msgstr "Service Unavailable."

Expand Down
10 changes: 5 additions & 5 deletions languages/site-reviews.pot
Original file line number Diff line number Diff line change
Expand Up @@ -1886,7 +1886,7 @@ msgctxt "admin-text"
msgid "The <code>%s</code> table was successly converted to InnoDB."
msgstr ""

#: plugin/Commands/CreateReview.php:162, views/pages/documentation/support/common-problems-and-solutions.php:89
#: plugin/Commands/CreateReview.php:162, views/pages/documentation/support/common-problems-and-solutions.php:95
msgid "Your review could not be submitted and the error has been logged. Please notify the site administrator."
msgstr ""

Expand Down Expand Up @@ -4881,7 +4881,7 @@ msgstr ""
msgid "The CAPTCHA verification failed, please try again."
msgstr ""

#: plugin/Modules/Validator/CustomValidator.php:21, views/pages/documentation/support/common-problems-and-solutions.php:119
#: plugin/Modules/Validator/CustomValidator.php:21, views/pages/documentation/support/common-problems-and-solutions.php:125
msgid "The review submission failed. Please notify the site administrator."
msgstr ""

Expand All @@ -4901,8 +4901,8 @@ msgstr ""
msgid "You have already submitted a review."
msgstr ""

#: plugin/Modules/Validator/SignatureValidator.php:29
msgid "This review cannot be submitted because the form was modified."
#: plugin/Modules/Validator/SignatureValidator.php:29, views/pages/documentation/support/common-problems-and-solutions.php:89
msgid "This review cannot be submitted, please refresh the page and try again."
msgstr ""

#: views/integrations/multilingualpress/assigned_posts-field.php:5
Expand Down Expand Up @@ -5918,7 +5918,7 @@ msgctxt "admin-text"
msgid "Revert"
msgstr ""

#: views/pages/documentation/support/common-problems-and-solutions.php:125
#: views/pages/documentation/support/common-problems-and-solutions.php:131
msgid "Service Unavailable."
msgstr ""

Expand Down
11 changes: 7 additions & 4 deletions plugin/Modules/Html/MetaboxForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ public function build(): string
public function config(): array
{
$config = glsr()->config('forms/metabox-fields');
if (!wp_is_numeric_array($config)) {
$order = array_keys($config);
$order = glsr()->filterArray('metabox-form/fields/order', $order);
$ordered = array_intersect_key(array_merge(array_flip($order), $config), $config);
$config = $ordered;
}
$config = glsr()->filterArray('metabox-form/fields', $config, $this);
if (2 > count(glsr()->retrieveAs('array', 'review_types'))) {
unset($config['type']);
Expand All @@ -43,10 +49,7 @@ public function config(): array
'data-value' => esc_js($value),
]);
}
$order = array_keys($config);
$order = glsr()->filterArray('metabox-form/fields/order', $order);
$ordered = array_intersect_key(array_merge(array_flip($order), $config), $config);
return $ordered;
return $config;
}

public function fieldClass(): string
Expand Down
11 changes: 7 additions & 4 deletions plugin/Modules/Html/ReviewForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ public function __construct(array $args = [], array $values = [])
public function config(): array
{
$config = glsr()->config('forms/review-form');
if (!wp_is_numeric_array($config)) {
$order = array_keys($config);
$order = glsr()->filterArray('review-form/order', $order);
$ordered = array_intersect_key(array_merge(array_flip($order), $config), $config);
$config = $ordered;
}
$config = glsr()->filterArray('review-form/fields', $config, $this);
$order = array_keys($config);
$order = glsr()->filterArray('review-form/order', $order);
$ordered = array_intersect_key(array_merge(array_flip($order), $config), $config);
return $ordered;
return $config;
}

public function configHidden(): array
Expand Down
2 changes: 1 addition & 1 deletion plugin/Modules/Validator/SignatureValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function performValidation(): void
{
if (!$this->isValid()) {
$this->fail(
__('This review cannot be submitted because the form was modified.', 'site-reviews'),
__('This review cannot be submitted, please refresh the page and try again.', 'site-reviews'),
'The form signature could not be verified.'
);
}
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: geminilabs, pryley
Donate link: https://ko-fi.com/pryley
Tags: reviews, ratings, testimonials, product reviews, business reviews
Tested up to: 6.7
Stable tag: 7.2.1
Stable tag: 7.2.2
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -196,6 +196,10 @@ This update requires a minimum of PHP 7.4 and WordPress 6.1. There are a few pot

== Changelog ==

= 7.2.2 (2024-10-25) =

- Fixed form validation to catch manually modified hidden fields

= 7.2.1 (2024-10-24) =

- Added global color support to the Elementor widgets.
Expand Down
2 changes: 1 addition & 1 deletion site-reviews.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Plugin Name: Site Reviews
* Plugin URI: https://wordpress.org/plugins/site-reviews
* Description: Receive and display reviews on your website
* Version: 7.2.1
* Version: 7.2.2
* Author: Paul Ryley
* Author URI: https://geminilabs.io
* License: GPL3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@
</h4>
<p>This error is shown when the Akismet or Honeypot validator prevents the review from being submitted.</p>
</li>
<li>
<h4 class="components-notice is-error" style="font-size:15px;">
<?php echo __('This review cannot be submitted, please refresh the page and try again.', 'site-reviews'); ?>
</h4>
<p>This error is shown when the hidden input values in the Form have been modified.</p>
</li>
<li>
<h4 class="components-notice is-error" style="font-size:15px;">
<?php echo __('Your review could not be submitted and the error has been logged. Please notify the site administrator.', 'site-reviews'); ?>
Expand Down

0 comments on commit e03893d

Please sign in to comment.