Contact Form 7 – reCaptcha v2 - Version 1.2.6

Version Description

(2020-04-22) = * Updated reCpatcha Javascript to use the passed event to find the given form.

Download this release

Release Info

Developer IQComputing
Plugin Icon 128x128 Contact Form 7 – reCaptcha v2
Version 1.2.6
Comparing to
See all releases

Code changes from version 1.2.5 to 1.2.6

Files changed (4) hide show
  1. changelog.txt +7 -0
  2. readme.txt +5 -7
  3. recaptcha-v2.php +7 -0
  4. wpcf7-recaptcha.php +2 -2
changelog.txt CHANGED
@@ -2,6 +2,13 @@
2
 
3
  This is to keep track of all changes the plugin undertakes. The readme.txt should only contain the most recent 3.
4
 
 
 
 
 
 
 
 
5
  = 1.2.5 =
6
 
7
  Release Date: April 20, 2020
2
 
3
  This is to keep track of all changes the plugin undertakes. The readme.txt should only contain the most recent 3.
4
 
5
+ = 1.2.6 =
6
+
7
+ Release Date: April 22, 2020
8
+
9
+ * Overview
10
+ * Updated reCaptcha Javascript to use the passed event to find the specific form. This should fix any "2 forms 1 page" issues.
11
+
12
  = 1.2.5 =
13
 
14
  Release Date: April 20, 2020
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: iqcomputing
3
  Tags: contact-form-7, contact-form-7-recaptcha, recaptcha, spam
4
  Requires at least: 4.9
5
  Tested up to: 5.4
6
- Stable tag: 1.2.5
7
  License: GPLv2 or later
8
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -60,14 +60,12 @@ Should the above be correct, at this point it's time to open a support thread fo
60
 
61
  == Changelog ==
62
 
 
 
 
63
  = 1.2.5 (2020-04-20) =
64
  * Updated WordPress Version to denote support for 5.4+
65
 
66
  = 1.2.4 (2019-12-23) =
67
  * Added extra failsafe should CF7 reCaptcha not be removed.
68
- * Added PHP constant checks against the Contact Form 7 consts. Future proofing.
69
-
70
- = 1.2.3 (2019-10-13) =
71
- * Added support for wp-config Contact Form 7 key constants.
72
- * Added support for reCaptcha alignment.
73
- * Fixed an issue with google response logging should the api return an error.
3
  Tags: contact-form-7, contact-form-7-recaptcha, recaptcha, spam
4
  Requires at least: 4.9
5
  Tested up to: 5.4
6
+ Stable tag: 1.2.6
7
  License: GPLv2 or later
8
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
9
 
60
 
61
  == Changelog ==
62
 
63
+ = 1.2.6 (2020-04-22) =
64
+ * Updated reCpatcha Javascript to use the passed event to find the given form.
65
+
66
  = 1.2.5 (2020-04-20) =
67
  * Updated WordPress Version to denote support for 5.4+
68
 
69
  = 1.2.4 (2019-12-23) =
70
  * Added extra failsafe should CF7 reCaptcha not be removed.
71
+ * Added PHP constant checks against the Contact Form 7 consts. Future proofing.
 
 
 
 
 
recaptcha-v2.php CHANGED
@@ -146,8 +146,15 @@ document.addEventListener( 'wpcf7submit', function( event ) {
146
  }, false );
147
 
148
  document.addEventListener( 'wpcf7spam', function( event ) {
 
149
  var wpcf7forms = document.getElementsByClassName( 'wpcf7' );
 
150
  Array.prototype.forEach.call( wpcf7forms, function( form ) {
 
 
 
 
 
151
  var response = form.querySelector( 'input[name="g-recaptcha-response"]' );
152
  var recaptcha = form.querySelector( 'div.wpcf7-recaptcha' );
153
  if( '' === response.value ) {
146
  }, false );
147
 
148
  document.addEventListener( 'wpcf7spam', function( event ) {
149
+
150
  var wpcf7forms = document.getElementsByClassName( 'wpcf7' );
151
+
152
  Array.prototype.forEach.call( wpcf7forms, function( form ) {
153
+
154
+ if( form.getAttribute( 'id' ) != event.target.getAttribute( 'id' ) ) {
155
+ return;
156
+ }
157
+
158
  var response = form.querySelector( 'input[name="g-recaptcha-response"]' );
159
  var recaptcha = form.querySelector( 'div.wpcf7-recaptcha' );
160
  if( '' === response.value ) {
wpcf7-recaptcha.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: ReCaptcha v2 for Contact Form 7
4
  * Description: ReCaptcha v2 Fix for Contact Form 7 5.1 and later.
5
- * Version: 1.2.5
6
  * Author: IQComputing
7
  * Author URI: http://www.iqcomputing.com/
8
  * License: GPL2
@@ -24,7 +24,7 @@ Class IQFix_WPCF7_Deity {
24
  *
25
  * @var String
26
  */
27
- public static $version = '1.2.4';
28
 
29
 
30
  /**
2
  /**
3
  * Plugin Name: ReCaptcha v2 for Contact Form 7
4
  * Description: ReCaptcha v2 Fix for Contact Form 7 5.1 and later.
5
+ * Version: 1.2.6
6
  * Author: IQComputing
7
  * Author URI: http://www.iqcomputing.com/
8
  * License: GPL2
24
  *
25
  * @var String
26
  */
27
+ public static $version = '1.2.6';
28
 
29
 
30
  /**