Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Commit

Permalink
V0.3
Browse files Browse the repository at this point in the history
V0.3 Commit
  • Loading branch information
andrewlimaza committed Mar 17, 2020
1 parent a431649 commit d39b5e0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
4 changes: 2 additions & 2 deletions caldera-forms-anti-spam.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
* Plugin Name: Caldera Forms Anti Spam
* Description: Anti-spam for Caldera Forms. Recaptcha field!
* Author: Yoohoo Plugins
* Version: 0.2
* Version: 0.3
* Author URI: https://yoohooplugins.com
* Text Domain: cf-anti-spam
*/

define( 'CF_ANTISPAM_PATH', plugin_dir_path( __FILE__ ) );
define( 'CF_ANTISPAM_URL', plugin_dir_url( __FILE__ ) );
define( 'CF_ANTISPAM_VER', '0.1.1' );
define( 'CF_ANTISPAM_VER', '0.3' );



Expand Down
8 changes: 6 additions & 2 deletions fields/recaptcha/field.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@

<?php echo Caldera_Forms_Field_Input::html( $field, $field_structure, $form ); ?>

<div id="cap<?php echo $field_id; ?>" class="g-recaptcha" data-sitekey="<?php echo $field['config']['public_key']; ?>" <?php if (!empty($field['config']['invis']) && $field['config']['invis'] === 1 ) { ?>data-size="invisible" <?php } ?>></div>
<?php if (!empty($field['config']['recapv']) && $field['config']['recapv'] === 1 ) { ?>
<div id="cap<?php echo $field_id; ?>"></div>
<?php } else { ?>
<div id="cap<?php echo $field_id; ?>" class="g-recaptcha" data-sitekey="<?php echo $field['config']['public_key']; ?>" <?php if (!empty($field['config']['invis']) && $field['config']['invis'] === 1 ) { ?>data-size="invisible" <?php } ?>></div>
<?php } ?>

<?php echo $field_caption; ?>

Expand Down Expand Up @@ -57,7 +61,7 @@ function init_recaptcha_<?php echo $field_id; ?>(){
var captch = $('#cap<?php echo $field_id; ?>');
grecaptcha.execute("<?php echo trim( $field['config']['public_key'] ); ?>", {action: 'homepage'}).then(function(token) {
$('<input type="hidden" name="cf-recapv-token" value="' + token + '">').insertAfter(captch[0]);
});;
});
});
<?php } else { ?>

Expand Down
12 changes: 8 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
=== Caldera Forms Anti Spam ===
Contributors: andrewza, yoohooplugins, travislima
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4GC4JEZH7KSKL
Tags: caldera forms, anti-spam, recapatcha
Tags: caldera forms, anti-spam, recaptcha
Requires at least: 4.5
Tested up to: 5.2.2
Tested up to: 5.3
Stable tag: trunk
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Anti-spam for Caldera Forms. Recaptcha and more.
Anti-spam for Caldera Forms. reCAPTCHA and more.
== Description ==

Anti-spam for [Caldera Forms](https://calderaforms.com)
Expand Down Expand Up @@ -40,7 +40,7 @@ Yes, this will add a Google reCAPTCHA-powered captcha to your Caldera Form.
Yes, this supports 'legacy' versions of reCaptcha for Caldera Forms.

= How Do I Enable V2 reCAPTCHA =
Add the hidden field to your Caldera Form and do not select V3 or Invisible reCaptcha Checkboxes.
Add the hidden field to your Caldera Form and do not select V3 or Invisible reCAPTCHA checkboxes.

= How Do I Enable V3 reCAPTCHA =
Once the hidden field is added to your Caldera Form, select the V3 checkbox. (You do not need to select the Invisible reCaptcha option if you have selected this setting).
Expand All @@ -51,6 +51,10 @@ Once the hidden field is added to your Caldera Form, select the V3 checkbox. (Yo

== Changelog ==

= 0.3 =
* Fixed JavaScript syntax issues within the V3 reCAPTCHA handler
* Fixed bug where V2 reCAPTCHA field would still be rendered when V3 is enabled

= 0.2 =
* Added invisible reCAPTCHA support and option
* Added reCAPTCHA v3 support and option
Expand Down

0 comments on commit d39b5e0

Please sign in to comment.