PluginProbe
HTTP Headers / 1.15.0
HTTP Headers v1.15.0
1.19.5 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.11.0 1.12.0 1.12.1 1.12.2 1.13.0 1.13.1 1.13.2 1.13.3 1.13.4 1.14.0 1.14.1 1.14.2 1.15.0 All 60 releases
http-headers / views / content-encoding.php

content-encoding.php in HTTP Headers 1.15.0, at views/content-encoding.php

118 lines 4.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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>
27 <tr>
28 <th colspan="2"><?php _e('Module', 'http-headers'); ?></th>
29 </tr>
30 <?php
31 $content_encoding_module = get_option('hh_content_encoding_module');
32 ?>
33 <tr>
34 <td colspan="2" class="hh-td-inner">
35 <table style="width: 100%">
36 <tbody>
37 <tr>
38 <td>
39 <label><input type="radio" name="hh_content_encoding_module" value="deflate"<?php echo $content_encoding_module == 'deflate' || !$content_encoding_module ? ' checked' : NULL; ?>> <?php _e('DEFLATE', 'http-headers'); ?></label>
40 </td>
41 <td>
42 <label><input type="radio" name="hh_content_encoding_module" value="brotli"<?php checked($content_encoding_module, 'brotli'); ?>> <?php _e('BROTLI', 'http-headers'); ?></label>
43 </td>
44 <td>
45 <label><input type="radio" name="hh_content_encoding_module" value="brotli_deflate"<?php checked($content_encoding_module, 'brotli_deflate'); ?>> <?php _e('BROTLI; DEFLATE', 'http-headers'); ?></label>
46 </td>
47 </tr>
48 </tbody>
49 </table>
50 </td>
51 </tr>
52 <tr>
53 <th colspan="2"><?php _e('By content type', 'http-headers'); ?></th>
54 </tr><tr>
55 <?php
56 $items = array(
57 'application/javascript',
58 'application/x-javascript',
59 'application/json',
60 'application/ld+json',
61 'application/manifest+json',
62 'application/rdf+xml',
63 'application/rss+xml',
64 'application/schema+json',
65 'application/vnd.geo+json',
66 'application/x-web-app-manifest+json',
67 'application/vnd.ms-fontobject',
68 'application/x-font-ttf',
69 'application/xhtml+xml',
70 'application/xml',
71 'font/opentype',
72 'font/eot',
73 'image/bmp',
74 'image/svg+xml',
75 'image/x-icon',
76 'image/vnd.microsoft.icon',
77 'text/javascript',
78 'text/css',
79 'text/html',
80 'text/plain',
81 'text/x-component',
82 'text/xml',
83 );
84 $content_encoding_value = get_option('hh_content_encoding_value');
85 if (!$content_encoding_value) {
86 $content_encoding_value = array();
87 }
88 foreach ($items as $i => $item) {
89 if ($i > 0 && $i % 2 === 0) {
90 ?></tr><tr><?php
91 }
92 ?><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
93 }
94 ?>
95 </tr>
96
97 <tr>
98 <th colspan="2"><?php _e('By extension', 'http-headers'); ?></th>
99 </tr>
100 <tr>
101 <?php
102 $content_encoding_ext = get_option('hh_content_encoding_ext');
103 if (!$content_encoding_ext) {
104 $content_encoding_ext = array();
105 }
106 $items = array('php', 'html', 'js', 'css', 'json', 'xml', 'svg', 'txt', 'bmp', 'ico', 'ttf', 'otf', 'eot');
107 foreach ($items as $i => $item) {
108 if ($i > 0 && $i % 2 === 0) {
109 ?></tr><tr><?php
110 }
111 ?><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
112 }
113 ?>
114 </tr>
115
116 </tbody></table>
117 </td>
118 </tr>