Hot answers tagged

7

No, it's not an overkill to use honeypot and captcha together for the same form. Why? They both use different approach: Honeypots are targeted towards bots falling for common rules. Captchas are targeted towards humans passing rules. Why have Honeypots: When set up correctly, they'll protect you against wholesale spam bots. It means it'll automatically ...


4

The definitive solution with session is.. do not use session. As example in your form, you can output 3 fields: an image field -> the captcha image a text field -> to allow users to insert the characters an hidden field -> contain the solution but encripted using wp_create_nonce In this way when the form is submitted you can compare the user input with ...


4

I had exactly the same need, because of the ajax checkout validation. Woocommerce has some custom javascript events we can hook to. In reCaptcha specific case we need to hook to checkout_error that is triggered when the ajax call fails. So, I solved with the following code in my own javascript file, besides the PHP custom validation hooked to ...


3

You can't do that directly inside the CF7 plugin you need to modify the CSS. Add the following to your theme's style.css file: .wpcf7-recaptcha > div { margin: 0 0 15px auto; } PLEASE BE NOTED: If you add the above code, it will take effect to all your recaptcha fields in every forms on your website. Often times, we would like to only do this to ...


2

So Wordfence uses JavaScript to add the CAPTCHA fields to the login/registration form, but by default only on https://example.com/wp-login.php. And if you want to add the fields to your form, or integrate the CAPTCHA security with your custom login form, the steps are: Enqueue the (re)CAPTCHA scripts, preferably only on the page having the custom form: ...


2

I'd put the dequeue statements inside the 'if', replacing the $loadscripts line. No need to set the flag and then check the flag to dequeue. That might simplify the code for further debugging. Edited: suggested code corrections: function contactform_dequeue_scripts() { if (is_singular()) { $post = get_post(); if (has_shortcode($post->...


2

You can disable that plugin without accessing your Wordpress Dashboard. You need to navigate to your Wordpress installation folder, then to wp-content/plugins and then look for the folder with it and rename it. This will disable the plugin and you should be able to login. Afterwards, I suggest you to contact the plugin developers and describe the issue ...


1

I Found the Solution Finally Myself. here you are :) . inside Fuctions.php function karnetacom_scripts(){ wp_enqueue_script('ajax-forms-js',get_template_directory_uri().'/logreg/ajax-for-forms.js',array('jquery'),false,true); wp_localize_script('ajax-forms-js','data',array( 'ajax_url' => admin_url('admin-ajax.php'), '...


1

This looks like LiteSpeed reCaptcha - https://blog.litespeedtech.com/2019/03/18/recaptcha-server-wide-protection/ Probalby it was enabled by your hosting provider to protect sites from brute force attacks. I'd suggest you to contact them and explain your issue so they could configure it to make a proper redirect after reCaptcha check.


1

This works for me. function contactform_dequeue_scripts() { $load_scripts = false; if( is_singular() ) { $post = get_post(); if( has_shortcode($post->post_content, 'contact-form-7') ) { $load_scripts = true; } } if( ! $load_scripts ) { wp_dequeue_script( 'contact-form-7' ); ...


1

In Autoptimize, in the Javascript Options, there's a field to 'Exclude scripts from Autoptimize', you will add a script to the field. You will need to add a comma to the last script already in the field then add this after: /recaptcha/api.js Hopefully, this helps. Best, Carm


1

Assuming that you added code somewhere to enable the reCAPTCHA, then use your hosting File Manager (or a FTP CLient - I like WinSCP) and remove (or comment out) that code. If you added the reCAPTCHA with a plugin, use File Manager/FTP to rename that plugin's folder, found in the wp_content/plugins folder of your site. That will temporarily disable the ...


1

You may search install a pluggin like No CAPTCHA. Supports: Contact Form 7, Ninja Forms, Gravity Forms, MailChimp, Formidable forms, WooCommerce, JetPack comments and contact form, BuddyPress, bbPress, Fast Secure Contact form, S2Member, MailPoet, any WordPress registrations & contact forms and themes.


1

You need to validate the reCAPTCHA immediately once you POST the form. You're just sending a POST to the same page, so it should be done before any other handling. If it does not validate, you need to show the form again, with an error message. function recaptcha_validated(){ if( empty( $_POST['g-recaptcha-response'] ) ) return FALSE; $response = ...


1

you can use this function i think it works properly. add_filter( 'wp_authenticate_user', 'verify_recaptcha_on_login', 10, 3 ); function verify_recaptcha_on_login($user, $password) { $secretkey = "your secret key"; if (isset($_POST['g-recaptcha-response'])) { $response = wp_remote_get( 'https://www.google.com/recaptcha/api/siteverify?secret='.$...


1

I have not been able to figure out how to inject JavaScript upon cart error. However, I am using a workaround -- setInterval at WooCommerce checkout that looks for an error message, and then calls grecaptcha.reset();


1

Check out the default comment-template.php file: wp-includes/comment-template.php You will need to replace the arguments: $defaults = array( 'fields' => apply_filters( 'comment_form_default_fields', $fields ), 'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) ....


1

We can implement a security captcha image into our own plugin using Really Simple Captcha plugin. See the example explained in the following link, how to use the Really Simple Captcha Plugin with our own WordPress plugin Implementation of captcha image into your own plugin using Really Simple Captcha plugin.


1

You could try something like if( ! function_exists('plugin_function') ) require_once('/wp-content/plugins/wp-recaptcha/recaptchalib.php'); endif; Not tested but essentially it checks if the plugin exists before trying to add it


1

Actually there are a lot of solution for this. Simply a google could answer you the whole. And also WordPress plugin repository could help you. But to pinpoint, you can use Plugins easily. Try anyone of them: Captcha — WordPress plugin SI CAPTCHA Anti-Spam — WordPress plugin more... And also, Akismet is a very good plugin to get the spam out of ...


1

Use this plugin for this purpose SI Captcha


Only top voted, non community-wiki answers of a minimum length are eligible