Contact Form 7 – reCaptcha v2 - Version 1.3.6

Version Description

(2021-11-29) = * Resolved conflict with Conditional Fields for Contact Form 7.

Download this release

Release Info

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

Code changes from version 1.3.5 to 1.3.6

Files changed (4) hide show
  1. changelog.txt +11 -0
  2. readme.txt +7 -8
  3. recaptcha-v2.php +23 -1
  4. wpcf7-recaptcha.php +2 -2
changelog.txt CHANGED
@@ -2,6 +2,17 @@
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.3.5 =
6
 
7
  Release Date: June 21, 2021
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.3.6 =
6
+
7
+ Release Date: November 29, 2021
8
+
9
+ * Overview
10
+ * Applied `wpcf7_form_tag` filter to ensure ReCaptcha always has a basic name of "recaptcha".
11
+ This resolves a conflict with Contact Form 7 and Conditionals Fields for Contact Form 7.
12
+ See these threads for more information:
13
+ https://wordpress.org/support/topic/recaptcha-with-conditionals-fields-for-cf7/
14
+ https://wordpress.org/support/topic/custom-tag-not-found/
15
+
16
  = 1.3.5 =
17
 
18
  Release Date: June 21, 2021
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.8
6
- Stable tag: 1.3.5
7
  License: GPLv2 or later
8
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -60,13 +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.3.5 (2020-06-14) =
 
 
 
64
  * Updated support for WordPress 5.8
65
 
66
- = 1.3.4 (2020-06-14) =
67
  * Updated the controls JS file to be encapsulated.
68
- * Added the reCaptcha error messages to the Contact Form 7 "Messages" screen so they may be changed.
69
-
70
- = 1.3.3 (2020-03-01) =
71
- * Updated reCaptcha HTML to be wrapped in span tag as Contact Form 7 expects.
72
- * Updated javascript to reflect HTML change above.
3
  Tags: contact-form-7, contact-form-7-recaptcha, recaptcha, spam
4
  Requires at least: 4.9
5
  Tested up to: 5.8
6
+ Stable tag: 1.3.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.3.6 (2021-11-29) =
64
+ * Resolved conflict with Conditional Fields for Contact Form 7.
65
+
66
+ = 1.3.5 (2021-06-21) =
67
  * Updated support for WordPress 5.8
68
 
69
+ = 1.3.4 (2021-06-14) =
70
  * Updated the controls JS file to be encapsulated.
71
+ * Added the reCaptcha error messages to the Contact Form 7 "Messages" screen so they may be changed.
 
 
 
 
recaptcha-v2.php CHANGED
@@ -595,7 +595,10 @@ add_action( 'wp_enqueue_scripts', 'iqfix_recaptcha_inline_css' );
595
  */
596
  function iqfix_recaptcha_validation( $result, $tag ) {
597
 
598
- $tag->name = 'recaptcha';
 
 
 
599
  if( ! isset( $_POST['g-recaptcha-response'] ) ) {
600
 
601
  $invalidate = wpcf7_get_message( 'iqfix_recaptcha_no_set' );
@@ -621,6 +624,25 @@ add_filter( 'wpcf7_validate_recaptcha', 'iqfix_recaptcha_validation', 10, 2 );
621
  add_filter( 'wpcf7_validate_recaptcha*', 'iqfix_recaptcha_validation', 10, 2 );
622
 
623
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
624
  /**
625
  * Add reCaptcha message settings to Contact Form 7
626
  *
595
  */
596
  function iqfix_recaptcha_validation( $result, $tag ) {
597
 
598
+ if( empty( $tag->name ) ) {
599
+ $tag->name = 'recaptcha';
600
+ }
601
+
602
  if( ! isset( $_POST['g-recaptcha-response'] ) ) {
603
 
604
  $invalidate = wpcf7_get_message( 'iqfix_recaptcha_no_set' );
624
  add_filter( 'wpcf7_validate_recaptcha*', 'iqfix_recaptcha_validation', 10, 2 );
625
 
626
 
627
+ /**
628
+ * Ensure that the reCaptcha has a name
629
+ *
630
+ * @param Array $tag
631
+ *
632
+ * @return Array $tag
633
+ */
634
+ function iqfix_recaptcha_tag_name( $tag ) {
635
+
636
+ if( empty( $tag['name'] ) && 'recaptcha' === $tag['type'] ) {
637
+ $tag['name'] = 'recaptcha';
638
+ }
639
+
640
+ return $tag;
641
+
642
+ }
643
+ add_filter( 'wpcf7_form_tag', 'iqfix_recaptcha_tag_name' );
644
+
645
+
646
  /**
647
  * Add reCaptcha message settings to Contact Form 7
648
  *
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.3.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.3.5';
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.3.6
6
  * Author: IQComputing
7
  * Author URI: http://www.iqcomputing.com/
8
  * License: GPL2
24
  *
25
  * @var String
26
  */
27
+ public static $version = '1.3.6';
28
 
29
 
30
  /**