Simple Google reCAPTCHA - Version 2.0

Version Description

  • Warning: reCAPTCHA verification on the BuddyPress registration page has been removed
  • Warning: reCAPTCHA verification on the Add new comment form for logged in users has been removed
  • Warning: Due to keep Simple Google Recaptcha as simple as possible some configuration options were removed
  • New: Language settings of reCAPTCHA is based on WordPress locale now
  • New: Default WordPress submit buttons are disabled until reCAPTCHA isn't solved
  • New: Added reCAPTCHA for Resset password form
  • Update: Text corrections
  • Bugfix: reCAPTCHA verification just on the standard WordPress pages (unmodified by plugins/templates)
Download this release

Release Info

Developer Minor
Plugin Icon 128x128 Simple Google reCAPTCHA
Version 2.0
Comparing to
See all releases

Code changes from version 1.9 to 2.0

Files changed (3) hide show
  1. check.js +10 -0
  2. readme.txt +38 -27
  3. simple-google-recaptcha.php +57 -106
check.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ window.onload = function () {
2
+ button = document.querySelector("[id*='submit']").id;
3
+ document.getElementById(button).disabled = true;
4
+ document.getElementById(button).title = sgr_recaptcha_trans.title;
5
+ }
6
+
7
+ function enableBtn() {
8
+ document.getElementById(button).disabled = false;
9
+ document.getElementById(button).removeAttribute("title");
10
+ }
readme.txt CHANGED
@@ -1,36 +1,37 @@
1
  === Simple Google reCAPTCHA ===
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
17
  * New password form
18
- * Registration form (including BuddyPress)
19
  * Login form
 
20
 
21
  You can choose where reCAPTCHA will be required.
22
 
23
 
24
  == Installation ==
25
- 1. Upload the plugin files to the "/wp-content/plugins/simple-google-recaptcha" directory, or install the plugin through the WordPress plugins screen directly.
26
 
27
- 2. Activate the plugin through the "Plugins" screen in WordPress.
28
 
29
- 3. Use the Settings => reCAPTCHA screen to configure the plugin.
30
 
31
  == Frequently Asked Questions ==
32
  = Why to install this plugin? =
33
- Just pure protection - no ads and any other unnecessary changes in the WordPress core.
34
 
35
  == Screenshots ==
36
  1. Simple Google reCAPTCHA - Add new comment form
@@ -40,41 +41,51 @@ Just pure protection - no ads and any other unnecessary changes in the WordPress
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"
51
 
52
  = 1.7 =
53
- * Bugfix: reCAPCTHA will be required only If the form has been submitted
54
- * You can choose where reCAPTCHA will be required
55
 
56
  = 1.6 =
57
- * Changed name of settings to avoid unwanted cancellation of settings (wasn't unique name of settings for this plugin in database)
58
 
59
  = 1.5 =
60
- * Possibility to disable reCAPTCHA in comment form for logged in users
61
 
62
  = 1.4 =
63
- * Encoding was converted from Windows to Unix
64
- * Little text corrections, English isn't my strong page, sorry :-)
65
 
66
  = 1.3 =
67
- * Added "Settings" button to WordPress plugins page
68
- * reCAPTCHA is required only after filled in settings
69
- * Text domain were changed from simple-google-recaptcha to sgr - need to set up keys again
70
 
71
  = 1.2 =
72
- * Cleaning plugin folder - smaller
73
 
74
  = 1.1 =
75
- * Text correction
76
- * Fixed post comment when user is logged in
77
- * Better screenshots
78
 
79
  = 1.0 =
80
- * Plugin created!
1
  === Simple Google reCAPTCHA ===
2
  Contributors: Minor
3
+ Tags: recaptcha, spam, block, captcha, bots, brute, force, protect, comments, secure, attack, registration, reset, form
4
  Requires at least: 4.2.0
5
  Tested up to: 4.7.2
6
+ Stable tag: 2.0
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 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 KBs to download!
14
 
15
+ = What is protected with reCAPTCHA? =
16
+ * Comment form (doesn't apply to logged-in users)
17
  * New password form
18
+ * Registration form
19
  * Login form
20
+ * Reset password form
21
 
22
  You can choose where reCAPTCHA will be required.
23
 
24
 
25
  == Installation ==
26
+ 1. Upload Simple Google reCAPTCHA files to the "/wp-content/plugins/simple-google-recaptcha" directory, or install Simple Google reCAPTCHA through the WordPress Plugins page directly.
27
 
28
+ 2. Activate Simple Google reCAPTCHA through the WordPress Plugins page.
29
 
30
+ 3. Use the menu Settings => reCAPTCHA to configure Simple Google reCAPTCHA.
31
 
32
  == Frequently Asked Questions ==
33
  = Why to install this plugin? =
34
+ Just pure protection - no ads and any other unnecessary changes.
35
 
36
  == Screenshots ==
37
  1. Simple Google reCAPTCHA - Add new comment form
41
  5. Simple Google reCAPTCHA - Settings
42
 
43
  == Changelog ==
44
+ = 2.0 =
45
+ * Warning: reCAPTCHA verification on the BuddyPress registration page has been removed
46
+ * Warning: reCAPTCHA verification on the Add new comment form for logged in users has been removed
47
+ * Warning: Due to keep Simple Google Recaptcha as simple as possible some configuration options were removed
48
+ * New: Language settings of reCAPTCHA is based on WordPress locale now
49
+ * New: Default WordPress submit buttons are disabled until reCAPTCHA isn't solved
50
+ * New: Added reCAPTCHA for Resset password form
51
+ * Update: Text corrections
52
+ * Bugfix: reCAPTCHA verification just on the standard WordPress pages (unmodified by plugins/templates)
53
+
54
  = 1.9 =
55
  * Warning: Probably you will need to do a new translations
56
+ * New: Possibility to set language of reCAPTCHA
57
+ * Update: Minor updates for easier official translations
58
 
59
  = 1.8 =
60
  * New: reCAPTCHA verification on the BuddyPress registration page
61
  * Bugfix: Translatable back button "Zpět"
62
 
63
  = 1.7 =
64
+ * New: You can choose where reCAPTCHA will be required
65
+ * Bugfix: reCAPTCHA will be required only If a form has been submitted
66
 
67
  = 1.6 =
68
+ * Bugfix: Name of settings has been changed - to avoid conflict with other plugins
69
 
70
  = 1.5 =
71
+ * New: Possibility to disable reCAPTCHA in comment form for logged in users
72
 
73
  = 1.4 =
74
+ * Update: Encoding has been converted from Windows to Unix
75
+ * Update: Text corrections
76
 
77
  = 1.3 =
78
+ * New: Added "Settings" button to WordPress plugins page
79
+ * New: reCAPTCHA is required only after filled in settings
80
+ * Update: Text domain has been changed from simple-google-recaptcha to sgr - need to set up keys again
81
 
82
  = 1.2 =
83
+ * Update: Simple Google reCAPTCHA folder - unnecessary files were deleted
84
 
85
  = 1.1 =
86
+ * Update: Screenshots
87
+ * Update: Text corrections
88
+ * Bugfix: Logged in users are able to post comments
89
 
90
  = 1.0 =
91
+ * New: Simple Google reCAPTCHA has been released!
simple-google-recaptcha.php CHANGED
@@ -2,7 +2,7 @@
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
@@ -31,31 +31,8 @@ function sgr_menu() {
31
  }
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");
52
- register_setting("sgr_header_section", "sgr_register_form_disable");
53
- register_setting("sgr_header_section", "sgr_forgot_form_disable");
54
- register_setting("sgr_header_section", "sgr_buddy_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,117 +43,91 @@ function sgr_display_secret_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
  }
77
 
78
- function sgr_display_comment_form_disable() {
79
- echo "<input type=\"checkbox\" name=\"sgr_comment_form_disable\" id=\"sgr_comment_form_disable\" value=\"1\" ".checked(1, get_option("sgr_comment_form_disable"), false)." />";
80
  }
81
 
82
- function sgr_display_login_form_disable() {
83
- echo "<input type=\"checkbox\" name=\"sgr_login_form_disable\" id=\"sgr_login_form_disable\" value=\"1\" ".checked(1, get_option("sgr_login_form_disable"), false)." />";
84
- }
85
-
86
- function sgr_display_register_form_disable() {
87
- echo "<input type=\"checkbox\" name=\"sgr_register_form_disable\" id=\"sgr_register_form_disable\" value=\"1\" ".checked(1, get_option("sgr_register_form_disable"), false)." />";
88
- }
89
 
90
- function sgr_display_forgot_form_disable() {
91
- echo "<input type=\"checkbox\" name=\"sgr_forgot_form_disable\" id=\"sgr_forgot_form_disable\" value=\"1\" ".checked(1, get_option("sgr_forgot_form_disable"), false)." />";
 
 
92
  }
 
93
 
94
- function sgr_display_buddy_form_disable() {
95
- echo "<input type=\"checkbox\" name=\"sgr_buddy_form_disable\" id=\"sgr_buddy_form_disable\" value=\"1\" ".checked(1, get_option("sgr_buddy_form_disable"), false)." />";
96
  }
97
-
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");
 
 
 
 
105
  }
106
- add_action("wp_enqueue_scripts", "frontend_sgr_script");
107
  add_action("login_enqueue_scripts", "frontend_sgr_script");
108
-
109
- function load_language_sgr() {
110
- load_plugin_textdomain("sgr", false, dirname(plugin_basename(__FILE__)) . "/languages/");
111
- }
112
- add_action("plugins_loaded", "load_language_sgr");
113
 
114
  function sgr_display() {
115
- echo "<div class=\"g-recaptcha\" data-sitekey=\"".get_option("sgr_site_key")."\"></div>";
116
  }
117
 
118
  function sgr_verify($input) {
119
- if (isset($_POST["g-recaptcha-response"])) {
120
- $recaptcha_response = sanitize_text_field($_POST["g-recaptcha-response"]);
121
- $recaptcha_secret = get_option("sgr_secret_key");
122
- $response = wp_remote_get("https://www.google.com/recaptcha/api/siteverify?secret=".$recaptcha_secret."&response=".$recaptcha_response);
123
- $response = json_decode($response["body"], true);
124
-
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().">&laquo; ".__("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().">&laquo; ".__("Back", "simple-google-recaptcha")."</a>");
134
- return null;
135
  }
136
  }
137
 
138
  function sgr_check() {
139
  if (get_option("sgr_site_key") != "" && get_option("sgr_secret_key") != "") {
140
-
141
- if (get_option("sgr_comment_form_disable") != "1" && ((is_user_logged_in() && get_option("sgr_logged_users_comments_disable") != "1") || !is_user_logged_in())) {
142
  add_action("comment_form_after_fields", "sgr_display");
143
- add_action("comment_form_logged_in_after", "sgr_display");
144
-
145
- if ($_SERVER["REQUEST_METHOD"] == "POST") {
146
- add_action("preprocess_comment", "sgr_verify");
147
- }
148
- }
149
-
150
- if (get_option("sgr_login_form_disable") != "1") {
151
- add_action("login_form", "sgr_display" );
152
-
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") {
 
 
 
159
  add_action("register_form", "sgr_display");
160
-
161
- if ($_SERVER["REQUEST_METHOD"] == "POST") {
162
- add_action("registration_errors", "sgr_verify");
163
- }
164
- }
165
-
166
- if (get_option("sgr_forgot_form_disable") != "1") {
167
  add_action("lostpassword_form", "sgr_display");
168
-
169
- if ($_SERVER["REQUEST_METHOD"] == "POST") {
170
- add_action("lostpassword_post", "sgr_verify");
171
- }
172
- }
173
-
174
- if (get_option("sgr_buddy_form_disable") != "1") {
175
- add_action("bp_before_registration_submit_buttons", "sgr_display");
176
-
177
- if ($_SERVER["REQUEST_METHOD"] == "POST") {
178
- add_action("bp_signup_validate", "sgr_verify");
179
- }
180
  }
181
  }
182
  }
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: 2.0
6
  * Author: Michal Nov&aacute;k
7
  * Author URI: https://www.novami.cz
8
  * License: GPL3
31
  }
32
  add_action("admin_menu", "sgr_menu");
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  function sgr_display_content() {
35
+ 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.", "simple-google-recaptcha")."</p>";
36
  }
37
 
38
  function sgr_display_site_key_element() {
43
  echo "<input type=\"text\" name=\"sgr_secret_key\" class=\"regular-text\" id=\"sgr_secret_key\" value=\"".get_option("sgr_secret_key")."\" />";
44
  }
45
 
46
+ function sgr_display_comments_disable() {
47
+ echo "<input type=\"checkbox\" name=\"sgr_comments_disable\" id=\"sgr_comments_disable\" value=\"1\" ".checked(1, get_option("sgr_comments_disable"), false)." />";
 
 
 
 
 
48
  }
49
 
50
+ function sgr_display_forms_disable() {
51
+ echo "<input type=\"checkbox\" name=\"sgr_forms_disable\" id=\"sgr_forms_disable\" value=\"1\" ".checked(1, get_option("sgr_forms_disable"), false)." />";
52
  }
53
 
54
+ function sgr_display_options() {
55
+ add_settings_section("sgr_header_section", __("What first?", "simple-google-recaptcha"), "sgr_display_content", "sgr-options");
56
+
57
+ add_settings_field("sgr_site_key", __("Site Key", "simple-google-recaptcha"), "sgr_display_site_key_element", "sgr-options", "sgr_header_section");
58
+ add_settings_field("sgr_secret_key", __("Secret Key", "simple-google-recaptcha"), "sgr_display_secret_key_element", "sgr-options", "sgr_header_section");
59
+ add_settings_field("sgr_comments_disable", __("Disable reCAPTCHA for comments", "simple-google-recaptcha"), "sgr_display_comments_disable", "sgr-options", "sgr_header_section");
60
+ add_settings_field("sgr_forms_disable", __("Disable reCAPTCHA for basic forms", "simple-google-recaptcha"), "sgr_display_forms_disable", "sgr-options", "sgr_header_section");
61
 
62
+ register_setting("sgr_header_section", "sgr_site_key");
63
+ register_setting("sgr_header_section", "sgr_secret_key");
64
+ register_setting("sgr_header_section", "sgr_comments_disable");
65
+ register_setting("sgr_header_section", "sgr_forms_disable");
66
  }
67
+ add_action("admin_init", "sgr_display_options");
68
 
69
+ function load_language_sgr() {
70
+ load_plugin_textdomain("simple-google-recaptcha", false, dirname(plugin_basename(__FILE__))."/languages/");
71
  }
72
+ add_action("plugins_loaded", "load_language_sgr");
 
73
 
74
  function frontend_sgr_script() {
75
+ if ((get_option("sgr_comments_disable") != 1 && !is_user_logged_in() && comments_open()) || (did_action("login_init") && get_option("sgr_forms_disable") != 1)) {
76
+ wp_register_script("sgr_recaptcha", "https://www.google.com/recaptcha/api.js?hl=".get_locale());
77
+ wp_enqueue_script("sgr_recaptcha");
78
+ wp_register_script("sgr_recaptcha_check", plugin_dir_url(__FILE__)."check.js");
79
+ wp_enqueue_script("sgr_recaptcha_check");
80
+ wp_localize_script("sgr_recaptcha_check", "sgr_recaptcha_trans", array("title" => __("Are you a Robot?", "simple-google-recaptcha")));
81
+ wp_enqueue_style("style", plugin_dir_url(__FILE__)."style.css");
82
+ }
83
  }
 
84
  add_action("login_enqueue_scripts", "frontend_sgr_script");
85
+ add_action("wp_enqueue_scripts", "frontend_sgr_script");
 
 
 
 
86
 
87
  function sgr_display() {
88
+ echo "<div class=\"g-recaptcha\" data-sitekey=\"".get_option("sgr_site_key")."\" data-callback=\"enableBtn\"></div>";
89
  }
90
 
91
  function sgr_verify($input) {
92
+ if ($_SERVER["REQUEST_METHOD"] == "POST") {
93
+ if (isset($_POST["g-recaptcha-response"])) {
94
+ $recaptcha_response = sanitize_text_field($_POST["g-recaptcha-response"]);
95
+ $recaptcha_secret = get_option("sgr_secret_key");
96
+ $response = wp_remote_get("https://www.google.com/recaptcha/api/siteverify?secret=".$recaptcha_secret."&response=".$recaptcha_response);
97
+ $response = json_decode($response["body"], true);
98
+
99
+ if ($response["success"] == true) {
100
+ return $input;
101
+ } else {
102
+ 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().">&laquo; ".__("Back", "simple-google-recaptcha")."</a>");
103
+ return null;
104
+ }
105
  } else {
106
+ 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().">&laquo; ".__("Back", "simple-google-recaptcha")."</a>");
107
  return null;
108
  }
 
 
 
 
109
  }
110
  }
111
 
112
  function sgr_check() {
113
  if (get_option("sgr_site_key") != "" && get_option("sgr_secret_key") != "") {
114
+ if (get_option("sgr_comments_disable") != 1 && !is_user_logged_in()) {
 
115
  add_action("comment_form_after_fields", "sgr_display");
116
+ add_action("preprocess_comment", "sgr_verify");
 
 
 
 
 
 
 
 
 
 
 
 
117
  }
118
 
119
+ if (get_option("sgr_forms_disable") != 1) {
120
+ add_action("login_form", "sgr_display");
121
+ add_action("wp_authenticate_user", "sgr_verify");
122
+
123
  add_action("register_form", "sgr_display");
124
+ add_action("registration_errors", "sgr_verify");
125
+
 
 
 
 
 
126
  add_action("lostpassword_form", "sgr_display");
127
+ add_action("lostpassword_post", "sgr_verify");
128
+
129
+ add_action("resetpass_form", "sgr_display");
130
+ add_action("resetpass_post", "sgr_verify");
 
 
 
 
 
 
 
 
131
  }
132
  }
133
  }