PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 5.3.1
Defender Security – Malware Scanner, Login Security & Firewall v5.3.1
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / src / model / setting / class-global-ip-lockout.php

class-global-ip-lockout.php in Defender Security – Malware Scanner, Login Security & Firewall 5.3.1, at src/model/setting/class-global-ip-lockout.php

89 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Handles global ip lockout settings.
4 *
5 * @package WP_Defender\Model\Setting
6 */
7
8 namespace WP_Defender\Model\Setting;
9
10 use Calotes\Model\Setting;
11
12 /**
13 * Model for global ip lockout settings.
14 */
15 class Global_Ip_Lockout extends Setting {
16
17 /**
18 * Option name.
19 *
20 * @var string
21 */
22 protected $table = 'wd_global_ip_settings';
23
24 /**
25 * Is module enabled.
26 *
27 * @var bool
28 * @defender_property
29 */
30 public $enabled = false;
31
32 /**
33 * Allow self unlock?
34 *
35 * @var bool
36 * @defender_property
37 */
38 public bool $allow_self_unlock = false;
39
40 /**
41 * Table column for autosync.
42 *
43 * @var bool
44 * @defender_property
45 */
46 public $blocklist_autosync = false;
47
48 /**
49 * Validation rules.
50 *
51 * @var array
52 */
53 protected $rules = array(
54 array( array( 'enabled', 'blocklist_autosync', 'allow_self_unlock' ), 'boolean' ),
55 );
56
57 /**
58 * Define settings labels.
59 *
60 * @return array
61 */
62 public function labels(): array {
63 return array(
64 'enabled' => self::get_module_name(),
65 'blocklist_autosync' => esc_html__( 'Permanently Blocked IPs', 'defender-security' ),
66 );
67 }
68
69 /**
70 * Get the module name.
71 *
72 * @return string The module name.
73 */
74 public static function get_module_name(): string {
75 return esc_html__( 'Custom IP List', 'defender-security' );
76 }
77
78 /**
79 * Get the module state based on the given flag.
80 *
81 * @param bool $flag The flag indicating the module state.
82 *
83 * @return string The module state, either 'active' or 'inactive'.
84 */
85 public static function get_module_state( $flag ): string {
86 return $flag ? esc_html__( 'active', 'defender-security' ) : esc_html__( 'inactive', 'defender-security' );
87 }
88 }
89