PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13
1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 1.7.0.9 All 211 releases
charitable / includes / admin / security / modules / captcha / class-charitable-captcha.php

class-charitable-captcha.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.13, at includes/admin/security/modules/captcha/class-charitable-captcha.php

90 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The main Charitable CAPTCHA class.
4 *
5 * @package Charitable/Classes/Charitable_Captcha
6 * @copyright Copyright (c) 2023, WP Charitable LLC
7 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
8 * @version 1.8.9
9 * @since 1.8.9
10 */
11
12 // Exit if accessed directly.
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit;
15 }
16
17 if ( ! class_exists( 'Charitable_Captcha' ) ) :
18
19 /**
20 * CAPTCHA module.
21 *
22 * @since 1.8.0
23 */
24 class Charitable_Captcha {
25
26 /**
27 * Return whether the module is active.
28 *
29 * @since 1.8.9
30 *
31 * @return boolean
32 */
33 public function is_active() {
34 return 'disabled' !== charitable_get_option( 'captcha_provider' );
35 }
36
37 /**
38 * Get the module settings.
39 *
40 * @since 1.8.9
41 *
42 * @return array
43 */
44 public function get_settings() {
45 return array(
46 'security_section_header' => array(
47 'title' => __( 'Security', 'charitable' ),
48 'type' => 'heading',
49 'priority' => 1,
50 ),
51 'captcha_section_header' => array(
52 'title' => __( 'Captcha', 'charitable' ),
53 'type' => 'heading',
54 'class' => 'section-heading',
55 'priority' => 100,
56 ),
57 'captcha_provider' => array(
58 'title' => __( 'Captcha Provider', 'charitable' ),
59 'type' => 'select',
60 'options' => array(
61 'disabled' => __( 'Disabled', 'charitable' ),
62 'google-recaptcha' => __( 'Google reCAPTCHA (Invisible V2)', 'charitable' ),
63 'google-recaptcha-v3' => __( 'Google reCAPTCHA v3 (Invisible)', 'charitable' ),
64 'hcaptcha' => __( 'hCaptcha', 'charitable' ),
65 'cloudflare-turnstile' => __( 'Cloudflare Turnstile', 'charitable' ),
66 ),
67 'priority' => 104,
68 'default' => 'disabled',
69 ),
70 'captcha_logged_in' => array(
71 'title' => __( 'Require captcha for logged-in users', 'charitable' ),
72 'type' => 'radio',
73 'options' => array(
74 'yes' => __( 'Yes', 'charitable' ),
75 'no' => __( 'No', 'charitable' ),
76 ),
77 'priority' => 108,
78 'default' => 'no',
79 'attrs' => array(
80 'data-trigger-key' => '#charitable_settings_captcha_provider',
81 'data-trigger-value' => '!disabled',
82 ),
83 ),
84 );
85 }
86 }
87
88 endif;
89
90