diff --git a/plugin/Defaults/ValidateReviewDefaults.php b/plugin/Defaults/ValidateReviewDefaults.php index 0d06500fc..d080e448f 100644 --- a/plugin/Defaults/ValidateReviewDefaults.php +++ b/plugin/Defaults/ValidateReviewDefaults.php @@ -3,6 +3,7 @@ namespace GeminiLabs\SiteReviews\Defaults; use GeminiLabs\SiteReviews\Defaults\DefaultsAbstract as Defaults; +use GeminiLabs\SiteReviews\Helper; class ValidateReviewDefaults extends Defaults { @@ -17,7 +18,7 @@ protected function defaults() 'content' => '', 'email' => '', 'form_id' => '', - 'ip_address' => '', + 'ip_address' => glsr( Helper::class )->getIpAddress(), // required for Akismet and Blacklist validation 'name' => '', 'rating' => '0', 'terms' => '', diff --git a/plugin/Modules/Validator/ValidateReview.php b/plugin/Modules/Validator/ValidateReview.php index 5073fbd24..739508cf1 100644 --- a/plugin/Modules/Validator/ValidateReview.php +++ b/plugin/Modules/Validator/ValidateReview.php @@ -177,8 +177,8 @@ protected function validateAkismet() { if( !empty( $this->error ))return; if( !glsr( Akismet::class )->isSpam( $this->request ))return; - $this->setSessionValues( 'errors', [], 'Akismet caught a spam submission:' ); - $this->error = __( 'Your review cannot be submitted at this time. Please try again later.', 'site-reviews' ); + $this->setSessionValues( 'errors', [], 'Akismet caught a spam submission (consider adding the IP address to the blacklist):' ); + $this->error = __( 'This review has been flagged as possible spam and cannot be submitted.', 'site-reviews' ); } /**