Skip to content

Commit

Permalink
Merge pull request #13 from gravityview/develop
Browse files Browse the repository at this point in the history
Prevent autocomplete on the added input
  • Loading branch information
zackkatz authored Aug 12, 2022
2 parents 5126098 + f7409f2 commit 2c86cab
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
9 changes: 6 additions & 3 deletions gravityforms-zero-spam.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Gravity Forms Zero Spam
* Plugin URI: https://gravityview.co?utm_source=plugin&utm_campaign=zero-spam&utm_content=pluginuri
* Description: Enhance Gravity Forms to include effective anti-spam measures—without using a CAPTCHA.
* Version: 1.2.1
* Version: 1.2.2
* Author: GravityView
* Author URI: https://gravityview.co?utm_source=plugin&utm_campaign=zero-spam&utm_content=authoruri
* License: GPL-2.0+
Expand Down Expand Up @@ -77,12 +77,15 @@ public function add_key_field( $form ) {

$spam_key = esc_js( $this->get_key() );

$autocomplete = RGFormsModel::is_html5_enabled() ? ".attr( 'autocomplete', 'off' )\n\t\t" : '';

$script = <<<EOD
jQuery( document ).on( 'submit.gravityforms', '.gform_wrapper form', function( event ) {
jQuery( '<input>' ).attr( 'type', 'hidden' )
jQuery( '<input>' )
.attr( 'type', 'hidden' )
.attr( 'name', 'gf_zero_spam_key' )
.attr( 'value', '{$spam_key}' )
.appendTo( jQuery( this ) );
$autocomplete.appendTo( jQuery( this ) );
} );
EOD;

Expand Down
9 changes: 7 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: gravityview
Tags: gravityforms, gravity forms, anti-spam, antispam, spam, spam-blocker, spambot, spammer, add-ons, honeypot
Requires at least: 3.0.1
Tested up to: 5.9
Tested up to: 6.0.1
Stable tag: trunk
Requires PHP: 5.2.6
License: GPLv2 or later
Expand All @@ -29,7 +29,7 @@ If you only want the plugin for specific forms, that's possible! The plugin adds

Requires [Gravity Forms](https://www.gravityforms.com/?partner_id=1210629&irgwc=1&utm_medium=affiliate&utm_campaign=1210629&utm_source=Katz%20Web%20Services%2C%20Inc.).

_Brought to you by [GravityView](https://gravityview.co?utm_source=plugin&utm_campaign=zero-spam&utm_content=readme). We create essential Gravity Forms Add-Ons._
_Brought to you by [GravityKit](https://www.gravitykit.com?utm_source=plugin&utm_campaign=zero-spam&utm_content=readme). We create essential Gravity Forms Add-Ons._

== Frequently Asked Questions ==

Expand Down Expand Up @@ -97,6 +97,11 @@ First, **de-activate and re-activate the plugin**. Then let us know on the suppo

== Changelog ==

= 1.2.2 on August 11, 2022 =

* Improved: Prevent autocomplete on the hidden field. This may help prevent some reported false-positives.
* Tested with WordPress 6.0.1

= 1.2.1 on February 16, 2022 =

* Improved: Don't check for spam on the Gravity Forms Preview page
Expand Down

0 comments on commit 2c86cab

Please sign in to comment.