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 / component / config / class-config-adapter.php

class-config-adapter.php in Defender Security – Malware Scanner, Login Security & Firewall 5.3.1, at src/component/config/class-config-adapter.php

539 lines 22.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Responsible for upgrading and managing configuration data.
4 *
5 * @package WP_Defender\Component\Config
6 */
7
8 namespace WP_Defender\Component\Config;
9
10 use WP_Defender\Component;
11 use WP_Defender\Model\Notification;
12 use WP_Defender\Model\Setting\Two_Fa;
13 use WP_Defender\Model\Setting\Security_Headers;
14 use WP_Defender\Model\Setting\Login_Lockout as Model_Login_Lockout;
15 use WP_Defender\Model\Setting\User_Agent_Lockout as Model_Ua_Lockout;
16 use WP_Defender\Model\Setting\Notfound_Lockout as Model_Notfound_Lockout;
17 use WP_Defender\Model\Setting\Blacklist_Lockout as Model_Blacklist_Lockout;
18
19 /**
20 * Handles the configuration data adapter.
21 *
22 * @since 2.4.0
23 */
24 class Config_Adapter extends Component {
25
26 /**
27 * Status of notification receiver.
28 *
29 * @var string
30 */
31 public $status_recipient;
32
33 /**
34 * Upgrade the structure of config data from older versions.
35 *
36 * @param array $old_data The configuration data from the older version.
37 *
38 * @return array
39 */
40 public function upgrade( array $old_data ): array {
41 $this->status_recipient = Notification::USER_SUBSCRIBED;
42
43 return array(
44 'security_tweaks' => $this->update_security_tweaks( $old_data['security_tweaks'] ),
45 'scan' => empty( $old_data['scan'] ) ? array() : $this->update_scan( $old_data['scan'] ),
46 'iplockout' => empty( $old_data['iplockout'] )
47 ? array()
48 : $this->update_ip_lockout( $old_data['iplockout'] ),
49 // Empty data if Audit module is disabled.
50 'audit' => empty( $old_data['audit'] ) ? array() : $this->update_audit( $old_data['audit'] ),
51 'two_factor' => empty( $old_data['two_factor'] )
52 ? array()
53 : $this->update_two_factor( $old_data['two_factor'] ),
54 // Checks for empty values Mask Login and Security Headers inside methods.
55 'mask_login' => $this->update_mask_login( $old_data['mask_login'] ),
56 'security_headers' => $this->update_security_headers( $old_data['security_headers'] ),
57 'settings' => empty( $old_data['settings'] ) ? array() : $old_data['settings'],
58 'blocklist_monitor' => empty( $old_data['blocklist_monitor'] ) ? array() : $old_data['blocklist_monitor'],
59 'pwned_passwords' => empty( $old_data['pwned_passwords'] ) ? array() : $old_data['pwned_passwords'],
60 );
61 }
62
63 /**
64 * Convert key type from frequency to text.
65 * Attention: it's NOT translation lines.
66 *
67 * @param int $freq The frequency as a number.
68 *
69 * @return string
70 */
71 private function number_frequency_to_text( int $freq ): string {
72 switch ( $freq ) {
73 case 1:
74 $text = 'daily';
75 break;
76 case 7:
77 $text = 'weekly';
78 break;
79 case 30:
80 default:
81 $text = 'monthly';
82 break;
83 }
84
85 return $text;
86 }
87
88 /**
89 * Determines the frequency type based on the input, which can be either numeric or textual.
90 *
91 * @param string|int $frequency_type The frequency type which can be a number or a string.
92 *
93 * @return string
94 */
95 private function frequency_type( $frequency_type ) {
96
97 return is_numeric( $frequency_type )
98 ? $this->number_frequency_to_text( (int) $frequency_type )
99 : $frequency_type;
100 }
101
102 /**
103 * Report instance uses the 'day' property if a frequency type is daily and 'day_n' if a frequency type is monthly.
104 *
105 * @param string|int $frequency_type The frequency type.
106 * @param string $report_day The day of the week or month.
107 *
108 * @return array
109 */
110 private function frequency_day( $frequency_type, $report_day ): array {
111 $days = array(
112 'day_n' => '1',
113 'day' => 'sunday',
114 );
115 if (
116 ( ( is_numeric( $frequency_type ) && 30 === (int) $frequency_type ) )
117 || 'monthly' === $frequency_type
118 ) {
119 if ( empty( $report_day ) ) {
120 return $days;
121 }
122 if ( is_numeric( $report_day ) ) {
123 $days['day_n'] = $report_day;
124
125 return $days;
126 }
127 // Otherwise, get a number of the first day of the month by the day of the week.
128 $format = sprintf( 'first %s of next month', $report_day );
129 $days['day_n'] = wp_date( 'j', strtotime( $format ) );
130
131 return $days;
132 }
133 // Otherwise, we get report day for daily or weekly.
134 $days['day'] = $report_day;
135
136 return $days;
137 }
138
139 /**
140 * Extracts subscriber information from the provided data array.
141 *
142 * @param array $data Data containing subscriber information.
143 *
144 * @return array
145 */
146 private function get_subscribers( array $data ): array {
147 $subscribers = array();
148 if ( ! empty( $data ) ) {
149 foreach ( $data as $receipt ) {
150 $subscribers['out_house_recipients'][] = array(
151 'name' => $receipt['first_name'],
152 'email' => $receipt['email'],
153 'status' => $this->status_recipient,
154 'avatar' => get_avatar_url( $receipt['email'] ),
155 );
156 }
157 }
158
159 return $subscribers;
160 }
161
162 /**
163 * Updates the security tweaks configuration from the old format to the new format.
164 *
165 * @param array $old_tweaks The old security tweaks configuration.
166 *
167 * @return array
168 */
169 public function update_security_tweaks( $old_tweaks ): array {
170 $security_tweaks = array(
171 'issues' => $old_tweaks['issues'] ?? array(),
172 'fixed' => $old_tweaks['fixed'] ?? array(),
173 'ignore' => $old_tweaks['ignore'] ?? array(),
174 'automate' => isset( $old_tweaks['automate'] )
175 // Sometimes string value from old version.
176 ? ( is_bool( $old_tweaks['automate'] ) ? $old_tweaks['automate'] : (bool) $old_tweaks['automate'] )
177 : true,
178 'notification' => isset( $old_tweaks['notification'] )
179 ? ( $old_tweaks['notification'] ? 'enabled' : 'disabled' )
180 : 'disabled',
181 // Prepare from 'notification_repeat' to configs['reminder'] with default value 'weekly'.
182 'notification_repeat' => empty( $old_tweaks['notification_repeat'] )
183 ? 'weekly'
184 : ( $old_tweaks['notification_repeat'] ? 'daily' : 'weekly' ),
185 'data' => $old_tweaks['data'] ?? array(),
186 );
187 if ( isset( $old_tweaks['last_sent'] ) ) {
188 $security_tweaks['last_sent'] = $old_tweaks['last_sent'];
189 }
190
191 $security_tweaks['subscribers'] = isset( $old_tweaks['receipts'] )
192 ? $this->get_subscribers( $old_tweaks['receipts'] )
193 : array();
194
195 return $security_tweaks;
196 }
197
198 /**
199 * Updates the scan configuration from the old format to the new format.
200 *
201 * @param array $old_data The old scan configuration.
202 *
203 * @return array
204 */
205 public function update_scan( array $old_data ): array {
206 $scan = array(
207 'integrity_check' => empty( $old_data['scan_core'] ) ? true : $old_data['scan_core'],
208 'check_core' => empty( $old_data['check_core'] ) ? true : $old_data['check_core'],
209 'check_plugins' => empty( $old_data['check_plugins'] ) ? false : $old_data['check_plugins'],
210 'check_known_vuln' => empty( $old_data['scan_vuln'] ) ? true : $old_data['scan_vuln'],
211 'scan_malware' => empty( $old_data['scan_content'] ) ? false : $old_data['scan_content'],
212 'filesize' => empty( $old_data['max_filesize'] ) ? 3 : $old_data['max_filesize'],
213 // Should get bool value.
214 'report' => isset( $old_data['report'] ) && $old_data['report'] ? 'enabled' : 'disabled',
215 'always_send' => empty( $old_data['always_send'] ) ? false : $old_data['always_send'],
216 'time' => empty( $old_data['time'] ) ? '4:00' : $old_data['time'],
217 'frequency' => empty( $old_data['frequency'] )
218 ? 'weekly'
219 : $this->frequency_type( $old_data['frequency'] ),
220 // Should get bool value.
221 'notification' => isset( $old_data['notification'] ) && $old_data['notification']
222 ? 'enabled'
223 : 'disabled',
224 'always_send_notification' => empty( $old_data['always_send_notification'] )
225 ? false
226 : $old_data['always_send_notification'],
227 'error_send' => empty( $old_data['error_send'] ) ? false : $old_data['error_send'],
228 'email_subject_issue_found' => $old_data['email_subject_issue'] ?? '',
229 'email_subject_issue_not_found' => $old_data['email_subject'] ?? '',
230 'email_subject_error' => $old_data['email_subject_error'] ?? '',
231 'email_content_issue_found' => $old_data['email_has_issue'] ?? '',
232 'email_content_issue_not_found' => $old_data['email_all_ok'] ?? '',
233 'email_content_error' => $old_data['email_content_error'] ?? '',
234 // since 2.7.0.
235 'scheduled_scanning' => false,
236 );
237
238 $scan['report_subscribers'] = empty( $old_data['recipients'] )
239 ? array()
240 : $this->get_subscribers( $old_data['recipients'] );
241 $scan['notification_subscribers'] = empty( $old_data['recipients_notification'] )
242 ? array()
243 : $this->get_subscribers( $old_data['recipients_notification'] );
244 // Todo: need the key 'last_report_sent'? It's no always in the unixtime format.
245 if ( empty( $old_data['frequency'] ) ) {
246 $scan['day'] = 'sunday';
247 $scan['day_n'] = '1';
248
249 return $scan;
250 } else {
251 return array_merge( $scan, $this->frequency_day( $old_data['frequency'], $old_data['day'] ) );
252 }
253 }
254
255 /**
256 * Updates the IP lockout configuration from the old format to the new format.
257 *
258 * @param array $old_data The old IP lockout configuration.
259 *
260 * @return array
261 */
262 public function update_ip_lockout( array $old_data ): array {
263 $merged_bl_file_data = $old_data['detect_404_blacklist'] ?? '';
264 // Merge blacklist file & filetype data.
265 if ( isset( $old_data['detect_404_filetypes_blacklist'] ) && '' !== trim( $old_data['detect_404_filetypes_blacklist'] ) ) {
266 $merged_bl_file_data .= PHP_EOL . $old_data['detect_404_filetypes_blacklist'];
267 }
268 $merged_wl_file_data = $old_data['detect_404_whitelist'] ?? '';
269 // Merge whitelist file & filetype data.
270 if ( isset( $old_data['detect_404_whitelist'] ) && '' !== trim( $old_data['detect_404_ignored_filetypes'] ) ) {
271 $merged_wl_file_data .= PHP_EOL . $old_data['detect_404_ignored_filetypes'];
272 }
273
274 $default_login_lockout_values = ( new Model_Login_Lockout() )->get_default_values();
275 $default_404_lockout_values = ( new Model_Notfound_Lockout() )->get_default_values();
276 $default_ip_lockout_values = ( new Model_Blacklist_Lockout() )->get_default_values();
277 $default_ua_lockout_values = ( new Model_Ua_Lockout() )->get_default_values();
278
279 $iplockout = array(
280 'login_protection' => empty( $old_data['login_protection'] )
281 ? true : $old_data['login_protection'],
282 'login_protection_login_attempt' => empty( $old_data['login_protection_login_attempt'] )
283 ? '5' : $old_data['login_protection_login_attempt'],
284 'login_protection_lockout_timeframe' => empty( $old_data['login_protection_lockout_timeframe'] )
285 ? '300' : $old_data['login_protection_lockout_timeframe'],
286 'login_protection_lockout_ban' => empty( $old_data['login_protection_lockout_ban'] )
287 ? false : $old_data['login_protection_lockout_ban'],
288 'login_protection_lockout_duration' => empty( $old_data['login_protection_lockout_duration'] )
289 ? '4' : $old_data['login_protection_lockout_duration'],
290 'login_protection_lockout_duration_unit' => empty( $old_data['login_protection_lockout_duration_unit'] )
291 ? 'hours' : $old_data['login_protection_lockout_duration_unit'],
292 'login_protection_lockout_message' => empty( $old_data['login_protection_lockout_message'] )
293 ? $default_login_lockout_values['message']
294 : $old_data['login_protection_lockout_message'],
295 'username_blacklist' => empty( $old_data['username_blacklist'] )
296 ? '' : $old_data['username_blacklist'],
297 'detect_404' => empty( $old_data['detect_404'] )
298 ? true : $old_data['detect_404'],
299 'detect_404_threshold' => empty( $old_data['detect_404_threshold'] )
300 ? '20' : $old_data['detect_404_threshold'],
301 'detect_404_timeframe' => empty( $old_data['detect_404_timeframe'] )
302 ? '300' : $old_data['detect_404_timeframe'],
303 'detect_404_lockout_ban' => empty( $old_data['detect_404_lockout_ban'] )
304 ? false : $old_data['detect_404_lockout_ban'],
305 'detect_404_lockout_duration' => empty( $old_data['detect_404_lockout_duration'] )
306 ? '4' : $old_data['detect_404_lockout_duration'],
307 'detect_404_lockout_duration_unit' => empty( $old_data['detect_404_lockout_duration_unit'] )
308 ? 'hours' : $old_data['detect_404_lockout_duration_unit'],
309 'detect_404_lockout_message' => empty( $old_data['detect_404_lockout_message'] )
310 ? $default_404_lockout_values['message']
311 : $old_data['detect_404_lockout_message'],
312 'detect_404_blacklist' => $merged_bl_file_data,
313 'detect_404_whitelist' => $merged_wl_file_data,
314 'detect_404_logged' => empty( $old_data['detect_404_logged'] )
315 ? true : $old_data['detect_404_logged'],
316 'ip_blacklist' => empty( $old_data['ip_blacklist'] )
317 ? '' : $old_data['ip_blacklist'],
318 'ip_whitelist' => empty( $old_data['ip_whitelist'] )
319 ? '' : $old_data['ip_whitelist'],
320 'country_blacklist' => empty( $old_data['country_blacklist'] )
321 ? '' : $old_data['country_blacklist'],
322 'country_whitelist' => empty( $old_data['country_whitelist'] )
323 ? '' : $old_data['country_whitelist'],
324 'ip_lockout_message' => empty( $old_data['ip_lockout_message'] )
325 ? $default_ip_lockout_values['message']
326 : $old_data['ip_lockout_message'],
327 'login_lockout_notification' => empty( $old_data['login_lockout_notification'] )
328 ? true : $old_data['login_lockout_notification'],
329 'ip_lockout_notification' => empty( $old_data['ip_lockout_notification'] )
330 ? true : $old_data['ip_lockout_notification'],
331 'notification' => 'enabled',
332 'cooldown_enabled' => empty( $old_data['cooldown_enabled'] )
333 ? false : $old_data['cooldown_enabled'],
334 'cooldown_number_lockout' => empty( $old_data['cooldown_number_lockout'] )
335 ? '3' : $old_data['cooldown_number_lockout'],
336 'cooldown_period' => empty( $old_data['cooldown_period'] )
337 ? '24' : $old_data['cooldown_period'],
338 'report' => isset( $old_data['report'] ) && $old_data['report'] ? 'enabled' : 'disabled',
339 'report_frequency' => empty( $old_data['report_frequency'] )
340 ? 'weekly'
341 : $this->frequency_type( $old_data['report_frequency'] ),
342 // Data for 'day' below.
343 'report_time' => empty( $old_data['report_time'] )
344 ? '4:00' : $old_data['report_time'],
345 'storage_days' => empty( $old_data['storage_days'] )
346 ? '180' : $old_data['storage_days'],
347 'geoIP_db' => $old_data['geoIP_db'] ?? '',
348 'ip_blocklist_cleanup_interval' => empty( $old_data['ip_blocklist_cleanup_interval'] )
349 ? 'never' : $old_data['ip_blocklist_cleanup_interval'],
350 // For UA Banning.
351 'ua_banning_enabled' => $old_data['ua_banning_enabled'] ?? false,
352 'ua_banning_message' => $old_data['ua_banning_message'] ?? $default_ua_lockout_values['message'],
353 'ua_banning_blacklist' => $old_data['ua_banning_blacklist'] ?? $default_ua_lockout_values['blacklist'],
354 'ua_banning_whitelist' => $old_data['ua_banning_whitelist'] ?? $default_ua_lockout_values['whitelist'],
355 'ua_banning_empty_headers' => $old_data['ua_banning_empty_headers'] ?? false,
356 'maxmind_license_key' => $old_data['maxmind_license_key'] ?? '',
357 // Global IP list.
358 'global_ip_list' => $old_data['global_ip_list'] ?? false,
359 'global_ip_list_blocklist_autosync' => $old_data['global_ip_list_blocklist_autosync'] ?? false,
360 );
361 if ( isset( $old_data['lastReportSent'] ) && ! empty( $old_data['lastReportSent'] ) ) {
362 $iplockout['last_sent'] = $old_data['lastReportSent'];
363 }
364
365 $iplockout['report_subscribers'] = empty( $old_data['report_receipts'] )
366 ? array()
367 : $this->get_subscribers( $old_data['report_receipts'] );
368 $iplockout['notification_subscribers'] = empty( $old_data['receipts'] )
369 ? array()
370 : $this->get_subscribers( $old_data['receipts'] );
371
372 if ( empty( $old_data['report_frequency'] ) ) {
373 $iplockout['day'] = 'sunday';
374 $iplockout['day_n'] = '1';
375
376 return $iplockout;
377 } else {
378 return array_merge(
379 $iplockout,
380 $this->frequency_day( $old_data['report_frequency'], $old_data['report_day'] )
381 );
382 }
383 }
384
385 /**
386 * Updates the audit configuration from the old format to the new format.
387 *
388 * @param array $old_data The old audit configuration.
389 *
390 * @return array
391 */
392 public function update_audit( array $old_data ): array {
393 $audit = array(
394 'enabled' => is_bool( $old_data['enabled'] )
395 ? $old_data['enabled']
396 : (bool) $old_data['enabled'],
397 'report' => isset( $old_data['notification'] ) && $old_data['notification'] ? 'enabled' : 'disabled',
398 'frequency' => empty( $old_data['frequency'] )
399 ? 'weekly'
400 : $this->frequency_type( $old_data['frequency'] ),
401 'time' => empty( $old_data['time'] )
402 ? '4:00'
403 : $old_data['time'],
404 'storage_days' => empty( $old_data['storage_days'] )
405 ? '6 months'
406 : $old_data['storage_days'],
407 );
408 if ( isset( $old_data['lastReportSent'] ) && ! empty( $old_data['lastReportSent'] ) ) {
409 $audit['last_sent'] = $old_data['lastReportSent'];
410 }
411
412 $audit['subscribers'] = empty( $old_data['receipts'] )
413 ? array()
414 : $this->get_subscribers( $old_data['receipts'] );
415
416 if ( empty( $old_data['frequency'] ) ) {
417 $audit['day'] = 'sunday';
418 $audit['day_n'] = '1';
419
420 return $audit;
421 } else {
422 return array_merge( $audit, $this->frequency_day( $old_data['frequency'], $old_data['day'] ) );
423 }
424 }
425
426 /**
427 * Updates the two-factor authentication configuration from the old format to the new format.
428 *
429 * @param array $old_data The old two-factor authentication configuration.
430 *
431 * @return array
432 */
433 public function update_two_factor( array $old_data ): array {
434
435 return array(
436 'enabled' => $old_data['enabled'],
437 'lost_phone' => $old_data['lost_phone'],
438 'force_auth' => $old_data['force_auth'],
439 'force_auth_mess' => $old_data['force_auth_mess'],
440 'user_roles' => $old_data['user_roles'],
441 'force_auth_roles' => $old_data['force_auth_roles'],
442 'custom_graphic' => $old_data['custom_graphic'],
443 'custom_graphic_type' => $old_data['custom_graphic_type'] ?? Two_Fa::CUSTOM_GRAPHIC_TYPE_UPLOAD,
444 'custom_graphic_url' => $old_data['custom_graphic_url'] ?? '',
445 'custom_graphic_link' => $old_data['custom_graphic_link'] ?? '',
446 'email_subject' => $old_data['email_subject'] ?? '',
447 'email_sender' => $old_data['email_sender'] ?? '',
448 'email_body' => $old_data['email_body'] ?? '',
449 'app_title' => '',
450 );
451 }
452
453 /**
454 * Updates the mask login configuration from the old format to the new format.
455 *
456 * @param array $old_data The old mask login configuration.
457 *
458 * @return array
459 */
460 public function update_mask_login( array $old_data ): array {
461 if ( empty( $old_data ) ) {
462 // Sometimes migrated data is empty.
463 return array(
464 'mask_url' => '',
465 'redirect_traffic' => 'off',
466 'redirect_traffic_url' => '',
467 'enabled' => false,
468 'redirect_traffic_page_id' => 0,
469 );
470 } else {
471
472 return array(
473 'enabled' => $old_data['enabled'],
474 'mask_url' => $old_data['mask_url'] ?? '',
475 'redirect_traffic' => $old_data['redirect_traffic'] ? 'custom_url' : 'off',
476 'redirect_traffic_url' => $old_data['redirect_traffic_url'] ?? '',
477 'redirect_traffic_page_id' => 0,
478 );
479 }
480 }
481
482 /**
483 * Updates the security headers configuration from the old format to the new format.
484 *
485 * @param array $old_data The old security headers configuration.
486 *
487 * @return array
488 * @since 2.5.0 Remove 'ALLOW-FROM' directive and move to 'sameorigin' by default.
489 * Leave 'sh_xframe_urls' for config migration.
490 */
491 public function update_security_headers( array $old_data ): array {
492 if ( empty( $old_data ) ) {
493 // Sometimes migrated data is empty.
494 $model_sec_headers = new Security_Headers();
495
496 return array(
497 'sh_xframe' => $model_sec_headers->sh_xframe,
498 'sh_xframe_mode' => $model_sec_headers->sh_xframe_mode,
499 // Leave for migration to 2.5.1.
500 'sh_xframe_urls' => '',
501 'sh_xss_protection' => $model_sec_headers->sh_xss_protection,
502 'sh_xss_protection_mode' => $model_sec_headers->sh_xss_protection_mode,
503 'sh_content_type_options' => $model_sec_headers->sh_content_type_options,
504 'sh_content_type_options_mode' => $model_sec_headers->sh_content_type_options_mode,
505 'sh_strict_transport' => $model_sec_headers->sh_strict_transport,
506 'hsts_preload' => $model_sec_headers->hsts_preload,
507 'include_subdomain' => $model_sec_headers->include_subdomain,
508 'hsts_cache_duration' => $model_sec_headers->hsts_cache_duration,
509 'sh_referrer_policy' => $model_sec_headers->sh_referrer_policy,
510 'sh_referrer_policy_mode' => $model_sec_headers->sh_referrer_policy_mode,
511 'sh_feature_policy' => $model_sec_headers->sh_feature_policy,
512 'sh_feature_policy_mode' => $model_sec_headers->sh_feature_policy_mode,
513 'sh_feature_policy_urls' => $model_sec_headers->sh_feature_policy_urls,
514 );
515 } else {
516
517 return array(
518 'sh_xframe' => (bool) $old_data['sh_xframe'],
519 'sh_xframe_mode' => $old_data['sh_xframe_mode'],
520 // Leave for migration to 2.5.1.
521 'sh_xframe_urls' => $old_data['sh_xframe_urls'] ?? '',
522 'sh_xss_protection' => (bool) $old_data['sh_xss_protection'],
523 'sh_xss_protection_mode' => $old_data['sh_xss_protection_mode'],
524 'sh_content_type_options' => (bool) $old_data['sh_content_type_options'],
525 'sh_content_type_options_mode' => $old_data['sh_content_type_options_mode'],
526 'sh_strict_transport' => (bool) $old_data['sh_strict_transport'],
527 'hsts_preload' => $old_data['hsts_preload'],
528 'include_subdomain' => $old_data['include_subdomain'],
529 'hsts_cache_duration' => $old_data['hsts_cache_duration'],
530 'sh_referrer_policy' => (bool) $old_data['sh_referrer_policy'],
531 'sh_referrer_policy_mode' => $old_data['sh_referrer_policy_mode'],
532 'sh_feature_policy' => (bool) $old_data['sh_feature_policy'],
533 'sh_feature_policy_mode' => $old_data['sh_feature_policy_mode'],
534 'sh_feature_policy_urls' => $old_data['sh_feature_policy_urls'],
535 );
536 }
537 }
538 }
539