Tagged: ReCAPTCHA
-
AuthorPosts
-
June 29, 2018 at 1:27 pm #979355
Ismael,
I tried this on the latest version of Enfold and it did not hide the send button (it was inactive) but no captcha is available to solve: https://kriesi.at/support/topic/starting-to-receive-spam-enquiries-from-contact-form-on-website/#post-817676
is this code still compatible with avia contact form?
function ava_custom_recaptcha(){ ?> <script type="text/javascript"> var createCaptcha = function() { var button = jQuery(".avia_ajax_form .button"); var parent = button.parent(".form_element"); var captcha = jQuery("<p id='reCAPTCHAV2'></p>"); button.attr("disabled", "disabled"); captcha.insertBefore(parent); }; createCaptcha(); var onLoadCallback = function() { var publickey = 'YOUR PUBLIC API KEY'; grecaptcha.render('reCAPTCHAV2', { 'sitekey' : publickey, 'callback' : 'onSuccessfullCallback' }); }; var onSuccessfullCallback = function() { jQuery("input[type=submit]").removeAttr('disabled'); }; </script> <?php } add_action('wp_footer', 'ava_custom_recaptcha'); if(!function_exists('avia_register_reCAPTCHAV2_scripts')) { if(!is_admin()){ add_action('wp_enqueue_scripts', 'avia_register_reCAPTCHAV2_scripts'); } function avia_register_reCAPTCHAV2_scripts() { $prefix = is_ssl() ? "https" : "http"; $api_url = $prefix.'://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit'; wp_register_script( 'avia-google-reCAPTCHAV2-api', $api_url, array('jquery'), NULL, true); wp_enqueue_script( 'avia-google-reCAPTCHAV2-api' ); } } function avf_recaCAPTCHAV2_defer_async($tag, $handle) { if ( 'avia-google-reCAPTCHAV2-api' !== $handle ) return $tag; return str_replace( ' src', ' defer="defer" async="async" src', $tag ); } add_filter('script_loader_tag', 'avf_recaCAPTCHAV2_defer_async', 10, 2);
Regards
June 29, 2018 at 7:18 pm #979445i do not test it yet – but do you think in days of GDPR (DSGVO) it is a good advice to use google recaptcha?
Test it if some infos will go out without any action just on loading the page!June 29, 2018 at 9:02 pm #979470I have no choice. The Avia contact form is sending us spam mails (even with unchecked privacy consent) the bot somehow manages to bypass Avia contact form.
Regards
July 2, 2018 at 5:41 am #979935Hi,
We no longer recommend that script anymore. Please try Sucuri or Wordfence to protect your site from spams and malicious scripts.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.