PluginProbe ʕ •ᴥ•ʔ
Advanced Google reCAPTCHA / 1.13
Advanced Google reCAPTCHA v1.13
5.40 5.39 trunk 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19 1.20 1.21 1.22 1.23 1.24 1.25 1.26 1.27 1.28 1.29 1.30 1.31 1.32 1.33 1.34 1.35
advanced-google-recaptcha / interface / tab_captcha.php
advanced-google-recaptcha / interface Last commit date
tab_activity.php 2 years ago tab_captcha.php 2 years ago tab_design.php 2 years ago tab_firewall.php 2 years ago tab_geoip.php 2 years ago tab_login_form.php 2 years ago tab_temp_access.php 2 years ago
tab_captcha.php
254 lines
1 <?php
2 /**
3 * WP Captcha
4 * https://getwpcaptcha.com/
5 * (c) WebFactory Ltd, 2022 - 2023, www.webfactoryltd.com
6 */
7
8 class WPCaptcha_Tab_Captcha extends WPCaptcha
9 {
10 static function display()
11 {
12 $tabs[] = array('id' => 'tab_captcha', 'class' => 'tab-content', 'label' => __('Captcha', 'advanced-google-recaptcha'), 'callback' => array(__CLASS__, 'tab_captcha'));
13 $tabs[] = array('id' => 'tab_captcha_location', 'class' => 'tab-content', 'label' => __('Where To Show', 'advanced-google-recaptcha'), 'callback' => array(__CLASS__, 'tab_captcha_location'));
14
15 echo '<div id="tabs_log" class="ui-tabs wpcaptcha-tabs-2nd-level">';
16 echo '<ul>';
17 foreach ($tabs as $tab) {
18 echo '<li><a href="#' . esc_attr($tab['id']) . '">' . esc_html($tab['label']) . '</a></li>';
19 }
20 echo '</ul>';
21
22 foreach ($tabs as $tab) {
23 if (is_callable($tab['callback'])) {
24 echo '<div style="display: none;" id="' . esc_attr($tab['id']) . '" class="' . esc_attr($tab['class']) . '">';
25 call_user_func($tab['callback']);
26 echo '</div>';
27 }
28 } // foreach
29
30 echo '</div>'; // second level of tabs
31 } // display
32
33 static function tab_captcha()
34 {
35 $options = WPCaptcha_Setup::get_options();
36
37 echo '<div class="tab-content">';
38
39 echo '<table class="form-table"><tbody>';
40
41 $captcha = array();
42 $captcha[] = array('val' => 'disabled', 'label' => 'Disabled');
43 $captcha[] = array('val' => 'builtin', 'label' => 'Built-in Math Captcha');
44 $captcha[] = array('val' => 'icons', 'label' => 'Built-in Icon Captcha', 'class' => 'pro-option');
45 $captcha[] = array('val' => 'recaptchav2', 'label' => 'Google reCAPTCHA v2');
46 $captcha[] = array('val' => 'recaptchav3', 'label' => 'Google reCAPTCHA v3');
47 $captcha[] = array('val' => 'hcaptcha', 'label' => 'hCaptcha', 'class' => 'pro-option');
48 $captcha[] = array('val' => 'cloudflare', 'label' => 'Cloudflare Turnstile', 'class' => 'pro-option');
49
50 echo '<tr valign="top">
51 <th scope="row"><label for="captcha">Captcha</label></th>
52 <td><select id="captcha" name="' . esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[captcha]">';
53 WPCaptcha_Utility::create_select_options($captcha, $options['captcha']);
54 echo '</select>';
55 echo '<br /><span>Captcha or "are you human" verification ensures bots can\'t attack your login page and provides additional protection with minimal impact to users.</span>';
56 echo '</td></tr>';
57
58 echo '<tr class="captcha_keys_wrapper" style="display:none;" valign="top">
59 <th scope="row"><label for="captcha_site_key">Captcha Site Key</label></th>
60 <td><input type="text" class="regular-text" id="captcha_site_key" name="' . esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[captcha_site_key]" value="' . esc_html($options['captcha_site_key']) . '" data-old="' . esc_html($options['captcha_site_key']) . '" />';
61 echo '</td></tr>';
62
63 echo '<tr class="captcha_keys_wrapper" style="display:none;" valign="top">
64 <th scope="row"><label for="captcha_secret_key">Captcha Secret Key</label></th>
65 <td><input type="text" class="regular-text" id="captcha_secret_key" name="' . esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[captcha_secret_key]" value="' . esc_html($options['captcha_secret_key']) . '" data-old="' . esc_html($options['captcha_secret_key']) . '" />';
66 echo '</td></tr>';
67
68 echo '<tr class="captcha_verify_wrapper" style="display:none;" valign="top">
69 <th scope="row"></th>
70 <td><button id="verify-captcha" class="button button-primary button-large button-yellow">Verify Captcha <i class="wpcaptcha-icon wpcaptcha-make-group"></i></button>';
71 echo '<input type="hidden" class="regular-text" id="captcha_verified" name="' . esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[captcha_verified]" value="0" />';
72 echo '<br /><span>Click the Verify Captcha button to verify that the captcha is valid and working otherwise captcha settings will not be saved</span>';
73 echo '</td></tr>';
74
75 echo '<tr><td></td><td>';
76 WPCaptcha_admin::footer_save_button();
77 echo '</td></tr>';
78
79 echo '<tr><td colspan="2">';
80 echo '<div class="captcha-box-wrapper ' . ($options['captcha'] == 'disabled'?'captcha-selected':'') . '" data-captcha="disabled">';
81 echo '<img src="' . esc_url(WPCAPTCHA_PLUGIN_URL) . '/images/captcha_disabled.png" />';
82 echo '<div class="captcha-box-desc">';
83 echo '<h3>Captcha Disabled</h3>';
84 echo '<ul>';
85 echo '<li>No Additional Security</li>';
86 echo '</ul>';
87 echo '</div>';
88 echo '</div>';
89
90 echo '<div class="captcha-box-wrapper ' . ($options['captcha'] == 'builtin'?'captcha-selected':'') . '" data-captcha="builtin">';
91 echo '<img src="' . esc_url(WPCAPTCHA_PLUGIN_URL) . '/images/captcha_builtin.png" />';
92 echo '<div class="captcha-box-desc">';
93 echo '<h3>Built-in Math Captcha</h3>';
94 echo '<ul>';
95 echo '<li>Medium Security</li>';
96 echo '<li>No API keys</li>';
97 echo '<li>No 3rd party services</li>';
98 echo '<li>GDPR Compatible</li>';
99 echo '</ul>';
100 echo '</div>';
101 echo '</div>';
102
103 echo '<div class="captcha-box-wrapper ' . ($options['captcha'] == 'icons'?'captcha-selected':'') . '" data-captcha="icons">';
104 echo '<a title="This feature is available in the PRO version. Click for details." href="#" data-feature="recaptchav2" class="open-upsell pro-label">PRO</a>';
105 echo '<img src="' . esc_url(WPCAPTCHA_PLUGIN_URL) . '/images/captcha_icons.png" />';
106 echo '<div class="captcha-box-desc">';
107 echo '<h3>Built-in Icon Captcha</h3>';
108 echo '<ul>';
109 echo '<li>Medium Security</li>';
110 echo '<li>No API keys</li>';
111 echo '<li>No 3rd party services</li>';
112 echo '<li>GDPR Compatible</li>';
113 echo '</ul>';
114 echo '</div>';
115 echo '</div>';
116
117
118
119 echo '<div class="captcha-box-wrapper ' . ($options['captcha'] == 'recaptchav2'?'captcha-selected':'') . '" data-captcha="recaptchav2">';
120 echo '<img src="' . esc_url(WPCAPTCHA_PLUGIN_URL) . '/images/captcha_recaptcha_v2.png" />';
121 echo '<div class="captcha-box-desc">';
122 echo '<h3>Google reCaptcha v2</h3>';
123 echo '<ul>';
124 echo '<li>High Security</li>';
125 echo '<li>Requires <a href="https://www.google.com/recaptcha/about/" target="_blank">API Keys</a></li>';
126 echo '<li>Powered by Google</li>';
127 echo '<li>Not GDPR Compatible</li>';
128 echo '</ul>';
129 echo '</div>';
130 echo '</div>';
131
132 echo '<div class="captcha-box-wrapper ' . ($options['captcha'] == 'recaptchav3'?'captcha-selected':'') . '" data-captcha="recaptchav3">';
133 echo '<img src="' . esc_url(WPCAPTCHA_PLUGIN_URL) . '/images/captcha_recaptcha_v3.png" />';
134 echo '<div class="captcha-box-desc">';
135 echo '<h3>Google reCaptcha v3</h3>';
136 echo '<ul>';
137 echo '<li>High Security</li>';
138 echo '<li>Requires <a href="https://www.google.com/recaptcha/about/" target="_blank">API Keys</a></li>';
139 echo '<li>Powered by Google</li>';
140 echo '<li>Not GDPR Compatible</li>';
141 echo '</ul>';
142 echo '</div>';
143 echo '</div>';
144
145 echo '<div class="captcha-box-wrapper ' . ($options['captcha'] == 'hcaptcha'?'captcha-selected':'') . '" data-captcha="hcaptcha">';
146 echo '<a title="This feature is available in the PRO version. Click for details." href="#" data-feature="recaptchav2" class="open-upsell pro-label">PRO</a>';
147 echo '<img src="' . esc_url(WPCAPTCHA_PLUGIN_URL) . '/images/captcha_hcaptcha.png" />';
148 echo '<div class="captcha-box-desc">';
149 echo '<h3>hCaptcha</h3>';
150 echo '<ul>';
151 echo '<li>High Security</li>';
152 echo '<li>Requires <a href="https://www.hcaptcha.com/signup-interstitial" target="_blank">API Keys</a></li>';
153 echo '<li>GDPR Compatible</li>';
154 echo '<li>Best Choice</li>';
155 echo '</ul>';
156 echo '</div>';
157 echo '</div>';
158
159 echo '<div class="captcha-box-wrapper ' . ($options['captcha'] == 'cloudflare'?'captcha-selected':'') . '" data-captcha="cloudflare">';
160 echo '<a title="This feature is available in the PRO version. Click for details." href="#" data-feature="recaptchav2" class="open-upsell pro-label">PRO</a>';
161 echo '<img src="' . esc_url(WPCAPTCHA_PLUGIN_URL) . '/images/captcha_cloudflare.png" />';
162 echo '<div class="captcha-box-desc">';
163 echo '<h3>Cloudflare Turnstile</h3>';
164 echo '<ul>';
165 echo '<li>High Security</li>';
166 echo '<li>Requires <a href="https://dash.cloudflare.com/sign-up?to=/:account/turnstile" target="_blank">API Keys</a></li>';
167 echo '<li>Not explicitly GDPR Compatible</li>';
168 echo '<li>Powered by Cloudflare</li>';
169 echo '</ul>';
170 echo '</div>';
171 echo '</div>';
172
173
174 echo '</td></tr>';
175
176 echo '</tbody></table>';
177
178 echo '</div>';
179 } // tab_captcha
180
181 static function tab_captcha_location()
182 {
183 $options = WPCaptcha_Setup::get_options();
184
185 echo '<div class="tab-content">';
186
187 echo '<table class="form-table"><tbody>';
188
189 echo '<tr valign="top">
190 <th scope="row"><label for="captcha_show_login">Login Form</label></th>
191 <td>';
192 WPCaptcha_Utility::create_toggle_switch('captcha_show_login', array('saved_value' => $options['captcha_show_login'], 'option_key' => esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[captcha_show_login]'));
193 echo '<br /><span>Applies to default login, WooCommerce, and Easy Digital Downloads login pages</span>';
194 echo '</td></tr>';
195
196 echo '<tr valign="top">
197 <th scope="row"><label for="captcha_show_wp_registration">Registration Form</label></th>
198 <td>';
199 WPCaptcha_Utility::create_toggle_switch('captcha_show_wp_registration', array('saved_value' => $options['captcha_show_wp_registration'], 'option_key' => esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[captcha_show_wp_registration]'));
200 echo '<br /><span>Show captcha on WordPress user registration form</span>';
201 echo '</td></tr>';
202
203 echo '<tr valign="top">
204 <th scope="row"><label for="captcha_show_wp_lost_password">Lost Password Form</label></th>
205 <td>';
206 WPCaptcha_Utility::create_toggle_switch('captcha_show_wp_lost_password', array('saved_value' => $options['captcha_show_wp_lost_password'], 'option_key' => esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[captcha_show_wp_lost_password]'));
207 echo '<br /><span>Show captcha on WordPress lost password form</span>';
208 echo '</td></tr>';
209
210 echo '<tr valign="top">
211 <th scope="row"><label for="captcha_show_wp_comment">Comment Form</label></th>
212 <td>';
213 WPCaptcha_Utility::create_toggle_switch('captcha_show_wp_comment', array('saved_value' => $options['captcha_show_wp_comment'], 'option_key' => esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[captcha_show_wp_comment]'));
214 echo '<br /><span>Show captcha on WordPress comments form</span>';
215 echo '</td></tr>';
216
217 echo '<tr valign="top">
218 <th scope="row"><label for="captcha_show_woo_registration">WooCommerce Registration Form</label></th>
219 <td>';
220 WPCaptcha_Utility::create_toggle_switch('captcha_show_woo_registration', array('saved_value' => $options['captcha_show_woo_registration'], 'option_key' => esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[captcha_show_woo_registration]'));
221 echo '<br /><span>Show captcha on WooCommerce registration form</span>';
222 echo '</td></tr>';
223
224 echo '<tr valign="top">
225 <th scope="row"><label for="captcha_show_woo_checkout">WooCommerce Checkout Form</label></th>
226 <td>';
227 WPCaptcha_Utility::create_toggle_switch('captcha_show_woo_checkout', array('saved_value' => $options['captcha_show_woo_checkout'], 'option_key' => esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[captcha_show_woo_checkout]'));
228 echo '<br /><span>Show captcha on WooCommerce checkout form</span>';
229 echo '</td></tr>';
230
231 echo '<tr valign="top">
232 <th scope="row"><label for="captcha_show_edd_registration">Easy Digital Downloads Registration Form</label></th>
233 <td>';
234 WPCaptcha_Utility::create_toggle_switch('captcha_show_edd_registration', array('saved_value' => $options['captcha_show_edd_registration'], 'option_key' => esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[captcha_show_edd_registration]'));
235 echo '<br /><span>Show captcha on Easy Digital Downloads registration form</span>';
236 echo '</td></tr>';
237
238 echo '<tr valign="top">
239 <th scope="row"><label for="captcha_show_bp_registration">BuddyPress Registration Form</label></th>
240 <td>';
241 WPCaptcha_Utility::create_toggle_switch('captcha_show_bp_registration', array('saved_value' => $options['captcha_show_bp_registration'], 'option_key' => esc_attr(WPCAPTCHA_OPTIONS_KEY) . '[captcha_show_bp_registration]'));
242 echo '<br /><span>Show captcha on BuddyPress registration form</span>';
243 echo '</td></tr>';
244
245 echo '<tr><td></td><td>';
246 WPCaptcha_admin::footer_save_button();
247 echo '</td></tr>';
248
249 echo '</tbody></table>';
250
251 echo '</div>';
252 } // tab_captcha_location
253 } // class WPCaptcha_Tab_Captcha
254