Version Description
- Warning: Probably you will need to do a new translations
- New: Possibility to set language of Google reCAPTCHA
- Other minor changes
Download this release
Release Info
Developer | Minor |
Plugin | Simple Google reCAPTCHA |
Version | 1.9 |
Comparing to | |
See all releases |
Code changes from version 1.8 to 1.9
- languages/sgr-cs_CZ.mo +0 -0
- languages/sgr-cs_CZ.po +0 -114
- languages/sgr.pot +0 -107
- readme.txt +8 -3
- simple-google-recaptcha.php +25 -18
languages/sgr-cs_CZ.mo
DELETED
Binary file
|
languages/sgr-cs_CZ.po
DELETED
@@ -1,114 +0,0 @@
|
|
1 |
-
msgid ""
|
2 |
-
msgstr ""
|
3 |
-
"Project-Id-Version: Simple Google reCAPTCHA\n"
|
4 |
-
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date: 2016-12-19 22:11+0000\n"
|
6 |
-
"PO-Revision-Date: 2016-12-19 22:13+0000\n"
|
7 |
-
"Last-Translator: Michal <wordpress@csy.cz>\n"
|
8 |
-
"Language-Team: Czech\n"
|
9 |
-
"Language: cs-CZ\n"
|
10 |
-
"Plural-Forms: nplurals=3; plural=( n == 1 ) ? 0 : ( n >= 2 && n <= 4 ) ? 1 : "
|
11 |
-
"2\n"
|
12 |
-
"MIME-Version: 1.0\n"
|
13 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
14 |
-
"Content-Transfer-Encoding: 8bit\n"
|
15 |
-
"X-Poedit-SourceCharset: UTF-8\n"
|
16 |
-
"X-Poedit-Basepath: .\n"
|
17 |
-
"X-Poedit-SearchPath-0: ..\n"
|
18 |
-
"X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;"
|
19 |
-
"__:1;_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
|
20 |
-
"_x:1,2c;_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;"
|
21 |
-
"esc_attr__:1;esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;"
|
22 |
-
"esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
|
23 |
-
"X-Generator: Loco - https://localise.biz/\n"
|
24 |
-
"X-Loco-Target-Locale: cs_CZ"
|
25 |
-
|
26 |
-
#: simple-google-recaptcha.php:38
|
27 |
-
msgid "Disable reCAPTCHA for comments"
|
28 |
-
msgstr "Zakázat reCAPTCHA ve formuláři pro komentáře"
|
29 |
-
|
30 |
-
#: simple-google-recaptcha.php:39
|
31 |
-
msgid "Disable reCAPTCHA for login page"
|
32 |
-
msgstr "Zakázat reCAPTCHA ve formuláři pro přihlášení"
|
33 |
-
|
34 |
-
#: simple-google-recaptcha.php:40
|
35 |
-
msgid "Disable reCAPTCHA for registration page"
|
36 |
-
msgstr "Zakázat reCAPTCHA ve formuláři pro registraci"
|
37 |
-
|
38 |
-
#: simple-google-recaptcha.php:41
|
39 |
-
msgid "Disable reCAPTCHA for forgot password page"
|
40 |
-
msgstr "Zakázat reCAPTCHA ve formuláři pro zapomenuté heslo"
|
41 |
-
|
42 |
-
#: simple-google-recaptcha.php:42
|
43 |
-
msgid "Disable reCAPTCHA for BuddyPress registration page"
|
44 |
-
msgstr "Zakázat reCAPTCHA ve formuláři pro registraci přes BuddyPress"
|
45 |
-
|
46 |
-
#: simple-google-recaptcha.php:119 simple-google-recaptcha.php:123
|
47 |
-
msgid "Back"
|
48 |
-
msgstr "Zpět"
|
49 |
-
|
50 |
-
#: simple-google-recaptcha.php:13
|
51 |
-
msgid "Settings"
|
52 |
-
msgstr "Nastavení"
|
53 |
-
|
54 |
-
#: simple-google-recaptcha.php:19
|
55 |
-
msgid "reCAPTCHA Options"
|
56 |
-
msgstr "Nastavení reCAPTCHA"
|
57 |
-
|
58 |
-
#: simple-google-recaptcha.php:34
|
59 |
-
msgid "What first?"
|
60 |
-
msgstr "Co nejdříve?"
|
61 |
-
|
62 |
-
#: simple-google-recaptcha.php:35
|
63 |
-
msgid "Site Key"
|
64 |
-
msgstr "Klíč stránky"
|
65 |
-
|
66 |
-
#: simple-google-recaptcha.php:36
|
67 |
-
msgid "Secret Key"
|
68 |
-
msgstr "Tajný klíč"
|
69 |
-
|
70 |
-
#: simple-google-recaptcha.php:37
|
71 |
-
msgid "Disable reCAPTCHA in comment form for logged in users"
|
72 |
-
msgstr "Zakázat reCAPTCHA ve formuláři pro komentář pro přihlášené uživatele"
|
73 |
-
|
74 |
-
#: simple-google-recaptcha.php:55
|
75 |
-
msgid ""
|
76 |
-
"<p>You have to <a href=\"https://www.google.com/recaptcha/admin\" "
|
77 |
-
"rel=\"external\">register your domain</a> first, get required keys from "
|
78 |
-
"Google and save them bellow.</p>"
|
79 |
-
msgstr ""
|
80 |
-
"<p>Nejprve musíte <a href=\"https://www.google.com/recaptcha/admin\" "
|
81 |
-
"rel=\"external\">zaregistrovat svou doménu</a>, získat potřebné klíče od "
|
82 |
-
"Googlu a nastavit je níže.</p>"
|
83 |
-
|
84 |
-
#: simple-google-recaptcha.php:119
|
85 |
-
msgid "<p><strong>ERROR</strong>: Google reCAPTCHA verification failed.</p>"
|
86 |
-
msgstr "<p><strong>CHYBA</strong>: Selhalo ověření Google reCAPTCHA.</p>"
|
87 |
-
|
88 |
-
#: simple-google-recaptcha.php:123
|
89 |
-
msgid ""
|
90 |
-
"<p><strong>ERROR</strong>: Google reCAPTCHA verification failed. Do you have "
|
91 |
-
"JavaScript enabled?</p>"
|
92 |
-
msgstr ""
|
93 |
-
"<p><strong>CHYBA</strong>: Selhalo ověření Google reCAPTCHA. Máte povolený "
|
94 |
-
"JavaScript?</p>"
|
95 |
-
|
96 |
-
#. Name of the plugin
|
97 |
-
msgid "Simple Google reCAPTCHA"
|
98 |
-
msgstr "Simple Google reCAPTCHA"
|
99 |
-
|
100 |
-
#. Description of the plugin
|
101 |
-
msgid ""
|
102 |
-
"Simply protect your WordPress against spam comments and brute-force attacks, "
|
103 |
-
"thanks to Google reCAPTCHA!"
|
104 |
-
msgstr ""
|
105 |
-
"Jednoduše ochraňte svůj WordPress před spam komentáři a brute-force útoky, "
|
106 |
-
"díky Google reCAPTCHA!"
|
107 |
-
|
108 |
-
#. Author of the plugin
|
109 |
-
msgid "Michal Novák"
|
110 |
-
msgstr "Michal Novák"
|
111 |
-
|
112 |
-
#. Author URI of the plugin
|
113 |
-
msgid "https://www.novami.cz"
|
114 |
-
msgstr "https://www.novami.cz"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
languages/sgr.pot
DELETED
@@ -1,107 +0,0 @@
|
|
1 |
-
#, fuzzy
|
2 |
-
msgid ""
|
3 |
-
msgstr ""
|
4 |
-
"Project-Id-Version: Simple Google reCAPTCHA\n"
|
5 |
-
"Report-Msgid-Bugs-To: \n"
|
6 |
-
"POT-Creation-Date: 2016-12-19 22:11+0000\n"
|
7 |
-
"POT-Revision-Date: Thu Sep 01 2016 22:14:37 GMT+0200\n"
|
8 |
-
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
9 |
-
"Last-Translator: \n"
|
10 |
-
"Language-Team: \n"
|
11 |
-
"Language: \n"
|
12 |
-
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION\n"
|
13 |
-
"MIME-Version: 1.0\n"
|
14 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
15 |
-
"Content-Transfer-Encoding: 8bit\n"
|
16 |
-
"X-Poedit-SourceCharset: UTF-8\n"
|
17 |
-
"X-Poedit-Basepath: .\n"
|
18 |
-
"X-Poedit-SearchPath-0: ..\n"
|
19 |
-
"X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;"
|
20 |
-
"__:1;_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
|
21 |
-
"_x:1,2c;_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;"
|
22 |
-
"esc_attr__:1;esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;"
|
23 |
-
"esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
|
24 |
-
"X-Generator: Loco - https://localise.biz/"
|
25 |
-
|
26 |
-
#: simple-google-recaptcha.php:13
|
27 |
-
msgid "Settings"
|
28 |
-
msgstr ""
|
29 |
-
|
30 |
-
#: simple-google-recaptcha.php:19
|
31 |
-
msgid "reCAPTCHA Options"
|
32 |
-
msgstr ""
|
33 |
-
|
34 |
-
#: simple-google-recaptcha.php:34
|
35 |
-
msgid "What first?"
|
36 |
-
msgstr ""
|
37 |
-
|
38 |
-
#: simple-google-recaptcha.php:35
|
39 |
-
msgid "Site Key"
|
40 |
-
msgstr ""
|
41 |
-
|
42 |
-
#: simple-google-recaptcha.php:36
|
43 |
-
msgid "Secret Key"
|
44 |
-
msgstr ""
|
45 |
-
|
46 |
-
#: simple-google-recaptcha.php:37
|
47 |
-
msgid "Disable reCAPTCHA in comment form for logged in users"
|
48 |
-
msgstr ""
|
49 |
-
|
50 |
-
#: simple-google-recaptcha.php:38
|
51 |
-
msgid "Disable reCAPTCHA for comments"
|
52 |
-
msgstr ""
|
53 |
-
|
54 |
-
#: simple-google-recaptcha.php:39
|
55 |
-
msgid "Disable reCAPTCHA for login page"
|
56 |
-
msgstr ""
|
57 |
-
|
58 |
-
#: simple-google-recaptcha.php:40
|
59 |
-
msgid "Disable reCAPTCHA for registration page"
|
60 |
-
msgstr ""
|
61 |
-
|
62 |
-
#: simple-google-recaptcha.php:41
|
63 |
-
msgid "Disable reCAPTCHA for forgot password page"
|
64 |
-
msgstr ""
|
65 |
-
|
66 |
-
#: simple-google-recaptcha.php:42
|
67 |
-
msgid "Disable reCAPTCHA for BuddyPress registration page"
|
68 |
-
msgstr ""
|
69 |
-
|
70 |
-
#: simple-google-recaptcha.php:55
|
71 |
-
msgid ""
|
72 |
-
"<p>You have to <a href=\"https://www.google.com/recaptcha/admin\" "
|
73 |
-
"rel=\"external\">register your domain</a> first, get required keys from "
|
74 |
-
"Google and save them bellow.</p>"
|
75 |
-
msgstr ""
|
76 |
-
|
77 |
-
#: simple-google-recaptcha.php:119
|
78 |
-
msgid "<p><strong>ERROR</strong>: Google reCAPTCHA verification failed.</p>"
|
79 |
-
msgstr ""
|
80 |
-
|
81 |
-
#: simple-google-recaptcha.php:119 simple-google-recaptcha.php:123
|
82 |
-
msgid "Back"
|
83 |
-
msgstr ""
|
84 |
-
|
85 |
-
#: simple-google-recaptcha.php:123
|
86 |
-
msgid ""
|
87 |
-
"<p><strong>ERROR</strong>: Google reCAPTCHA verification failed. Do you have "
|
88 |
-
"JavaScript enabled?</p>"
|
89 |
-
msgstr ""
|
90 |
-
|
91 |
-
#. Name of the plugin
|
92 |
-
msgid "Simple Google reCAPTCHA"
|
93 |
-
msgstr ""
|
94 |
-
|
95 |
-
#. Description of the plugin
|
96 |
-
msgid ""
|
97 |
-
"Simply protect your WordPress against spam comments and brute-force attacks, "
|
98 |
-
"thanks to Google reCAPTCHA!"
|
99 |
-
msgstr ""
|
100 |
-
|
101 |
-
#. Author of the plugin
|
102 |
-
msgid "Michal Novák"
|
103 |
-
msgstr ""
|
104 |
-
|
105 |
-
#. Author URI of the plugin
|
106 |
-
msgid "https://www.novami.cz"
|
107 |
-
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -2,15 +2,15 @@
|
|
2 |
Contributors: Minor
|
3 |
Tags: recaptcha, spam, block, captcha, bots, brute-force, protect, comments, secure, admin, attack, buddypress, registration
|
4 |
Requires at least: 4.2.0
|
5 |
-
Tested up to: 4.7
|
6 |
-
Stable tag: 1.
|
7 |
License: GPLv3
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
10 |
Simply protect your WordPress against spam comments and brute-force attacks, thanks to Google reCAPTCHA!
|
11 |
|
12 |
== Description ==
|
13 |
-
Simple Google reCAPTCHA will protect your WordPress! No more spam comments and brute-force attacks against user accounts. Really lightweight plugin - just
|
14 |
|
15 |
= What is protected with Google reCAPTCHA? =
|
16 |
* Comment form
|
@@ -40,6 +40,11 @@ Just pure protection - no ads and any other unnecessary changes in the WordPress
|
|
40 |
5. Simple Google reCAPTCHA - Settings
|
41 |
|
42 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
43 |
= 1.8 =
|
44 |
* New: reCAPTCHA verification on the BuddyPress registration page
|
45 |
* Bugfix: Translatable back button "Zpět"
|
2 |
Contributors: Minor
|
3 |
Tags: recaptcha, spam, block, captcha, bots, brute-force, protect, comments, secure, admin, attack, buddypress, registration
|
4 |
Requires at least: 4.2.0
|
5 |
+
Tested up to: 4.7.2
|
6 |
+
Stable tag: 1.9
|
7 |
License: GPLv3
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
10 |
Simply protect your WordPress against spam comments and brute-force attacks, thanks to Google reCAPTCHA!
|
11 |
|
12 |
== Description ==
|
13 |
+
Simple Google reCAPTCHA will protect your WordPress! No more spam comments and brute-force attacks against user accounts. Really lightweight plugin - just few KB's to download!
|
14 |
|
15 |
= What is protected with Google reCAPTCHA? =
|
16 |
* Comment form
|
40 |
5. Simple Google reCAPTCHA - Settings
|
41 |
|
42 |
== Changelog ==
|
43 |
+
= 1.9 =
|
44 |
+
* Warning: Probably you will need to do a new translations
|
45 |
+
* New: Possibility to set language of Google reCAPTCHA
|
46 |
+
* Other minor changes
|
47 |
+
|
48 |
= 1.8 =
|
49 |
* New: reCAPTCHA verification on the BuddyPress registration page
|
50 |
* Bugfix: Translatable back button "Zpět"
|
simple-google-recaptcha.php
CHANGED
@@ -2,21 +2,22 @@
|
|
2 |
/*
|
3 |
* Plugin Name: Simple Google reCAPTCHA
|
4 |
* Description: Simply protect your WordPress against spam comments and brute-force attacks, thanks to Google reCAPTCHA!
|
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 sgr_add_plugin_action_links($links) {
|
13 |
-
return array_merge(array("settings" => "<a href=\"options-general.php?page=sgr-options\">".__("Settings", "
|
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", "
|
20 |
<form method=\"post\" action=\"options.php\">";
|
21 |
settings_fields("sgr_header_section");
|
22 |
do_settings_sections("sgr-options");
|
@@ -31,18 +32,20 @@ function sgr_menu() {
|
|
31 |
add_action("admin_menu", "sgr_menu");
|
32 |
|
33 |
function sgr_display_options() {
|
34 |
-
add_settings_section("sgr_header_section", __("What first?", "
|
35 |
-
add_settings_field("sgr_site_key", __("Site Key", "
|
36 |
-
add_settings_field("sgr_secret_key", __("Secret Key", "
|
37 |
-
add_settings_field("
|
38 |
-
add_settings_field("
|
39 |
-
add_settings_field("
|
40 |
-
add_settings_field("
|
41 |
-
add_settings_field("
|
42 |
-
add_settings_field("
|
|
|
43 |
|
44 |
register_setting("sgr_header_section", "sgr_site_key");
|
45 |
register_setting("sgr_header_section", "sgr_secret_key");
|
|
|
46 |
register_setting("sgr_header_section", "sgr_logged_users_comments_disable");
|
47 |
register_setting("sgr_header_section", "sgr_comment_form_disable");
|
48 |
register_setting("sgr_header_section", "sgr_login_form_disable");
|
@@ -52,7 +55,7 @@ function sgr_display_options() {
|
|
52 |
}
|
53 |
|
54 |
function sgr_display_content() {
|
55 |
-
|
56 |
}
|
57 |
|
58 |
function sgr_display_site_key_element() {
|
@@ -63,6 +66,11 @@ function sgr_display_secret_key_element() {
|
|
63 |
echo "<input type=\"text\" name=\"sgr_secret_key\" class=\"regular-text\" id=\"sgr_secret_key\" value=\"".get_option("sgr_secret_key")."\" />";
|
64 |
}
|
65 |
|
|
|
|
|
|
|
|
|
|
|
66 |
function sgr_display_logged_users_comments_disable() {
|
67 |
echo "<input type=\"checkbox\" name=\"sgr_logged_users_comments_disable\" id=\"sgr_logged_users_comments_disable\" value=\"1\" ".checked(1, get_option("sgr_logged_users_comments_disable"), false)." />";
|
68 |
}
|
@@ -90,7 +98,7 @@ function sgr_display_buddy_form_disable() {
|
|
90 |
add_action("admin_init", "sgr_display_options");
|
91 |
|
92 |
function frontend_sgr_script() {
|
93 |
-
wp_register_script("recaptcha", "https://www.google.com/recaptcha/api.js");
|
94 |
wp_enqueue_script("recaptcha");
|
95 |
$plugin_url = plugin_dir_url(__FILE__);
|
96 |
wp_enqueue_style("style", $plugin_url."style.css");
|
@@ -117,12 +125,12 @@ function sgr_verify($input) {
|
|
117 |
if ($response["success"] == true) {
|
118 |
return $input;
|
119 |
} else {
|
120 |
-
wp_die(
|
121 |
return null;
|
122 |
}
|
123 |
|
124 |
} else {
|
125 |
-
wp_die(
|
126 |
return null;
|
127 |
}
|
128 |
}
|
@@ -145,7 +153,6 @@ function sgr_check() {
|
|
145 |
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
146 |
add_action("wp_authenticate_user", "sgr_verify");
|
147 |
}
|
148 |
-
|
149 |
}
|
150 |
|
151 |
if (get_option("sgr_register_form_disable") != "1") {
|
2 |
/*
|
3 |
* Plugin Name: Simple Google reCAPTCHA
|
4 |
* Description: Simply protect your WordPress against spam comments and brute-force attacks, thanks to Google reCAPTCHA!
|
5 |
+
* Version: 1.9
|
6 |
* Author: Michal Novák
|
7 |
* Author URI: https://www.novami.cz
|
8 |
* License: GPL3
|
9 |
+
* Text Domain: simple-google-recaptcha
|
10 |
+
* Domain Path: /languages
|
11 |
*/
|
12 |
|
13 |
function sgr_add_plugin_action_links($links) {
|
14 |
+
return array_merge(array("settings" => "<a href=\"options-general.php?page=sgr-options\">".__("Settings", "simple-google-recaptcha")."</a>"), $links);
|
15 |
}
|
16 |
add_filter("plugin_action_links_".plugin_basename(__FILE__), "sgr_add_plugin_action_links");
|
17 |
|
18 |
function sgr_options_page() {
|
19 |
echo "<div class=\"wrap\">
|
20 |
+
<h1>".__("reCAPTCHA Options", "simple-google-recaptcha")."</h1>
|
21 |
<form method=\"post\" action=\"options.php\">";
|
22 |
settings_fields("sgr_header_section");
|
23 |
do_settings_sections("sgr-options");
|
32 |
add_action("admin_menu", "sgr_menu");
|
33 |
|
34 |
function sgr_display_options() {
|
35 |
+
add_settings_section("sgr_header_section", __("What first?", "simple-google-recaptcha"), "sgr_display_content", "sgr-options");
|
36 |
+
add_settings_field("sgr_site_key", __("Site Key", "simple-google-recaptcha"), "sgr_display_site_key_element", "sgr-options", "sgr_header_section");
|
37 |
+
add_settings_field("sgr_secret_key", __("Secret Key", "simple-google-recaptcha"), "sgr_display_secret_key_element", "sgr-options", "sgr_header_section");
|
38 |
+
add_settings_field("sgr_language", __("Language", "simple-google-recaptcha"), "sgr_display_language_element", "sgr-options", "sgr_header_section");
|
39 |
+
add_settings_field("sgr_logged_users_comments_disable", __("Disable reCAPTCHA in comment form for logged in users", "simple-google-recaptcha"), "sgr_display_logged_users_comments_disable", "sgr-options", "sgr_header_section");
|
40 |
+
add_settings_field("sgr_comment_form_disable", __("Disable reCAPTCHA for comments", "simple-google-recaptcha"), "sgr_display_comment_form_disable", "sgr-options", "sgr_header_section");
|
41 |
+
add_settings_field("sgr_login_form_disable", __("Disable reCAPTCHA for login page", "simple-google-recaptcha"), "sgr_display_login_form_disable", "sgr-options", "sgr_header_section");
|
42 |
+
add_settings_field("sgr_register_form_disable", __("Disable reCAPTCHA for registration page", "simple-google-recaptcha"), "sgr_display_register_form_disable", "sgr-options", "sgr_header_section");
|
43 |
+
add_settings_field("sgr_forgot_form_disable", __("Disable reCAPTCHA for forgot password page", "simple-google-recaptcha"), "sgr_display_forgot_form_disable", "sgr-options", "sgr_header_section");
|
44 |
+
add_settings_field("sgr_buddy_form_disable", __("Disable reCAPTCHA for BuddyPress registration page", "simple-google-recaptcha"), "sgr_display_buddy_form_disable", "sgr-options", "sgr_header_section");
|
45 |
|
46 |
register_setting("sgr_header_section", "sgr_site_key");
|
47 |
register_setting("sgr_header_section", "sgr_secret_key");
|
48 |
+
register_setting("sgr_header_section", "sgr_language");
|
49 |
register_setting("sgr_header_section", "sgr_logged_users_comments_disable");
|
50 |
register_setting("sgr_header_section", "sgr_comment_form_disable");
|
51 |
register_setting("sgr_header_section", "sgr_login_form_disable");
|
55 |
}
|
56 |
|
57 |
function sgr_display_content() {
|
58 |
+
_e("<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>", "simple-google-recaptcha");
|
59 |
}
|
60 |
|
61 |
function sgr_display_site_key_element() {
|
66 |
echo "<input type=\"text\" name=\"sgr_secret_key\" class=\"regular-text\" id=\"sgr_secret_key\" value=\"".get_option("sgr_secret_key")."\" />";
|
67 |
}
|
68 |
|
69 |
+
function sgr_display_language_element() {
|
70 |
+
echo "<input type=\"text\" name=\"sgr_language\" class=\"small-text\" maxlength=\"5\" id=\"sgr_language\" value=\"".get_option("sgr_language")."\" />
|
71 |
+
<span>".__("Empty = autodetect", "simple-google-recaptcha")." - <a href=\"https://developers.google.com/recaptcha/docs/language\">".__("Language Codes", "simple-google-recaptcha")."</a></span>";
|
72 |
+
}
|
73 |
+
|
74 |
function sgr_display_logged_users_comments_disable() {
|
75 |
echo "<input type=\"checkbox\" name=\"sgr_logged_users_comments_disable\" id=\"sgr_logged_users_comments_disable\" value=\"1\" ".checked(1, get_option("sgr_logged_users_comments_disable"), false)." />";
|
76 |
}
|
98 |
add_action("admin_init", "sgr_display_options");
|
99 |
|
100 |
function frontend_sgr_script() {
|
101 |
+
wp_register_script("recaptcha", "https://www.google.com/recaptcha/api.js?hl=".get_option("sgr_language"));
|
102 |
wp_enqueue_script("recaptcha");
|
103 |
$plugin_url = plugin_dir_url(__FILE__);
|
104 |
wp_enqueue_style("style", $plugin_url."style.css");
|
125 |
if ($response["success"] == true) {
|
126 |
return $input;
|
127 |
} else {
|
128 |
+
wp_die("<p><strong>".__("ERROR:", "simple-google-recaptcha")."</strong> ".__("Google reCAPTCHA verification failed.", "simple-google-recaptcha")."</p>\n\n<p><a href=".wp_get_referer().">« ".__("Back", "simple-google-recaptcha")."</a>");
|
129 |
return null;
|
130 |
}
|
131 |
|
132 |
} else {
|
133 |
+
wp_die("<p><strong>".__("ERROR:", "simple-google-recaptcha")."</strong> ".__("Google reCAPTCHA verification failed.", "simple-google-recaptcha")." ".__("Do you have JavaScript enabled?", "simple-google-recaptcha")."</p>\n\n<p><a href=".wp_get_referer().">« ".__("Back", "simple-google-recaptcha")."</a>");
|
134 |
return null;
|
135 |
}
|
136 |
}
|
153 |
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
154 |
add_action("wp_authenticate_user", "sgr_verify");
|
155 |
}
|
|
|
156 |
}
|
157 |
|
158 |
if (get_option("sgr_register_form_disable") != "1") {
|