Version Description
(2018-12-28) = * Prevents Contact Form 7 from removing reCaptcha keys upon update. * Removes Contact Form 7 reCaptcha upgrade notice.
Download this release
Release Info
Developer | IQComputing |
Plugin | Contact Form 7 – reCaptcha v2 |
Version | 1.1.0 |
Comparing to | |
See all releases |
Code changes from version 1.0 to 1.1.0
- changelog.txt +8 -0
- readme.txt +8 -3
- wpcf7-recaptcha.php +10 -33
changelog.txt
CHANGED
@@ -2,6 +2,14 @@
|
|
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.0 =
|
6 |
|
7 |
Release Date: December 28, 2018
|
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.1.0 =
|
6 |
+
|
7 |
+
Release Date: December 28, 2018
|
8 |
+
|
9 |
+
* Overview
|
10 |
+
* Prevents Contact Form 7 from removing reCaptcha keys upon update.
|
11 |
+
* Removes Contact Form 7 reCaptcha upgrade notice.
|
12 |
+
|
13 |
= 1.0 =
|
14 |
|
15 |
Release Date: December 28, 2018
|
readme.txt
CHANGED
@@ -3,8 +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.0.2
|
6 |
-
Stable tag: 1.0
|
7 |
-
Requires PHP: 7.2
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -14,6 +13,8 @@ Adds reCaptcha v2 from Contact Form 7 5.0.5 that was dropped on Contact Form 7 5
|
|
14 |
|
15 |
Contact Form 7 v5.1 dropped support for reCaptcha v2 along with the `[recaptcha]` tag December 2018. This plugin brings that functionality back from Contact Form 7 5.0.5 and re-adds the `[recaptcha]` tag.
|
16 |
|
|
|
|
|
17 |
Once installed and configured it should be the same reCaptcha functionality you are used to in previous versions of Contact Form 7.
|
18 |
|
19 |
== IQComputing ==
|
@@ -27,7 +28,7 @@ Once installed and configured it should be the same reCaptcha functionality you
|
|
27 |
|
28 |
1. Install this (Contact Form 7 - reCaptcha v2) plugin
|
29 |
1. Update Contact Form 7 to the latest version
|
30 |
-
1. Re-add the reCaptcha version 2 API keys. For more information you may read the [Contact Form 7 documentation](https://contactform7.com/recaptcha-v2/ "Contact Form 7 reCaptcha(v2)")
|
31 |
1. Using the left-hand admin navigation in the Contact Form 7 subpages click "reCaptcha Version" (Contact -> reCaptcha Version)
|
32 |
1. Once on the "Contact Form 7 - reCaptcha v2" settings page, select from the select list "reCaptcha Version 2" and click "save"
|
33 |
|
@@ -58,6 +59,10 @@ Should the above be correct, at this point it's time to open a support thread fo
|
|
58 |
|
59 |
== Changelog ==
|
60 |
|
|
|
|
|
|
|
|
|
61 |
= 1.0.0 (2018-12-28) =
|
62 |
* Initial release of plugin.
|
63 |
* Contact Form 7 5.0.5 reCaptcha functionality copied over.
|
3 |
Tags: contact-form-7, contact-form-7-recaptcha, recaptcha, spam
|
4 |
Requires at least: 4.9
|
5 |
Tested up to: 5.0.2
|
6 |
+
Stable tag: 1.1.0
|
|
|
7 |
License: GPLv2 or later
|
8 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
13 |
|
14 |
Contact Form 7 v5.1 dropped support for reCaptcha v2 along with the `[recaptcha]` tag December 2018. This plugin brings that functionality back from Contact Form 7 5.0.5 and re-adds the `[recaptcha]` tag.
|
15 |
|
16 |
+
If this plugin is installed before updating Contact Form 7 from v5.0.5 to v5.1.1 then it will carry over your old API keys. At that point you will just need to head to this plugins settings page to tell the website to use reCaptcha v2.
|
17 |
+
|
18 |
Once installed and configured it should be the same reCaptcha functionality you are used to in previous versions of Contact Form 7.
|
19 |
|
20 |
== IQComputing ==
|
28 |
|
29 |
1. Install this (Contact Form 7 - reCaptcha v2) plugin
|
30 |
1. Update Contact Form 7 to the latest version
|
31 |
+
1. Re-add the reCaptcha version 2 API keys (if no keys are currently set). For more information you may read the [Contact Form 7 documentation](https://contactform7.com/recaptcha-v2/ "Contact Form 7 reCaptcha(v2)")
|
32 |
1. Using the left-hand admin navigation in the Contact Form 7 subpages click "reCaptcha Version" (Contact -> reCaptcha Version)
|
33 |
1. Once on the "Contact Form 7 - reCaptcha v2" settings page, select from the select list "reCaptcha Version 2" and click "save"
|
34 |
|
59 |
|
60 |
== Changelog ==
|
61 |
|
62 |
+
= 1.1.0 (2018-12-28) =
|
63 |
+
* Prevents Contact Form 7 from removing reCaptcha keys upon update.
|
64 |
+
* Removes Contact Form 7 reCaptcha upgrade notice.
|
65 |
+
|
66 |
= 1.0.0 (2018-12-28) =
|
67 |
* Initial release of plugin.
|
68 |
* Contact Form 7 5.0.5 reCaptcha functionality copied over.
|
wpcf7-recaptcha.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Plugin Name: Contact Form 7 - reCaptcha v2
|
4 |
* Description: ReCaptcha v2 Fix for Contact Form 7 5.1 and later.
|
5 |
-
* Version: 1.0
|
6 |
* Author: IQComputing
|
7 |
* Author URI: http://www.iqcomputing.com/
|
8 |
* License: GPL2
|
@@ -19,7 +19,7 @@ defined( 'ABSPATH' ) or die( 'You cannot be here.' );
|
|
19 |
*/
|
20 |
Class IQFix_WPCF7_Deity {
|
21 |
|
22 |
-
public static $version = '1.
|
23 |
|
24 |
|
25 |
/**
|
@@ -45,6 +45,9 @@ Class IQFix_WPCF7_Deity {
|
|
45 |
|
46 |
$selection = WPCF7::get_option( 'iqfix_recaptcha' );
|
47 |
|
|
|
|
|
|
|
48 |
if( empty( $selection ) || version_compare( WPCF7_VERSION, '5.1', '<' ) ) {
|
49 |
return;
|
50 |
}
|
@@ -174,40 +177,14 @@ add_action( 'plugins_loaded', 'iqfix_wpcf7_deity_init' );
|
|
174 |
|
175 |
|
176 |
/**
|
177 |
-
*
|
178 |
-
*
|
179 |
-
* @source https://wordpress.stackexchange.com/a/131447/7355
|
180 |
-
* @author https://wordpress.stackexchange.com/users/44420/kosinix
|
181 |
*
|
182 |
* @return void
|
183 |
*/
|
184 |
-
function
|
185 |
|
186 |
-
|
187 |
-
return;
|
188 |
-
}
|
189 |
|
190 |
-
if( ! is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) {
|
191 |
-
|
192 |
-
deactivate_plugins( plugin_basename( __FILE__ ) );
|
193 |
-
add_action( 'admin_notices', 'iqfix_wpcf7_dependency_notice_html' );
|
194 |
-
|
195 |
-
}
|
196 |
-
|
197 |
}
|
198 |
-
add_action( 'admin_init', '
|
199 |
-
|
200 |
-
|
201 |
-
/**
|
202 |
-
* Dependency Notice Callback
|
203 |
-
*
|
204 |
-
* @return void
|
205 |
-
*/
|
206 |
-
function iqfix_wpcf7_dependency_notice_html() {
|
207 |
-
|
208 |
-
printf(
|
209 |
-
'<div class="notice error"><p>%1$s</p></div>',
|
210 |
-
esc_html__( 'The Contact Form 7 plugin is required for Contact Form 7 - reCaptcha v2 plugin to run. Please install and activate Contact Form 7 before activating the Contact Form 7 - ReCaptcha v2 plugin.', 'iqc' )
|
211 |
-
);
|
212 |
-
|
213 |
-
}
|
2 |
/**
|
3 |
* Plugin Name: Contact Form 7 - reCaptcha v2
|
4 |
* Description: ReCaptcha v2 Fix for Contact Form 7 5.1 and later.
|
5 |
+
* Version: 1.1.0
|
6 |
* Author: IQComputing
|
7 |
* Author URI: http://www.iqcomputing.com/
|
8 |
* License: GPL2
|
19 |
*/
|
20 |
Class IQFix_WPCF7_Deity {
|
21 |
|
22 |
+
public static $version = '1.1.0';
|
23 |
|
24 |
|
25 |
/**
|
45 |
|
46 |
$selection = WPCF7::get_option( 'iqfix_recaptcha' );
|
47 |
|
48 |
+
// Prevent update from v2 to v3 notice.
|
49 |
+
WPCF7::update_option( 'recaptcha_v2_v3_warning', false );
|
50 |
+
|
51 |
if( empty( $selection ) || version_compare( WPCF7_VERSION, '5.1', '<' ) ) {
|
52 |
return;
|
53 |
}
|
177 |
|
178 |
|
179 |
/**
|
180 |
+
* Remove upgrade notice from v2 to v3
|
181 |
+
* Prevent api keys from being reset.
|
|
|
|
|
182 |
*
|
183 |
* @return void
|
184 |
*/
|
185 |
+
function iqfix_wpcf7_upgrade_recaptcha_v2_v3_removal() {
|
186 |
|
187 |
+
remove_action( 'wpcf7_upgrade', 'wpcf7_upgrade_recaptcha_v2_v3', 10 );
|
|
|
|
|
188 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
}
|
190 |
+
add_action( 'admin_init', 'iqfix_wpcf7_upgrade_recaptcha_v2_v3_removal', 9 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|