irvinlim / acf-recaptcha Goto Github PK
View Code? Open in Web Editor NEWGoogle reCAPTCHA plugin for Advanced Custom Fields on WordPress
Home Page: https://wordpress.org/plugins/advanced-custom-fields-recaptcha-field/
License: MIT License
Google reCAPTCHA plugin for Advanced Custom Fields on WordPress
Home Page: https://wordpress.org/plugins/advanced-custom-fields-recaptcha-field/
License: MIT License
sorry my english is bad.
hi, i have a problem, when i active the plugin and send the form this generate error 500, without using it, when i use it, i try using with the flag,
this is the code
`
<?php acf_form(array(
'post_id' => 'new_post',
'post_title' => true,
'new_post' => array(
'post_type' => 'jugadores_habiles',
'post_status' => 'pending',
),
'fields' => array(
'apellido-jugador',
'capt-seguridad',
),
'updated_message' => __("Se ha guardado tu mensaje, en poco tiempo validaremos tus datos", 'acf'),
'submit_value' => 'Enviar',
'recaptcha' => true
)); ?>
<?php endwhile; ?>`
Hi there, I'm using acf-recaptcha and having problems with validation. It seems mainly a Safari Problem and the value in the function validate_value($valid, $value, $field, $input) { ...} is always empty, therefore the error 'Please click the checkbox.' is shown even if the captcha is checked. I'm using your Plugin together with AdvancedForms Plugin for ACF - don't know if this could be part of the issue. Do you have any idea to solve the problem? Using Mac High Sierra / Safari Version 11.0.2 (13604.4.7.1.3) On Chrome it seams to work...
Hi there, I would love to use this, but I'm getting the following error on form sunbmission:
jquery.js:2 Uncaught TypeError: Cannot use 'in' operator to search for 'length' in 0
My form works just fine until I activate the plugin. Does the site have to be on the domain I have created the recaptcha keys for? I'm developing locally on my machine.
EDIT: I'm using jQuery v1.11.3
To suppress php errors, one can turn off debugging, but when developing themes, you most likely will have this on. Workaround:
add_filter( 'default_option_acf_recaptcha', function ( $default ) {
return (array) $default + [ 'site_key' => '', 'secret_key' => '' ];
});
@irvinlim perhaps you can clue me why recaptcha validation expired? i did it exactly like in the guide. Please help me about it.
Thank you
When?
I use the last version of ACF 5 and this error happens everytime. Im using Validate Field plugin too.
ACF has easy PHP API for defining field directly in code (https://www.advancedcustomfields.com/resources/register-fields-via-php/) so it might be useful to provide some docs. I'm ready to make a PR if you like this idea.
Hi, I'm getting a lot of false positives, Even if my ReCaptcha widget shows successful verification the form is unable to pass server side checks. Here is similar issue described: https://groups.google.com/forum/#!topic/recaptcha/dgBo2HXQsN8
I was wondering if it is a good idea to check for validation errors instead of checking isSuccess()
in validate_value
method. Quick fix code might look like this:
function validate_value( $valid, $value, $field, $input ){
if (!strlen($value)) return false;
$api = new \ReCaptcha\ReCaptcha($field['secret_key']);
$response = $api->verify($value, $_SERVER['REMOTE_ADDR']);
if ( $response->isSuccess() ) return $valid;
$errors = $response->getErrorCodes();
if ( empty( $errors ) ) return $valid;
return 'Invalid reCaptcha value ' . $value . ' response isSuccess(): ' . ($response->isSuccess() ? 'true' : 'false' ) . ' errors: ' . json_encode($errors);
}
I'm using ACF 5.4.2 PRO.
I keep having the ERROR for site owner: Invalid site key
message.
$args = array( 'post_id' => 'new_post', 'new_post' => array( 'post_type' => 'contact', 'post_status' => 'publish' ), 'return' => '?contact-form-did-send=true', 'submit_value' => __('Send to DoToo team', 'dotoo') ); acf_form($args);
I use a V2 checkbox and have these domains entered:
https://hbosafe.nl
http://hbosafe.test
https://www.hbosafe.nl
Would love to get a reply to know if this is an issue with the plugin or me.
I'm trying to use your plugin with ACF 5, but I encountered a problem.
I'm trying to enable the ACF reCAPTCHA Protection for the field group but it doesn't work. After enabling, I save the field group but after that, every time, the ACF reCaptcha Protection is disabled.
I had a look in the PHP log but there's no PHP error. The save of the field group seems to work fine, there's no error and the other params save well.
Hi
Is it possible to use the Invisible reCaptcha ?
I see only normal
or compact
for the re_size value, but not invisible
.
Thanks !
Hello!
When using this plugin with advanced-forms-pro and ACF 5.7, the validation is somewhat broken... instead of displaying the validation error on top of the reCAPTCHA field, the error appears as a "fullscreen" WordPress error:
Also enabling reCAPTCHA at the field group level doesn't show the field on the form.
I have a page template with acf_form() on it twice. Once is 'form'=> false BECAUSE it is inside another form. How can I get that to work?
Hi, thanks for the plugin.
How we can change locale? Maybe is some add_filter for this?
btw. thanks for your great plugin :)
See original post on WordPress support forum.
I will be experimenting with adding conditional logic to the field to allow fields to be hidden until its value changes.
See this for ideas.
I have found an issue with this plugin (v1.0.7)
When the plugin is enabled, I can't save/update option pages.
The empty javascript alert pops up.
With the disabled plugin the options page saves properly.
Using ACF Version 5.5.12 and WP 4.7.4
Hi,
I have set up the reCAPTCHA field on my contact form which seems to be fine, but when I submit the form I keep getting the error "Please click the checkbox." even though it has been selected. Can you advise me of how to fix this?
Regards
Paul
Hi there,
Firstly thank you for your awesome contribution!
I was wondering how I could go about conditionally removing and disabling recaptcha validation on a form. I am using the PHP interface to display a logged in form to a user.
Kind regards,
Fred
Allow multiple recaptcha fields on the same page
I added the Captcha field to the group of fields used for my enhanced registration form.
The registration form is displayed in my template by using: do_action('register_form')
In the ACF field groups the rule is set to use on Registration Form.
Now if I submit the registration form there are two errors:
I read about using arguments with acf_form, but I'm not calling acf_form, just do_action('register_form').
How do I handle this?
Thanks!
Every so often i seem to get this error
Validation failed
value is required
Im having problems with your recaptcha. Im using it like this:
acf_form(array(
'post_id' => 'new_post',
'post_title' => true,
'new_post' => array(
'post_type' => $post_type,
'post_status' => 'draft'
),
'field_groups' => array($post_id, $recaptcha_id)
));
The circle loader keeps going on forever but the page doesn't do anything.
Hi,
We are using your plugin on a site which still uses php 5.x and have an issue with the php code in the latest version.
PHP Parse error: syntax error, unexpected '[', expecting ',' or ';' in /wp-content/plugins/advanced-custom-fields-recaptcha-field/includes/settings-page.php on line 158
<strong><?php echo __('Plugin Version'); ?></ echo get_plugin_data(ACF_RECAPTCHA_ABSPATH['Version'];
Fix something like this (set to a variable first):
<strong><?php echo __('Plugin Version'); ?></strong>: <?php
$RECAPTCHA_ABSPATH = get_plugin_data(ACF_RECAPTCHA_ABSPATH);
echo $RECAPTCHA_ABSPATH['Version'];
?>
Another issue which isn't related to the php version.
I cannot access the settings page which is linked on the plugins page.
it shows "Sorry, you are not allowed to access this page." even if i am adminstrator.
Url:
/wp-admin/options-general.php?page=acf-recaptcha
The acf field settings page is working as expected.
Url:
/wp-admin/edit.php?post_type=acf-field-group&page=acf-recaptcha
thanks in advance
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.