| 1 |
<?php |
| 2 |
if (!defined('ABSPATH')) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
?> |
| 6 |
<tr valign="top"> |
| 7 |
<th scope="row">Expect-CT |
| 8 |
<p class="description"><?php esc_html_e('Expect-CT is an HTTP header that allows sites to opt in to reporting and/or enforcement of Certificate Transparency requirements, which prevents the use of misissued certificates for that site from going unnoticed. When a site enables the Expect-CT header, they are requesting that Chrome check that any certificate for that site appears in public CT logs.', 'http-headers'); ?></p> |
| 9 |
<hr> |
| 10 |
<p class="description"><?php esc_html_e('Read more at', 'http-headers'); ?> |
| 11 |
<a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expect-CT"><?php esc_html_e('MDN Web Docs', 'http-headers'); ?></a> |
| 12 |
</p> |
| 13 |
</th> |
| 14 |
<td> |
| 15 |
<fieldset> |
| 16 |
<legend class="screen-reader-text">Expect-CT</legend> |
| 17 |
<?php |
| 18 |
$http_headers_expect_ct = get_option('hh_expect_ct', 0); |
| 19 |
foreach ($http_headers_bools as $http_headers_k => $http_headers_v) |
| 20 |
{ |
| 21 |
?><p><label><input type="radio" class="http-header" name="hh_expect_ct" value="<?php echo esc_attr($http_headers_k); ?>"<?php checked($http_headers_expect_ct, $http_headers_k, true); ?> /> <?php echo esc_html($http_headers_v); ?></label></p><?php |
| 22 |
} |
| 23 |
?> |
| 24 |
</fieldset> |
| 25 |
</td> |
| 26 |
<td> |
| 27 |
<?php settings_fields( 'http-headers-ect' ); ?> |
| 28 |
<?php do_settings_sections( 'http-headers-ect' ); ?> |
| 29 |
<table> |
| 30 |
<tr> |
| 31 |
<td>max-age:</td> |
| 32 |
<td><select name="hh_expect_ct_max_age" class="http-header-value"<?php echo $http_headers_expect_ct == 1 ? NULL : ' readonly'; ?>> |
| 33 |
<?php |
| 34 |
$http_headers_items = array('3600' => '1 hour', '86400' => '1 day', '604800' => '7 days', '2592000' => '30 days', '5184000' => '60 days', '7776000' => '90 days', '31536000' => '1 year'); |
| 35 |
$http_headers_expect_ct_max_age = get_option('hh_expect_ct_max_age'); |
| 36 |
foreach ($http_headers_items as $http_headers_key => $http_headers_item) { |
| 37 |
?><option value="<?php echo esc_attr($http_headers_key); ?>"<?php selected($http_headers_expect_ct_max_age, $http_headers_key); ?>><?php echo esc_html($http_headers_item); ?></option><?php |
| 38 |
} |
| 39 |
?> |
| 40 |
</select></td> |
| 41 |
</tr> |
| 42 |
<tr> |
| 43 |
<td>report-uri:</td> |
| 44 |
<td><input type="text" class="http-header-value" name="hh_expect_ct_report_uri" value="<?php echo esc_attr(get_option('hh_expect_ct_report_uri')); ?>" placeholder="https://example.com/ct-report"<?php echo $http_headers_expect_ct == 1 ? NULL : ' readonly'; ?> /></td> |
| 45 |
</tr> |
| 46 |
<tr> |
| 47 |
<td>enforce:</td> |
| 48 |
<td><input type="checkbox" class="http-header-value" name="hh_expect_ct_enforce" value="1"<?php checked(get_option('hh_expect_ct_enforce'), 1, true); ?><?php echo $http_headers_expect_ct == 1 ? NULL : ' readonly'; ?> /></td> |
| 49 |
</tr> |
| 50 |
</table> |
| 51 |
</td> |
| 52 |
</tr> |