Spam protection without reCaptcha
-
Hi,
I am using the Events Manager plugin on my client’s site. They are getting quite a lot fake reservations (spams by bots, in English). Anyway, they don’t want to any captcha in the forms.
Since the website is not in any widely known language, we decided to try control based on the language knowledge. Here is what I put together (of course, in my code the question is in my language). It may help someone else and I also invite any kind of feedback.
`add_filter(’em_booking_validate’, ‘my_spam_control’, 8, 2);
/** based on em_data_privacy_consent_booking_validate() in em-data-privacy.php
*/
function my_spam_control( $result, $EM_Booking ){
if( empty($_REQUEST[‘control’]) || “8” != $_REQUEST[‘control’]){
$EM_Booking->add_error( “Fill in the correct answer.” );
$result = false;
}
return $result;
}add_action(’em_booking_form_footer’, ‘my_control_html’, 8, 0);
/** based on the function em_data_privacy_consent_checkbox in em-data-privacy.php
*/
function my_control_html( $EM_Object = false ){
?>
<p>
<label for=’control’><?php _e(‘How much is three + five?’,’events-manager’) ?></label>
<input type=”text” name=”control” id=”control” class=”input” value=””/>
</p>
<?php
}
- The topic ‘Spam protection without reCaptcha’ is closed to new replies.