PluginProbe
Hostinger Tools / 3.0.39
Hostinger Tools v3.0.39
3.0.77 3.0.76 3.0.75 3.0.74 3.0.73 3.0.72 3.0.71 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 All 108 releases
← All changes | includes/Admin/Options/PluginOptions.php +145 -160 3.0.763.0.39 View file →
@@ -1,9 +1,9 @@
1 1 <?php
2 2 namespace Hostinger\Admin\Options;
3 3
4 4 if ( ! defined( 'ABSPATH' ) ) {
5 - die;
5 + die;
6 6 }
7 7
8 8 /**
9 9 * Class for handling plugin options
@@ -8,186 +8,171 @@
8 8 /**
9 9 * Class for handling plugin options
10 10 */
11 11 class PluginOptions {
12 - /**
13 - * @var bool
14 - */
15 - private bool $maintenance_mode = false;
12 + /**
13 + * @var bool
14 + */
15 + private bool $maintenance_mode = false;
16 16
17 - /**
18 - * @var string
19 - */
20 - private string $bypass_code = '';
17 + /**
18 + * @var string
19 + */
20 + private string $bypass_code = '';
21 21
22 - /**
23 - * @var bool
24 - */
25 - private bool $disable_xml_rpc = false;
22 + /**
23 + * @var bool
24 + */
25 + private bool $disable_xml_rpc = false;
26 26
27 - /**
28 - * @var bool
29 - */
30 - private bool $force_https = false;
27 + /**
28 + * @var bool
29 + */
30 + private bool $force_https = false;
31 31
32 - /**
33 - * @var bool
34 - */
35 - private bool $force_www = false;
32 + /**
33 + * @var bool
34 + */
35 + private bool $force_www = false;
36 36
37 - /**
38 - * @var bool
39 - */
40 - private bool $disable_authentication_password = false;
37 + /**
38 + * @var bool
39 + */
40 + private bool $disable_authentication_password = false;
41 41
42 - /**
43 - * @var bool
44 - */
45 - private bool $enable_llms_txt = false;
42 + /**
43 + * @var bool
44 + */
45 + private bool $enable_llms_txt = false;
46 46
47 - /**
48 - * @var bool
49 - */
50 - private bool $optin_mcp = false;
47 + /**
48 + * @param array $settings plugin settings array.
49 + */
50 + public function __construct( array $settings = array() ) {
51 + $this->maintenance_mode = ! empty( $settings['maintenance_mode'] );
52 + $this->bypass_code = ! empty( $settings['bypass_code'] ) ? $settings['bypass_code'] : '';
53 + $this->disable_xml_rpc = ! empty( $settings['disable_xml_rpc'] );
54 + $this->force_https = ! empty( $settings['force_https'] );
55 + $this->force_www = ! empty( $settings['force_www'] );
56 + $this->disable_authentication_password = ! empty( $settings['disable_authentication_password'] );
57 + $this->enable_llms_txt = ! empty( $settings['enable_llms_txt'] );
58 + }
51 59
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 - }
60 + /**
61 + * @return bool
62 + */
63 + public function get_maintenance_mode(): bool {
64 + return $this->maintenance_mode;
65 + }
65 66
66 - /**
67 - * @return bool
68 - */
69 - public function get_maintenance_mode(): bool {
70 - return $this->maintenance_mode;
71 - }
67 + /**
68 + * @param bool $maintenance_mode
69 + *
70 + * @return void
71 + */
72 + public function set_maintenance_mode( bool $maintenance_mode ): void {
73 + $this->maintenance_mode = $maintenance_mode;
74 + }
72 75
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 - }
76 + /**
77 + * @return string
78 + */
79 + public function get_bypass_code(): string {
80 + return $this->bypass_code;
81 + }
81 82
82 - /**
83 - * @return string
84 - */
85 - public function get_bypass_code(): string {
86 - return $this->bypass_code;
87 - }
83 + /**
84 + * @param string $bypass_code
85 + *
86 + * @return void
87 + */
88 + public function set_bypass_code( string $bypass_code ): void {
89 + $this->bypass_code = $bypass_code;
90 + }
88 91
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 - }
92 + /**
93 + * @return bool
94 + */
95 + public function get_disable_xml_rpc(): bool {
96 + return $this->disable_xml_rpc;
97 + }
97 98
98 - /**
99 - * @return bool
100 - */
101 - public function get_disable_xml_rpc(): bool {
102 - return $this->disable_xml_rpc;
103 - }
99 + /**
100 + * @param bool $disable_xml_rpc
101 + *
102 + * @return void
103 + */
104 + public function set_disable_xml_rpc( bool $disable_xml_rpc ): void {
105 + $this->disable_xml_rpc = $disable_xml_rpc;
106 + }
104 107
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 - }
108 + /**
109 + * @return bool
110 + */
111 + public function get_force_https(): bool {
112 + return $this->force_https;
113 + }
113 114
114 - /**
115 - * @return bool
116 - */
117 - public function get_force_https(): bool {
118 - return $this->force_https;
119 - }
115 + /**
116 + * @param bool $force_https
117 + *
118 + * @return void
119 + */
120 + public function set_force_https( bool $force_https ): void {
121 + $this->force_https = $force_https;
122 + }
120 123
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 - }
124 + /**
125 + * @return bool
126 + */
127 + public function get_force_www(): bool {
128 + return $this->force_www;
129 + }
129 130
130 - /**
131 - * @return bool
132 - */
133 - public function get_force_www(): bool {
134 - return $this->force_www;
135 - }
131 + /**
132 + * @param bool $force_www
133 + *
134 + * @return void
135 + */
136 + public function set_force_www( bool $force_www ): void {
137 + $this->force_www = $force_www;
138 + }
136 139
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 - }
140 + /**
141 + * @return bool
142 + */
143 + public function get_disable_authentication_password(): bool {
144 + return $this->disable_authentication_password;
145 + }
145 146
146 - /**
147 - * @return bool
148 - */
149 - public function get_disable_authentication_password(): bool {
150 - return $this->disable_authentication_password;
151 - }
147 + /**
148 + * @param bool $authentication_password
149 + *
150 + * @return void
151 + */
152 + public function set_disable_authentication_password( bool $authentication_password ): void {
153 + $this->disable_authentication_password = $authentication_password;
154 + }
152 155
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 - }
156 + public function get_enable_llms_txt(): bool {
157 + return $this->enable_llms_txt;
158 + }
161 159
162 - public function get_enable_llms_txt(): bool {
163 - return $this->enable_llms_txt;
164 - }
160 + public function set_enable_llms_txt( bool $enable_llms_txt ): void {
161 + $this->enable_llms_txt = $enable_llms_txt;
162 + }
165 163
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 - }
164 + /**
165 + * @return array
166 + */
167 + public function to_array(): array {
168 + return array(
169 + 'maintenance_mode' => $this->get_maintenance_mode(),
170 + 'bypass_code' => $this->get_bypass_code(),
171 + 'disable_xml_rpc' => $this->get_disable_xml_rpc(),
172 + 'force_https' => $this->get_force_https(),
173 + 'force_www' => $this->get_force_www(),
174 + 'disable_authentication_password' => $this->get_disable_authentication_password(),
175 + 'enable_llms_txt' => $this->get_enable_llms_txt(),
176 + );
177 + }
193 178 }