Contact Form 7 Honeypot - Version 1.3

Version Description

Update to improve outputted HTML for better standards compliance when the same form appears multiple times on the same page.

Download this release

Release Info

Developer DaoByDesign
Plugin Icon 128x128 Contact Form 7 Honeypot
Version 1.3
Comparing to
See all releases

Code changes from version 1.2 to 1.3

Files changed (2) hide show
  1. honeypot.php +5 -5
  2. readme.txt +3 -1
honeypot.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.daobydesign.com/free-plugins/honeypot-module-for-contact-
5
  Description: Add honeypot functionality to the popular Contact Form 7 plugin.
6
  Author: Dao By Design
7
  Author URI: http://www.daobydesign.com
8
- Version: 1.2
9
  */
10
 
11
  /* Copyright 2013 Dao By Design (email : info@daobydesign.com)
@@ -74,11 +74,11 @@ function wpcf7_honeypot_shortcode_handler( $tag ) {
74
  if ( is_a( $wpcf7_contact_form, 'WPCF7_ContactForm' ) )
75
  $validation_error = $wpcf7_contact_form->validation_error( $name );
76
 
77
- $html = '<label for="email-wpcf7-hp"><small>'.__('Leave this field empty.','wpcf7_honeypot').'</small></label>
78
- <input class="wpcf7-text" type="text" name="email-wpcf7-hp" id="email-wpcf7-hp" value="" size="40" tabindex="3" />';
79
 
80
 
81
- $html = '<span class="wpcf7-form-control-wrap hidden' . $name . '" style="display:none;">' . $html . $validation_error . '</span>';
82
 
83
  return $html;
84
  }
@@ -95,7 +95,7 @@ function wpcf7_honeypot_filter ($result, $tag) {
95
  $name = $tag['name'];
96
 
97
 
98
- $honeypot = $_POST['email-wpcf7-hp'];
99
  if ( $honeypot != '' ) {
100
  $result['valid'] = false;
101
  //$result['reason'][$name] = wpcf7_get_message( 'Apologies, there was a problem with your submission.' );
5
  Description: Add honeypot functionality to the popular Contact Form 7 plugin.
6
  Author: Dao By Design
7
  Author URI: http://www.daobydesign.com
8
+ Version: 1.3
9
  */
10
 
11
  /* Copyright 2013 Dao By Design (email : info@daobydesign.com)
74
  if ( is_a( $wpcf7_contact_form, 'WPCF7_ContactForm' ) )
75
  $validation_error = $wpcf7_contact_form->validation_error( $name );
76
 
77
+ $html = '<label for="wpcf7-' . $name . '"><small>'.__('Leave this field empty.','wpcf7_honeypot').'</small></label>
78
+ <input class="wpcf7-form-control wpcf7-text wpcf7-' . $name . '" type="text" name="wpcf7-' . $name . '" value="" size="40" tabindex="-1" />';
79
 
80
 
81
+ $html = '<span class="wpcf7-form-control-wrap ' . $name . '-wrap" style="display:none !important;visibility:hidden !important;">' . $html . $validation_error . '</span>';
82
 
83
  return $html;
84
  }
95
  $name = $tag['name'];
96
 
97
 
98
+ $honeypot = $_POST['wpcf7-' . $name];
99
  if ( $honeypot != '' ) {
100
  $result['valid'] = false;
101
  //$result['reason'][$name] = wpcf7_get_message( 'Apologies, there was a problem with your submission.' );
readme.txt CHANGED
@@ -1,7 +1,7 @@
1
  === Contact Form 7 Honeypot ===
2
  Tags: honeypot, antispam, captcha, spam, form, forms, contact form 7, contactform7, contact form, cf7, cforms, Contact Forms 7, Contact Forms, contacts
3
  Requires at least: 2.8
4
- Tested up to: 3.6.1
5
  Stable tag: trunk
6
  Contributors: DaoByDesign
7
  Donate link: http://www.daobydesign.com/buy-us-a-coffee/
@@ -41,6 +41,8 @@ Visit the <a href="http://www.daobydesign.com/free-plugins/honeypot-module-for-c
41
  * This plugin is released under a GPL license.
42
 
43
  == Changelog ==
 
 
44
 
45
  = 1.2 =
46
  Small update to add better i18n and WPML compatibility.
1
  === Contact Form 7 Honeypot ===
2
  Tags: honeypot, antispam, captcha, spam, form, forms, contact form 7, contactform7, contact form, cf7, cforms, Contact Forms 7, Contact Forms, contacts
3
  Requires at least: 2.8
4
+ Tested up to: 3.7.1
5
  Stable tag: trunk
6
  Contributors: DaoByDesign
7
  Donate link: http://www.daobydesign.com/buy-us-a-coffee/
41
  * This plugin is released under a GPL license.
42
 
43
  == Changelog ==
44
+ = 1.3 =
45
+ Update to improve outputted HTML for better standards compliance when the same form appears multiple times on the same page.
46
 
47
  = 1.2 =
48
  Small update to add better i18n and WPML compatibility.