When Captcha is not filled out the form still can go through
-
I’m using ContactForm 7 Version: 4.1
Unfortuantely, I can submit the form without putting any number in the math captcha and it will go through, so I’m still getting spam. Is there a fix for this?
Thank you
-
It should not. The field should be validated and force the user to enter the captcha value.
Can you post a link to this form on a live site?
I am also facing same problem
Can you assist to resolve?
My Link is: anuaggarwal.org/beta
Thank You!
Hi, I am facing the problem. The captcha has been working fine for several months but just recently spam has been getting through.
A visitor can now send a message and not complete the maths question – the form still gets submitted.
I’ve deactivated and reactivated the plug in – no difference.
https://www.wilsonorange.com/refer/
Please help.
Thanks!
Hi, I am using Math Captcha with contact form 7.The captcha has been working fine for several months but when i update it to version 1.2.4 the form submitted without putting any number in the math captcha.
I’ve deactivated and reactivated all plugins but problem was still.
https://www.ennovationsols.com/contact-us
Please help.
Thanks!
Ok, can you remove the double jquery code in your theme.
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.3.js"></script>
and fix this error:
Error: TypeError: $n(...) is not a function Source: https://www.ennovationsols.com/wp-content/plugins/testimonial-slider/js/testimonial.js?ver=1.1 Line: 13
Then try again.
dFactory! i fix jquery error on my web site but math captcha problam is still.
I’m having the same problem: and for two sites too! How can this be fixed?
itsarakoncepts.com
gowithsidebeam.comI also posted this same question two weeks ago at the dfactory site and never got a response. Is this even being resolved?
This is caused by an update of Contact Form 7
As stated in the 4.1 beta release, there has been a change in the user-input validation process and, if you use add-on plugins or custom code for Contact Form 7, you may need to modify the code to make it work with Contact Form 7 4.1.
Here is the solution:
--- a/wp-content/plugins/wp-math-captcha/includes/integration-cf7.php +++ b/wp-content/plugins/wp-math-captcha/includes/integration-cf7.php @@ -67,20 +67,17 @@ function wpcf7_mathcaptcha_validation_filter($result, $tag) { if(strcmp(get_transient('cf7_'.$session_id), sha1(AUTH_KEY.$_POST[$name].$session_id, false)) !== 0) { - $result['valid'] = false; - $result['reason'][$name] = wpcf7_get_message('wrong_mathcaptcha'); + $result->invalidate($tag, wpcf7_get_message('wrong_mathcaptcha')); } } else { - $result['valid'] = false; - $result['reason'][$name] = wpcf7_get_message('time_mathcaptcha'); + $result->invalidate($tag, wpcf7_get_message('time_mathcaptcha')); } } else { - $result['valid'] = false; - $result['reason'][$name] = wpcf7_get_message('fill_mathcaptcha'); + $result->invalidate($tag, wpcf7_get_message('fill_mathcaptcha')); } }
The issue was with the $cf7_version = get_option(‘wpcf7’, ‘1.0.0’); in the file wp-content/plugins/wp-math-captcha/includes/integration-cf7.php
To solve the issue add “$cf7_version = $cf7_version[‘version’];” below ” $cf7_version = get_option(‘wpcf7’, ‘1.0.0’);”
or add the following code in your functions.php
add_filter('wpcf7_validate_mathcaptcha', 'my_mathcaptcha_validation_filter', 10, 2); function my_mathcaptcha_validation_filter($result, $tag) { $tag = new WPCF7_Shortcode($tag); $name = $tag->name; if(!is_admin() && isset($_POST[$name])) { $cf7_version = get_option('wpcf7', '1.0.0'); $cf7_version = $cf7_version['version']; if($_POST[$name] !== '') { $session_id = (isset($_POST[$name.'-sn']) && $_POST[$name.'-sn'] !== '' ? Math_Captcha()->cookie_session->session_ids['multi'][$_POST[$name.'-sn']] : ''); if($session_id !== '' && get_transient('cf7_'.$session_id) !== false) { if(strcmp(get_transient('cf7_'.$session_id), sha1(AUTH_KEY.$_POST[$name].$session_id, false)) !== 0) { if(version_compare($cf7_version, '4.1.0', '>=')) $result['reason'][$name] = wpcf7_get_message('wrong_mathcaptcha'); else { $result['valid'] = false; $result->invalidate($tag, wpcf7_get_message('wrong_mathcaptcha')); } } } else { if(version_compare($cf7_version, '4.1.0', '>=')) $result->invalidate($tag, wpcf7_get_message('time_mathcaptcha')); else { $result['valid'] = false; $result['reason'][$name] = wpcf7_get_message('time_mathcaptcha'); } } } else { if(version_compare($cf7_version, '4.1.0', '>=')) $result->invalidate($tag, wpcf7_get_message('fill_mathcaptcha')); else { $result['valid'] = false; $result['reason'][$name] = wpcf7_get_message('fill_mathcaptcha'); $result->invalidate($tag, wpcf7_get_message('fill_mathcaptcha')); } } } return $result; }
Thanks guys, that seemed to have fixed it, although now I have an issue with:
“ERROR: captcha time expired”
upon clicking submit with the correct captcha value. Any ideas?
- The topic ‘When Captcha is not filled out the form still can go through’ is closed to new replies.