Version Description
- Added "Settings" button to WordPress plugins page
- reCAPTCHA is required only after filled in settings
- Text domain were changed from simple-google-recaptcha to sgr - need to set up keys again
Download this release
Release Info
Developer | Minor |
Plugin | Simple Google reCAPTCHA |
Version | 1.3 |
Comparing to | |
See all releases |
Code changes from version 1.2 to 1.3
languages/sgr-cs_CZ.mo
ADDED
Binary file
|
languages/{simple-google-recaptcha-cs_CZ.po → sgr-cs_CZ.po}
RENAMED
@@ -2,8 +2,8 @@ msgid ""
|
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Simple Google reCAPTCHA\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date: Thu
|
6 |
-
"PO-Revision-Date:
|
7 |
"Last-Translator: Minor <blog@novami.cz>\n"
|
8 |
"Language-Team: \n"
|
9 |
"Language: Czech\n"
|
@@ -24,20 +24,12 @@ msgstr ""
|
|
24 |
"X-Loco-Target-Locale: cs_CZ"
|
25 |
|
26 |
#. Description of the plugin
|
27 |
-
msgid "Simply protect your WordPress from spam, thanks to Google reCAPTCHA!"
|
28 |
-
msgstr "Jednoduše ochraňte svůj WordPress před spamem, díky Google reCAPTCHA!"
|
29 |
-
|
30 |
-
#: ../simple-google-recaptcha.php:85
|
31 |
-
msgid "<p><strong>ERROR</strong>: Google reCAPTCHA verification failed.</p>"
|
32 |
-
msgstr "<p><strong>CHYBA</strong>: Selhalo ověření Google reCAPTCHA.</p>"
|
33 |
-
|
34 |
-
#: ../simple-google-recaptcha.php:89
|
35 |
msgid ""
|
36 |
-
"
|
37 |
-
"
|
38 |
msgstr ""
|
39 |
-
"
|
40 |
-
"
|
41 |
|
42 |
#. Name of the plugin
|
43 |
msgid "Simple Google reCAPTCHA"
|
@@ -51,32 +43,44 @@ msgstr "Michal Novák"
|
|
51 |
msgid "https://www.novami.cz"
|
52 |
msgstr "https://www.novami.cz"
|
53 |
|
54 |
-
#: ../simple-google-recaptcha.php:
|
|
|
|
|
|
|
|
|
55 |
msgid "reCAPTCHA Options"
|
56 |
msgstr "Nastavení reCAPTCHA"
|
57 |
|
58 |
-
#: ../simple-google-recaptcha.php:
|
59 |
-
msgid "
|
60 |
-
msgstr "
|
61 |
|
62 |
-
#: ../simple-google-recaptcha.php:
|
63 |
msgid "Site Key"
|
64 |
msgstr "Klíč stránky"
|
65 |
|
66 |
-
#: ../simple-google-recaptcha.php:
|
67 |
msgid "Secret Key"
|
68 |
msgstr "Tajný klíč"
|
69 |
|
70 |
-
#: ../simple-google-recaptcha.php:
|
71 |
msgid ""
|
72 |
"<p>You have to <a href=\"https://www.google.com/recaptcha/admin\" "
|
73 |
-
"rel=\"external\">register your domain</a> first
|
74 |
-
"
|
75 |
msgstr ""
|
76 |
"<p>Nejprve musíte <a href=\"https://www.google.com/recaptcha/admin\" "
|
77 |
-
"rel=\"external\">zaregistrovat svou doménu</a
|
78 |
-
"Googlu.</p>"
|
79 |
|
80 |
-
#: ../simple-google-recaptcha.php:
|
81 |
-
msgid "<p>
|
82 |
-
msgstr "<p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Simple Google reCAPTCHA\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: Thu Aug 04 2016 19:45:38 GMT+0200\n"
|
6 |
+
"PO-Revision-Date: Thu Aug 04 2016 21:13:37 GMT+0200\n"
|
7 |
"Last-Translator: Minor <blog@novami.cz>\n"
|
8 |
"Language-Team: \n"
|
9 |
"Language: Czech\n"
|
24 |
"X-Loco-Target-Locale: cs_CZ"
|
25 |
|
26 |
#. Description of the plugin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
msgid ""
|
28 |
+
"Simply protect your WordPress against spam and brute-force attacks, thanks "
|
29 |
+
"to Google reCAPTCHA!"
|
30 |
msgstr ""
|
31 |
+
"Jednoduše ochraňte svůj WordPress před spamem a brute-force útoky, díky "
|
32 |
+
"Google reCAPTCHA!"
|
33 |
|
34 |
#. Name of the plugin
|
35 |
msgid "Simple Google reCAPTCHA"
|
43 |
msgid "https://www.novami.cz"
|
44 |
msgstr "https://www.novami.cz"
|
45 |
|
46 |
+
#: ../simple-google-recaptcha.php:13
|
47 |
+
msgid "Settings"
|
48 |
+
msgstr "Nastavení"
|
49 |
+
|
50 |
+
#: ../simple-google-recaptcha.php:23
|
51 |
msgid "reCAPTCHA Options"
|
52 |
msgstr "Nastavení reCAPTCHA"
|
53 |
|
54 |
+
#: ../simple-google-recaptcha.php:34
|
55 |
+
msgid "What first?"
|
56 |
+
msgstr "Co nejdříve?"
|
57 |
|
58 |
+
#: ../simple-google-recaptcha.php:35
|
59 |
msgid "Site Key"
|
60 |
msgstr "Klíč stránky"
|
61 |
|
62 |
+
#: ../simple-google-recaptcha.php:36
|
63 |
msgid "Secret Key"
|
64 |
msgstr "Tajný klíč"
|
65 |
|
66 |
+
#: ../simple-google-recaptcha.php:43
|
67 |
msgid ""
|
68 |
"<p>You have to <a href=\"https://www.google.com/recaptcha/admin\" "
|
69 |
+
"rel=\"external\">register your domain</a> first, get required keys from Google "
|
70 |
+
"and save them bellow.</p>"
|
71 |
msgstr ""
|
72 |
"<p>Nejprve musíte <a href=\"https://www.google.com/recaptcha/admin\" "
|
73 |
+
"rel=\"external\">zaregistrovat svou doménu</a>, získat potřebné klíče od "
|
74 |
+
"Googlu a nastavit je níže.</p>"
|
75 |
|
76 |
+
#: ../simple-google-recaptcha.php:82
|
77 |
+
msgid "<p><strong>ERROR</strong>: Google reCAPTCHA verification failed.</p>"
|
78 |
+
msgstr "<p><strong>CHYBA</strong>: Selhalo ověření Google reCAPTCHA.</p>"
|
79 |
+
|
80 |
+
#: ../simple-google-recaptcha.php:86
|
81 |
+
msgid ""
|
82 |
+
"<p><strong>ERROR</strong>: Google reCAPTCHA verification failed. Do you have "
|
83 |
+
"JavaScript enabled?</p>"
|
84 |
+
msgstr ""
|
85 |
+
"<p><strong>CHYBA</strong>: Selhalo ověření Google reCAPTCHA. Máte povolený "
|
86 |
+
"JavaScript?</p>"
|
languages/{simple-google-recaptcha.pot → sgr.pot}
RENAMED
@@ -4,8 +4,8 @@ msgid ""
|
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: Simple Google reCAPTCHA\n"
|
6 |
"Report-Msgid-Bugs-To: \n"
|
7 |
-
"POT-Creation-Date: Thu
|
8 |
-
"POT-Revision-Date:
|
9 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
10 |
"Last-Translator: \n"
|
11 |
"Language-Team: \n"
|
@@ -29,7 +29,9 @@ msgid "Simple Google reCAPTCHA"
|
|
29 |
msgstr ""
|
30 |
|
31 |
#. Description of the plugin
|
32 |
-
msgid "
|
|
|
|
|
33 |
msgstr ""
|
34 |
|
35 |
#. Author of the plugin
|
@@ -40,38 +42,38 @@ msgstr ""
|
|
40 |
msgid "https://www.novami.cz"
|
41 |
msgstr ""
|
42 |
|
43 |
-
#: ../simple-google-recaptcha.php:
|
|
|
|
|
|
|
|
|
44 |
msgid "reCAPTCHA Options"
|
45 |
msgstr ""
|
46 |
|
47 |
-
#: ../simple-google-recaptcha.php:
|
48 |
-
msgid "
|
49 |
msgstr ""
|
50 |
|
51 |
-
#: ../simple-google-recaptcha.php:
|
52 |
msgid "Site Key"
|
53 |
msgstr ""
|
54 |
|
55 |
-
#: ../simple-google-recaptcha.php:
|
56 |
msgid "Secret Key"
|
57 |
msgstr ""
|
58 |
|
59 |
-
#: ../simple-google-recaptcha.php:
|
60 |
msgid ""
|
61 |
"<p>You have to <a href=\"https://www.google.com/recaptcha/admin\" "
|
62 |
-
"rel=\"external\">register your domain</a> first
|
63 |
-
"
|
64 |
-
msgstr ""
|
65 |
-
|
66 |
-
#: ../simple-google-recaptcha.php:40
|
67 |
-
msgid "<p>Enter your keys below:</p>"
|
68 |
msgstr ""
|
69 |
|
70 |
-
#: ../simple-google-recaptcha.php:
|
71 |
msgid "<p><strong>ERROR</strong>: Google reCAPTCHA verification failed.</p>"
|
72 |
msgstr ""
|
73 |
|
74 |
-
#: ../simple-google-recaptcha.php:
|
75 |
msgid ""
|
76 |
"<p><strong>ERROR</strong>: Google reCAPTCHA verification failed. Do you have "
|
77 |
"JavaScript enabled?</p>"
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: Simple Google reCAPTCHA\n"
|
6 |
"Report-Msgid-Bugs-To: \n"
|
7 |
+
"POT-Creation-Date: Thu Aug 04 2016 19:45:38 GMT+0200\n"
|
8 |
+
"POT-Revision-Date: Thu Aug 04 2016 21:12:49 GMT+0200\n"
|
9 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
10 |
"Last-Translator: \n"
|
11 |
"Language-Team: \n"
|
29 |
msgstr ""
|
30 |
|
31 |
#. Description of the plugin
|
32 |
+
msgid ""
|
33 |
+
"Simply protect your WordPress against spam and brute-force attacks, thanks "
|
34 |
+
"to Google reCAPTCHA!"
|
35 |
msgstr ""
|
36 |
|
37 |
#. Author of the plugin
|
42 |
msgid "https://www.novami.cz"
|
43 |
msgstr ""
|
44 |
|
45 |
+
#: ../simple-google-recaptcha.php:13
|
46 |
+
msgid "Settings"
|
47 |
+
msgstr ""
|
48 |
+
|
49 |
+
#: ../simple-google-recaptcha.php:23
|
50 |
msgid "reCAPTCHA Options"
|
51 |
msgstr ""
|
52 |
|
53 |
+
#: ../simple-google-recaptcha.php:34
|
54 |
+
msgid "What first?"
|
55 |
msgstr ""
|
56 |
|
57 |
+
#: ../simple-google-recaptcha.php:35
|
58 |
msgid "Site Key"
|
59 |
msgstr ""
|
60 |
|
61 |
+
#: ../simple-google-recaptcha.php:36
|
62 |
msgid "Secret Key"
|
63 |
msgstr ""
|
64 |
|
65 |
+
#: ../simple-google-recaptcha.php:43
|
66 |
msgid ""
|
67 |
"<p>You have to <a href=\"https://www.google.com/recaptcha/admin\" "
|
68 |
+
"rel=\"external\">register your domain</a> first, get required keys from Google "
|
69 |
+
"and save them bellow.</p>"
|
|
|
|
|
|
|
|
|
70 |
msgstr ""
|
71 |
|
72 |
+
#: ../simple-google-recaptcha.php:82
|
73 |
msgid "<p><strong>ERROR</strong>: Google reCAPTCHA verification failed.</p>"
|
74 |
msgstr ""
|
75 |
|
76 |
+
#: ../simple-google-recaptcha.php:86
|
77 |
msgid ""
|
78 |
"<p><strong>ERROR</strong>: Google reCAPTCHA verification failed. Do you have "
|
79 |
"JavaScript enabled?</p>"
|
languages/simple-google-recaptcha-cs_CZ.mo
DELETED
Binary file
|
readme.txt
CHANGED
@@ -1,25 +1,28 @@
|
|
1 |
=== Simple Google reCAPTCHA ===
|
2 |
|
3 |
Contributors: Minor
|
4 |
-
Tags: recaptcha, spam
|
5 |
Requires at least: 4.3.0
|
6 |
Tested up to: 4.5.3
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
11 |
-
Simply protect your WordPress
|
12 |
|
13 |
|
14 |
== Description ==
|
15 |
|
16 |
-
|
17 |
|
18 |
What is protected with Google reCAPTCHA?
|
19 |
|
20 |
1. Comments
|
|
|
21 |
2. New password form
|
|
|
22 |
3. Registration form
|
|
|
23 |
4. Login form
|
24 |
|
25 |
|
@@ -27,29 +30,37 @@ What is protected with Google reCAPTCHA?
|
|
27 |
|
28 |
1. Upload the plugin files to the "/wp-content/plugins/simple-google-recaptcha" directory, or install the plugin through the WordPress plugins screen directly.
|
29 |
|
30 |
-
2. Activate the plugin through the "Plugins" screen in WordPress
|
31 |
|
32 |
-
3. Use the Settings => reCAPTCHA screen to configure the plugin
|
33 |
|
34 |
|
35 |
== Frequently Asked Questions ==
|
36 |
|
37 |
-
=
|
38 |
-
|
39 |
-
No answers yet.
|
40 |
|
41 |
|
42 |
== Screenshots ==
|
43 |
|
44 |
1. Google reCAPTCHA - Add new comment form
|
|
|
45 |
2. Google reCAPTCHA - New password form
|
|
|
46 |
3. Google reCAPTCHA - Registration form
|
|
|
47 |
4. Google reCAPTCHA - Login form
|
|
|
48 |
5. Settings
|
49 |
|
50 |
|
51 |
== Changelog ==
|
52 |
|
|
|
|
|
|
|
|
|
|
|
53 |
= 1.2 =
|
54 |
* Cleaning plugin folder - smaller
|
55 |
|
1 |
=== Simple Google reCAPTCHA ===
|
2 |
|
3 |
Contributors: Minor
|
4 |
+
Tags: recaptcha, spam, block, captcha, bots, brute-force, protect
|
5 |
Requires at least: 4.3.0
|
6 |
Tested up to: 4.5.3
|
7 |
+
Stable tag: 1.3
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
11 |
+
Simply protect your WordPress against spam and brute-force attacks, thanks to Google reCAPTCHA!
|
12 |
|
13 |
|
14 |
== Description ==
|
15 |
|
16 |
+
Simple Google reCAPTCHA will protect your WordPress! No more spam and brute-force attacks against user accounts.
|
17 |
|
18 |
What is protected with Google reCAPTCHA?
|
19 |
|
20 |
1. Comments
|
21 |
+
|
22 |
2. New password form
|
23 |
+
|
24 |
3. Registration form
|
25 |
+
|
26 |
4. Login form
|
27 |
|
28 |
|
30 |
|
31 |
1. Upload the plugin files to the "/wp-content/plugins/simple-google-recaptcha" directory, or install the plugin through the WordPress plugins screen directly.
|
32 |
|
33 |
+
2. Activate the plugin through the "Plugins" screen in WordPress.
|
34 |
|
35 |
+
3. Use the Settings => reCAPTCHA screen to configure the plugin.
|
36 |
|
37 |
|
38 |
== Frequently Asked Questions ==
|
39 |
|
40 |
+
= Why to install this plugin? =
|
41 |
+
Just pure protection no bullshit on the background.
|
|
|
42 |
|
43 |
|
44 |
== Screenshots ==
|
45 |
|
46 |
1. Google reCAPTCHA - Add new comment form
|
47 |
+
|
48 |
2. Google reCAPTCHA - New password form
|
49 |
+
|
50 |
3. Google reCAPTCHA - Registration form
|
51 |
+
|
52 |
4. Google reCAPTCHA - Login form
|
53 |
+
|
54 |
5. Settings
|
55 |
|
56 |
|
57 |
== Changelog ==
|
58 |
|
59 |
+
= 1.3 =
|
60 |
+
* Added "Settings" button to WordPress plugins page
|
61 |
+
* reCAPTCHA is required only after filled in settings
|
62 |
+
* Text domain were changed from simple-google-recaptcha to sgr - need to set up keys again
|
63 |
+
|
64 |
= 1.2 =
|
65 |
* Cleaning plugin folder - smaller
|
66 |
|
simple-google-recaptcha.php
CHANGED
@@ -1,104 +1,109 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
* Plugin Name: Simple Google reCAPTCHA
|
4 |
-
* Description: Simply protect your WordPress
|
5 |
-
* Version: 1.
|
6 |
-
* Author: Michal Novák
|
7 |
-
* Author URI: https://www.novami.cz
|
8 |
-
* License: GPL3
|
9 |
-
* Text Domain:
|
10 |
-
*/
|
11 |
-
|
12 |
-
function
|
13 |
-
|
14 |
-
}
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
<
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
function
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
$
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
return
|
84 |
-
}
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
}
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
add_action("
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* Plugin Name: Simple Google reCAPTCHA
|
4 |
+
* Description: Simply protect your WordPress against spam and brute-force attacks, thanks to Google reCAPTCHA!
|
5 |
+
* Version: 1.3
|
6 |
+
* Author: Michal Novák
|
7 |
+
* Author URI: https://www.novami.cz
|
8 |
+
* License: GPL3
|
9 |
+
* Text Domain: sgr
|
10 |
+
*/
|
11 |
+
|
12 |
+
function sgr_add_plugin_action_links($links) {
|
13 |
+
return array_merge(array("settings" => "<a href=\"options-general.php?page=sgr-options\">".__("Settings", "sgr")."</a>"), $links);
|
14 |
+
}
|
15 |
+
add_filter("plugin_action_links_".plugin_basename(__FILE__), "sgr_add_plugin_action_links");
|
16 |
+
|
17 |
+
function sgr_options_page() {
|
18 |
+
echo "<div class=\"wrap\">
|
19 |
+
<h1>".__("reCAPTCHA Options", "sgr")."</h1>
|
20 |
+
<form method=\"post\" action=\"options.php\">";
|
21 |
+
settings_fields("header_section");
|
22 |
+
do_settings_sections("sgr-options");
|
23 |
+
submit_button();
|
24 |
+
echo "</form>
|
25 |
+
</div>";
|
26 |
+
}
|
27 |
+
|
28 |
+
function sgr_menu() {
|
29 |
+
add_submenu_page("options-general.php", "reCAPTCHA", "reCAPTCHA", "manage_options", "sgr-options", "sgr_options_page");
|
30 |
+
}
|
31 |
+
add_action("admin_menu", "sgr_menu");
|
32 |
+
|
33 |
+
function display_sgr_options() {
|
34 |
+
add_settings_section("header_section", __("What first?", "sgr"), "display_sgr_content", "sgr-options");
|
35 |
+
add_settings_field("sgr_site_key", __("Site Key", "sgr"), "display_sgr_site_key_element", "sgr-options", "header_section");
|
36 |
+
add_settings_field("sgr_secret_key", __("Secret Key", "sgr"), "display_sgr_secret_key_element", "sgr-options", "header_section");
|
37 |
+
|
38 |
+
register_setting("header_section", "sgr_site_key");
|
39 |
+
register_setting("header_section", "sgr_secret_key");
|
40 |
+
}
|
41 |
+
|
42 |
+
function display_sgr_content() {
|
43 |
+
echo __("<p>You have to <a href=\"https://www.google.com/recaptcha/admin\" rel=\"external\">register your domain</a> first, get required keys from Google and save them bellow.</p>", "sgr");
|
44 |
+
}
|
45 |
+
|
46 |
+
function display_sgr_site_key_element() {
|
47 |
+
echo "<input type=\"text\" name=\"sgr_site_key\" class=\"regular-text\" id=\"sgr_site_key\" value=\"".get_option("sgr_site_key")."\" />";
|
48 |
+
}
|
49 |
+
|
50 |
+
function display_sgr_secret_key_element() {
|
51 |
+
echo "<input type=\"text\" name=\"sgr_secret_key\" class=\"regular-text\" id=\"sgr_secret_key\" value=\"".get_option("sgr_secret_key")."\" />";
|
52 |
+
}
|
53 |
+
add_action("admin_init", "display_sgr_options");
|
54 |
+
|
55 |
+
function frontend_sgr_script() {
|
56 |
+
wp_register_script("recaptcha", "https://www.google.com/recaptcha/api.js");
|
57 |
+
wp_enqueue_script("recaptcha");
|
58 |
+
$plugin_url = plugin_dir_url(__FILE__);
|
59 |
+
wp_enqueue_style("style", $plugin_url."style.css");
|
60 |
+
}
|
61 |
+
add_action("wp_enqueue_scripts", "frontend_sgr_script");
|
62 |
+
add_action("login_enqueue_scripts", "frontend_sgr_script");
|
63 |
+
|
64 |
+
function load_language_sgr() {
|
65 |
+
load_plugin_textdomain("sgr", false, dirname(plugin_basename(__FILE__)) . "/languages/");
|
66 |
+
}
|
67 |
+
add_action("plugins_loaded", "load_language_sgr");
|
68 |
+
|
69 |
+
function display_sgr() {
|
70 |
+
echo "<div class=\"g-recaptcha\" data-sitekey=\"".get_option("sgr_site_key")."\"></div>";
|
71 |
+
}
|
72 |
+
|
73 |
+
function verify_sgr($input) {
|
74 |
+
if (isset($_POST["g-recaptcha-response"])) {
|
75 |
+
$recaptcha_response = sanitize_text_field($_POST["g-recaptcha-response"]);
|
76 |
+
$recaptcha_secret = get_option("sgr_secret_key");
|
77 |
+
$response = wp_remote_get("https://www.google.com/recaptcha/api/siteverify?secret=".$recaptcha_secret."&response=".$recaptcha_response);
|
78 |
+
$response = json_decode($response["body"], true);
|
79 |
+
if (true == $response["success"]) {
|
80 |
+
return $input;
|
81 |
+
} else {
|
82 |
+
wp_die(__("<p><strong>ERROR</strong>: Google reCAPTCHA verification failed.</p>", "sgr")."</p>\n\n<p><a href=".wp_get_referer().">« Zpět</a>");
|
83 |
+
return null;
|
84 |
+
}
|
85 |
+
} else {
|
86 |
+
wp_die(__("<p><strong>ERROR</strong>: Google reCAPTCHA verification failed. Do you have JavaScript enabled?</p>", "sgr")."</p>\n\n<p><a href=".wp_get_referer().">« Zpět</a>");
|
87 |
+
return null;
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
if (get_option("sgr_site_key") != "" && get_option("sgr_secret_key") != "") {
|
92 |
+
add_action("comment_form_logged_in_after", "display_sgr");
|
93 |
+
add_action("comment_form_after_fields", "display_sgr");
|
94 |
+
add_action("login_form", "display_sgr" );
|
95 |
+
add_action("register_form", "display_sgr");
|
96 |
+
add_action("lostpassword_form", "display_sgr");
|
97 |
+
|
98 |
+
do_action("preprocess_comment", $commentdata);
|
99 |
+
add_action("preprocess_comment", "verify_sgr");
|
100 |
+
|
101 |
+
do_action("wp_authenticate_user", $user);
|
102 |
+
add_action("wp_authenticate_user", "verify_sgr");
|
103 |
+
|
104 |
+
do_action("registration_errors", $errors);
|
105 |
+
add_action("registration_errors", "verify_sgr");
|
106 |
+
|
107 |
+
do_action("lostpassword_post", $errors);
|
108 |
+
add_action("lostpassword_post", "verify_sgr");
|
109 |
+
}
|