PluginProbe ʕ •ᴥ•ʔ
Hostinger Tools / 3.0.69
Hostinger Tools v3.0.69
3.0.70 3.0.69 3.0.68 3.0.67 3.0.66 1.8.1 1.8.2 1.8.3 1.9.1 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.4 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.2 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 3.0.0 3.0.10 3.0.11 3.0.12 3.0.13 3.0.14 3.0.15 3.0.16 3.0.17 3.0.18 3.0.19 3.0.2 3.0.20 3.0.21 3.0.22 3.0.23 3.0.24 3.0.25 3.0.26 3.0.27 3.0.28 3.0.29 3.0.3 3.0.30 3.0.31 3.0.32 3.0.33 3.0.34 3.0.35 3.0.36 3.0.37 3.0.38 3.0.39 3.0.4 3.0.40 3.0.41 3.0.42 3.0.43 3.0.44 3.0.45 3.0.46 3.0.47 3.0.48 3.0.49 3.0.5 3.0.50 3.0.51 3.0.52 3.0.53 3.0.54 3.0.55 3.0.56 3.0.57 3.0.58 3.0.59 3.0.6 3.0.60 3.0.61 3.0.62 3.0.65 3.0.7 3.0.8 3.0.9 trunk 1.8.0
hostinger / includes / Admin / Options / PluginOptions.php
hostinger / includes / Admin / Options Last commit date
PluginOptions.php 9 months ago
PluginOptions.php
194 lines
1 <?php
2 namespace Hostinger\Admin\Options;
3
4 if ( ! defined( 'ABSPATH' ) ) {
5 die;
6 }
7
8 /**
9 * Class for handling plugin options
10 */
11 class PluginOptions {
12 /**
13 * @var bool
14 */
15 private bool $maintenance_mode = false;
16
17 /**
18 * @var string
19 */
20 private string $bypass_code = '';
21
22 /**
23 * @var bool
24 */
25 private bool $disable_xml_rpc = false;
26
27 /**
28 * @var bool
29 */
30 private bool $force_https = false;
31
32 /**
33 * @var bool
34 */
35 private bool $force_www = false;
36
37 /**
38 * @var bool
39 */
40 private bool $disable_authentication_password = false;
41
42 /**
43 * @var bool
44 */
45 private bool $enable_llms_txt = false;
46
47 /**
48 * @var bool
49 */
50 private bool $optin_mcp = false;
51
52 /**
53 * @param array $settings plugin settings array.
54 */
55 public function __construct( array $settings = array() ) {
56 $this->maintenance_mode = ! empty( $settings['maintenance_mode'] );
57 $this->bypass_code = ! empty( $settings['bypass_code'] ) ? $settings['bypass_code'] : '';
58 $this->disable_xml_rpc = ! empty( $settings['disable_xml_rpc'] );
59 $this->force_https = ! empty( $settings['force_https'] );
60 $this->force_www = ! empty( $settings['force_www'] );
61 $this->disable_authentication_password = ! empty( $settings['disable_authentication_password'] );
62 $this->enable_llms_txt = ! empty( $settings['enable_llms_txt'] );
63 $this->optin_mcp = ! empty( $settings['optin_mcp'] );
64 }
65
66 /**
67 * @return bool
68 */
69 public function get_maintenance_mode(): bool {
70 return $this->maintenance_mode;
71 }
72
73 /**
74 * @param bool $maintenance_mode
75 *
76 * @return void
77 */
78 public function set_maintenance_mode( bool $maintenance_mode ): void {
79 $this->maintenance_mode = $maintenance_mode;
80 }
81
82 /**
83 * @return string
84 */
85 public function get_bypass_code(): string {
86 return $this->bypass_code;
87 }
88
89 /**
90 * @param string $bypass_code
91 *
92 * @return void
93 */
94 public function set_bypass_code( string $bypass_code ): void {
95 $this->bypass_code = $bypass_code;
96 }
97
98 /**
99 * @return bool
100 */
101 public function get_disable_xml_rpc(): bool {
102 return $this->disable_xml_rpc;
103 }
104
105 /**
106 * @param bool $disable_xml_rpc
107 *
108 * @return void
109 */
110 public function set_disable_xml_rpc( bool $disable_xml_rpc ): void {
111 $this->disable_xml_rpc = $disable_xml_rpc;
112 }
113
114 /**
115 * @return bool
116 */
117 public function get_force_https(): bool {
118 return $this->force_https;
119 }
120
121 /**
122 * @param bool $force_https
123 *
124 * @return void
125 */
126 public function set_force_https( bool $force_https ): void {
127 $this->force_https = $force_https;
128 }
129
130 /**
131 * @return bool
132 */
133 public function get_force_www(): bool {
134 return $this->force_www;
135 }
136
137 /**
138 * @param bool $force_www
139 *
140 * @return void
141 */
142 public function set_force_www( bool $force_www ): void {
143 $this->force_www = $force_www;
144 }
145
146 /**
147 * @return bool
148 */
149 public function get_disable_authentication_password(): bool {
150 return $this->disable_authentication_password;
151 }
152
153 /**
154 * @param bool $authentication_password
155 *
156 * @return void
157 */
158 public function set_disable_authentication_password( bool $authentication_password ): void {
159 $this->disable_authentication_password = $authentication_password;
160 }
161
162 public function get_enable_llms_txt(): bool {
163 return $this->enable_llms_txt;
164 }
165
166 public function set_enable_llms_txt( bool $llmstxt_enabled ): void {
167 $this->enable_llms_txt = $llmstxt_enabled;
168 }
169
170 public function get_optin_mcp(): bool {
171 return $this->optin_mcp;
172 }
173
174 public function set_optin_mcp( bool $optin_mcp ): void {
175 $this->optin_mcp = $optin_mcp;
176 }
177
178 /**
179 * @return array
180 */
181 public function to_array(): array {
182 return array(
183 'maintenance_mode' => $this->get_maintenance_mode(),
184 'bypass_code' => $this->get_bypass_code(),
185 'disable_xml_rpc' => $this->get_disable_xml_rpc(),
186 'force_https' => $this->get_force_https(),
187 'force_www' => $this->get_force_www(),
188 'disable_authentication_password' => $this->get_disable_authentication_password(),
189 'enable_llms_txt' => $this->get_enable_llms_txt(),
190 'optin_mcp' => $this->get_optin_mcp(),
191 );
192 }
193 }
194