| 1 |
<?php |
| 2 |
if (!defined('ABSPATH')) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
?> |
| 6 |
<tr valign="top"> |
| 7 |
<th scope="row">Strict-Transport-Security |
| 8 |
<p class="description"><?php _e("HTTP Strict-Transport-Security (HSTS) enforces secure (HTTP over SSL/TLS) connections to the server. This reduces impact of bugs in web applications leaking session data through cookies and external links and defends against Man-in-the-middle attacks. HSTS also disables the ability for user's to ignore SSL negotiation warnings.", 'http-headers'); ?></p> |
| 9 |
</th> |
| 10 |
<td> |
| 11 |
<fieldset> |
| 12 |
<legend class="screen-reader-text">Strict-Transport-Security</legend> |
| 13 |
<?php |
| 14 |
$strict_transport_security = get_option('hh_strict_transport_security', 0); |
| 15 |
foreach ($bools as $k => $v) |
| 16 |
{ |
| 17 |
?><p><label><input type="radio" class="http-header" name="hh_strict_transport_security" value="<?php echo $k; ?>"<?php checked($strict_transport_security, $k, true); ?> /> <?php echo $v; ?></label></p><?php |
| 18 |
} |
| 19 |
?> |
| 20 |
</fieldset> |
| 21 |
</td> |
| 22 |
<td> |
| 23 |
<?php settings_fields( 'http-headers-sts' ); ?> |
| 24 |
<?php do_settings_sections( 'http-headers-sts' ); ?> |
| 25 |
<table> |
| 26 |
<tr> |
| 27 |
<td>max-age:</td> |
| 28 |
<td><select name="hh_strict_transport_security_max_age" class="http-header-value"<?php echo $strict_transport_security == 1 ? NULL : ' readonly'; ?>> |
| 29 |
<?php |
| 30 |
$items = array('0' => '0 (Delete entire HSTS Policy)', '3600' => '1 hour', '86400' => '1 day', '604800' => '7 days', '2592000' => '30 days', '5184000' => '60 days', '7776000' => '90 days', '31536000' => '1 year', '63072000' => '2 years'); |
| 31 |
$strict_transport_security_max_age = get_option('hh_strict_transport_security_max_age'); |
| 32 |
foreach ($items as $key => $item) { |
| 33 |
?><option value="<?php echo $key; ?>"<?php selected($strict_transport_security_max_age, $key); ?>><?php echo $item; ?></option><?php |
| 34 |
} |
| 35 |
?> |
| 36 |
</select></td> |
| 37 |
</tr> |
| 38 |
<tr> |
| 39 |
<td>includeSubDomains:</td> |
| 40 |
<td><input type="checkbox" class="http-header-value" name="hh_strict_transport_security_sub_domains" value="1"<?php checked(get_option('hh_strict_transport_security_sub_domains'), 1, true); ?><?php echo $strict_transport_security == 1 ? NULL : ' readonly'; ?> /></td> |
| 41 |
</tr> |
| 42 |
<tr> |
| 43 |
<td>preload:</td> |
| 44 |
<td><input type="checkbox" class="http-header-value" name="hh_strict_transport_security_preload" value="1"<?php checked(get_option('hh_strict_transport_security_preload'), 1, true); ?><?php echo $strict_transport_security == 1 ? NULL : ' readonly'; ?> /></td> |
| 45 |
</tr> |
| 46 |
</table> |
| 47 |
</td> |
| 48 |
</tr> |