PluginProbe
Hostinger Tools / 3.0.2
Hostinger Tools v3.0.2
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 +34 -74 3.0.693.0.2 View file →
@@ -1,7 +1,10 @@
1 1 <?php
2 2 namespace Hostinger\Admin\Options;
3 3
4 +/**
5 + * Avoid possibility to get file accessed directly
6 + */
4 7 if ( ! defined( 'ABSPATH' ) ) {
5 8 die;
6 9 }
7 10
@@ -34,40 +37,23 @@
34 37 */
35 38 private bool $force_www = false;
36 39
37 40 /**
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 41 * @param array $settings plugin settings array.
54 42 */
55 43 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'] );
44 + $this->maintenance_mode = !empty($settings['maintenance_mode'] );
45 + $this->bypass_code = !empty($settings['bypass_code'] ) ? $settings['bypass_code'] : '';
46 + $this->disable_xml_rpc = !empty($settings['disable_xml_rpc'] );
47 + $this->force_https = !empty($settings['force_https'] );
48 + $this->force_www = !empty($settings['force_www'] );
64 49 }
65 50
66 51 /**
67 52 * @return bool
68 53 */
69 - public function get_maintenance_mode(): bool {
54 + public function get_maintenance_mode(): bool
55 + {
70 56 return $this->maintenance_mode;
71 57 }
72 58
73 59 /**
@@ -74,9 +60,10 @@
74 60 * @param bool $maintenance_mode
75 61 *
76 62 * @return void
77 63 */
78 - public function set_maintenance_mode( bool $maintenance_mode ): void {
64 + public function set_maintenance_mode(bool $maintenance_mode): void
65 + {
79 66 $this->maintenance_mode = $maintenance_mode;
80 67 }
81 68
82 69 /**
@@ -81,9 +68,10 @@
81 68
82 69 /**
83 70 * @return string
84 71 */
85 - public function get_bypass_code(): string {
72 + public function get_bypass_code(): string
73 + {
86 74 return $this->bypass_code;
87 75 }
88 76
89 77 /**
@@ -90,9 +78,10 @@
90 78 * @param string $bypass_code
91 79 *
92 80 * @return void
93 81 */
94 - public function set_bypass_code( string $bypass_code ): void {
82 + public function set_bypass_code(string $bypass_code): void
83 + {
95 84 $this->bypass_code = $bypass_code;
96 85 }
97 86
98 87 /**
@@ -97,9 +86,10 @@
97 86
98 87 /**
99 88 * @return bool
100 89 */
101 - public function get_disable_xml_rpc(): bool {
90 + public function get_disable_xml_rpc(): bool
91 + {
102 92 return $this->disable_xml_rpc;
103 93 }
104 94
105 95 /**
@@ -106,9 +96,10 @@
106 96 * @param bool $disable_xml_rpc
107 97 *
108 98 * @return void
109 99 */
110 - public function set_disable_xml_rpc( bool $disable_xml_rpc ): void {
100 + public function set_disable_xml_rpc(bool $disable_xml_rpc): void
101 + {
111 102 $this->disable_xml_rpc = $disable_xml_rpc;
112 103 }
113 104
114 105 /**
@@ -113,9 +104,10 @@
113 104
114 105 /**
115 106 * @return bool
116 107 */
117 - public function get_force_https(): bool {
108 + public function get_force_https(): bool
109 + {
118 110 return $this->force_https;
119 111 }
120 112
121 113 /**
@@ -122,9 +114,10 @@
122 114 * @param bool $force_https
123 115 *
124 116 * @return void
125 117 */
126 - public function set_force_https( bool $force_https ): void {
118 + public function set_force_https(bool $force_https): void
119 + {
127 120 $this->force_https = $force_https;
128 121 }
129 122
130 123 /**
@@ -129,9 +122,10 @@
129 122
130 123 /**
131 124 * @return bool
132 125 */
133 - public function get_force_www(): bool {
126 + public function get_force_www(): bool
127 + {
134 128 return $this->force_www;
135 129 }
136 130
137 131 /**
@@ -138,56 +132,22 @@
138 132 * @param bool $force_www
139 133 *
140 134 * @return void
141 135 */
142 - public function set_force_www( bool $force_www ): void {
136 + public function set_force_www(bool $force_www): void
137 + {
143 138 $this->force_www = $force_www;
144 139 }
145 140
146 141 /**
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 142 * @return array
180 143 */
181 144 public function to_array(): array {
182 145 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(),
146 + 'maintenance_mode' => $this->get_maintenance_mode(),
147 + 'bypass_code' => $this->get_bypass_code(),
148 + 'disable_xml_rpc' => $this->get_disable_xml_rpc(),
149 + 'force_https' => $this->get_force_https(),
150 + 'force_www' => $this->get_force_www(),
191 151 );
192 152 }
193 -}
153 +}