| 1 |
<?php |
| 2 |
if (!defined('ABSPATH')) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
?> |
| 6 |
<tr> |
| 7 |
<th scope="row">Content-Encoding |
| 8 |
<p class="description"><?php _e('Compression is an important way to increase the performance of a Web site. For some documents, size reduction of up to 70% lowers the bandwidth capacity needs.', 'http-headers'); ?></p> |
| 9 |
</th> |
| 10 |
<td> |
| 11 |
<fieldset> |
| 12 |
<legend class="screen-reader-text">Content-Encoding</legend> |
| 13 |
<?php |
| 14 |
$content_encoding = get_option('hh_content_encoding', 0); |
| 15 |
foreach ($bools as $k => $v) |
| 16 |
{ |
| 17 |
?><p><label><input type="radio" class="http-header" name="hh_content_encoding" value="<?php echo $k; ?>"<?php checked($content_encoding, $k); ?> /> <?php echo $v; ?></label></p><?php |
| 18 |
} |
| 19 |
?> |
| 20 |
</fieldset> |
| 21 |
</td> |
| 22 |
<td> |
| 23 |
<?php settings_fields( 'http-headers-ce' ); ?> |
| 24 |
<?php do_settings_sections( 'http-headers-ce' ); ?> |
| 25 |
<table> |
| 26 |
<tbody><tr> |
| 27 |
<th colspan="2"><?php _e('By content type', 'http-headers'); ?></th> |
| 28 |
</tr><tr> |
| 29 |
<?php |
| 30 |
$items = array( |
| 31 |
'application/javascript', |
| 32 |
'application/x-javascript', |
| 33 |
'application/json', |
| 34 |
'application/ld+json', |
| 35 |
'application/manifest+json', |
| 36 |
'application/rdf+xml', |
| 37 |
'application/rss+xml', |
| 38 |
'application/schema+json', |
| 39 |
'application/vnd.geo+json', |
| 40 |
'application/x-web-app-manifest+json', |
| 41 |
'application/vnd.ms-fontobject', |
| 42 |
'application/x-font-ttf', |
| 43 |
'application/xhtml+xml', |
| 44 |
'application/xml', |
| 45 |
'font/opentype', |
| 46 |
'font/eot', |
| 47 |
'image/bmp', |
| 48 |
'image/svg+xml', |
| 49 |
'image/x-icon', |
| 50 |
'image/vnd.microsoft.icon', |
| 51 |
'text/javascript', |
| 52 |
'text/css', |
| 53 |
'text/html', |
| 54 |
'text/plain', |
| 55 |
'text/x-component', |
| 56 |
'text/xml', |
| 57 |
); |
| 58 |
$content_encoding_value = get_option('hh_content_encoding_value'); |
| 59 |
if (!$content_encoding_value) { |
| 60 |
$content_encoding_value = array(); |
| 61 |
} |
| 62 |
foreach ($items as $i => $item) { |
| 63 |
if ($i > 0 && $i % 2 === 0) { |
| 64 |
?></tr><tr><?php |
| 65 |
} |
| 66 |
?><td><label><input type="checkbox" class="http-header-value" name="hh_content_encoding_value[<?php echo $item; ?>]" value="1"<?php echo !array_key_exists($item, $content_encoding_value) ? NULL : ' checked'; ?><?php echo $content_encoding == 1 ? NULL : ' readonly'; ?> /> <?php echo $item; ?></label></td><?php |
| 67 |
} |
| 68 |
?> |
| 69 |
</tr> |
| 70 |
|
| 71 |
<tr> |
| 72 |
<th colspan="2"><?php _e('By extension', 'http-headers'); ?></th> |
| 73 |
</tr> |
| 74 |
<tr> |
| 75 |
<?php |
| 76 |
$content_encoding_ext = get_option('hh_content_encoding_ext'); |
| 77 |
if (!$content_encoding_ext) { |
| 78 |
$content_encoding_ext = array(); |
| 79 |
} |
| 80 |
$items = array('php', 'html', 'js', 'css', 'json', 'xml', 'svg', 'txt', 'bmp', 'ico', 'ttf', 'otf', 'eot'); |
| 81 |
foreach ($items as $i => $item) { |
| 82 |
if ($i > 0 && $i % 2 === 0) { |
| 83 |
?></tr><tr><?php |
| 84 |
} |
| 85 |
?><td><label><input type="checkbox" class="http-header-value" name="hh_content_encoding_ext[<?php echo $item; ?>]" value="1"<?php echo !array_key_exists($item, $content_encoding_ext) ? NULL : ' checked'; ?><?php echo $content_encoding == 1 ? NULL : ' readonly'; ?> /> *.<?php echo $item; ?></label></td><?php |
| 86 |
} |
| 87 |
?> |
| 88 |
</tr> |
| 89 |
|
| 90 |
</tbody></table> |
| 91 |
</td> |
| 92 |
</tr> |