7a91fd51 by Jeff Balicki

headers

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent a0f557c1
Showing 73 changed files with 4629 additions and 84 deletions
1 msgid ""
2 msgstr ""
3 "Project-Id-Version: Headers Security Advanced & HSTS WP\n"
4 "POT-Creation-Date: 2021-11-04 20:22+0000\n"
5 "PO-Revision-Date: \n"
6 "Language-Team: \n"
7 "MIME-Version: 1.0\n"
8 "Content-Type: text/plain; charset=UTF-8\n"
9 "Content-Transfer-Encoding: 8bit\n"
10 "X-Generator: Poedit 2.4.2\n"
11 "X-Poedit-Basepath: .\n"
12 "X-Poedit-KeywordsList: _e;__\n"
13 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
14 "Last-Translator: \n"
15 "Language: it\n"
16 "X-Poedit-SearchPath-0: ..\n"
17
18 #: ../includes/headers-security-advanced-hsts-admin-login.php:109
19 msgid "Please upgrade to the latest version of WordPress to activate"
20 msgstr "Effettua l’aggiornamento all’ultima versione di WordPress"
21
22 #. Plugin Name
23 #: ../includes/headers-security-advanced-hsts-admin-login.php:109
24 #: ../includes/headers-security-advanced-hsts-admin-login.php:141
25 #: ../includes/headers-security-advanced-hsts-admin-login.php:168
26 msgid "Headers Security Advanced & HSTS WP"
27 msgstr "Headers Security Advanced & HSTS WP"
28
29 #: ../includes/headers-security-advanced-hsts-admin-login.php:142
30 msgid ""
31 "This option allows you to set a networkwide default, which can be overridden "
32 "by individual sites. Simply go to to the site’s permalink settings to change "
33 "the url."
34 msgstr ""
35 "Questa opzione consente di impostare un valore predefinito per l’intera "
36 "rete, che può essere ignorato dai singoli siti. Basta andare alle "
37 "impostazioni permalink del sito per modificare l’URL."
38
39 #: ../includes/headers-security-advanced-hsts-admin-login.php:145
40 msgid "Networkwide default"
41 msgstr "Predefinito per l’intera rete"
42
43 #: ../includes/headers-security-advanced-hsts-admin-login.php:175
44 msgid "Login url"
45 msgstr "Url di accesso"
46
47 #: ../includes/headers-security-advanced-hsts-admin-login.php:183
48 msgid "Redirect URL"
49 msgstr "
50
51 #: ../includes/headers-security-advanced-hsts-admin-login.php:226
52 #, php-format
53 msgid ""
54 "To set a networkwide default, go to <a href=\"%s\">Network Settings</a>."
55 msgstr ""
56 "Per impostare una rete predefinita ampia, andate a <a href=\\”%s"
57 "\\”>Impostazioni di rete</a>."
58
59 #: ../includes/headers-security-advanced-hsts-admin-login.php.php:235
60 msgid "Use the slug name, example: "contact-me" - DO NOT USE the full website URL. If you leave the above field empty the plugin will add a redirect to the website homepage."
61 msgstr ""
62
63 #: ../includes/headers-security-advanced-hsts-admin-login.php:250
64 #, php-format
65 msgid ""
66 "Your login page is now here: <strong><a href=\"%1$s\">%2$s</a></strong>. "
67 "Bookmark this page!"
68 msgstr ""
69 "La tua pagina di accesso adesso si trova qui: <strong><a href=\\”%1$s\\”>"
70 "%2$s</a></strong>. Metti questa pagina nei preferiti!"
71
72 #: ../includes/headers-security-advanced-hsts-admin-login.php:256
73 #: ../includes/headers-security-advanced-hsts-admin-login.php:258
74 msgid "Settings"
75 msgstr "Impostazioni"
76
77 #: ../includes/headers-security-advanced-hsts-admin-login.php:275
78 msgid "This feature is not enabled."
79 msgstr "Questa funzione non è abilitata."
1 === HTTP Headers ===
2 Contributors: zinoui
3 Donate link: https://zinoui.com/donation
4 Tags: custom headers, http headers, headers, security, http header, header, cross domain, cors, xss, clickjacking, mitm, cross origin, cross site, privacy, p3p, hsts, referrer, csp, caching, compression, access control, authentication
5 Requires at least: 3.2
6 Tested up to: 5.7.1
7 Requires PHP: 5.3
8 Stable tag: 1.18.5
9 License: GPLv2 or later
10 License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
12 HTTP Headers adds CORS & security HTTP headers to your website.
13
14 == Description ==
15
16 HTTP Headers gives your control over the http headers returned by your blog or website.
17
18 Headers supported by HTTP Headers includes:
19
20 - Access-Control-Allow-Origin
21 - Access-Control-Allow-Credentials
22 - Access-Control-Max-Age
23 - Access-Control-Allow-Methods
24 - Access-Control-Allow-Headers
25 - Access-Control-Expose-Headers
26 - Age
27 - Content-Security-Policy
28 - Content-Security-Policy-Report-Only
29 - Cache-Control
30 - Clear-Site-Data
31 - Connection
32 - Content-Encoding
33 - Content-Type
34 - Cross-Origin-Embedder-Policy
35 - Cross-Origin-Opener-Policy
36 - Cross-Origin-Resource-Policy
37 - Expect-CT
38 - Expires
39 - Feature-Policy
40 - NEL
41 - Permissions-Policy
42 - Pragma
43 - P3P
44 - Referrer-Policy
45 - Report-To
46 - Strict-Transport-Security
47 - Timing-Allow-Origin
48 - Vary
49 - WWW-Authenticate
50 - X-Content-Type-Options
51 - X-DNS-Prefetch-Control
52 - X-Download-Options
53 - X-Frame-Options
54 - X-Permitted-Cross-Domain-Policies
55 - X-Powered-By
56 - X-Robots-Tag
57 - X-UA-Compatible
58 - X-XSS-Protection
59
60 The [getting started tutorial](https://zinoui.com/blog/http-headers-for-wordpress) describes a typical configuration of this plugin.
61
62 == Installation ==
63
64 Upload the HTTP Headers plugin to your blog. Then activate it.
65
66 That's all.
67
68 == Frequently Asked Questions ==
69
70 = Why to use this plugin? =
71
72 Nowadays security of your social data at the web is essential. This plugin helps you to improve your website overall security.
73
74 = Who use these headers? =
75
76 These HTTP headers are being used in production services by popular websites as Facebook, Google+, Twitter, LinkedIn, YouTube, Yahoo, Amazon, Instagram, Pinterest.
77
78 == Screenshots ==
79
80 1. This screenshot shows up the dashboard with categories of the supported headers.
81 2. This screenshot shows up the headers of a chosen category and their current values.
82 3. This screenshot shows up the settings page where you can adjust the security headers.
83 4. This screenshot shows up the response headers returned by the web server.
84
85 == Upgrade Notice ==
86
87 Updates are on they way, so stay tuned at [@DimitarIvanov](https://twitter.com/DimitarIvanov)
88
89 == Changelog ==
90
91 = 1.18.5 =
92 *Release Date - 30th April, 2021*
93
94 * Configurable paths to files who store passwords for basic/digest auth
95 * Fixed issue with plugin activation, due missing file
96
97 = 1.18.4 =
98 *Release Date - 30th April, 2021*
99
100 * Initial value of X-Robots-Tag fixed
101
102 = 1.18.3 =
103 *Release Date - 30th April, 2021*
104
105 * Added "X-Robots-Tag" header
106 * Added "interest-cohort", "layout-animations", "legacy-image-formats", "oversized-images", and "wake-lock" directive to "Permissions-Policy" header
107 * Added "cross-origin" value to "Cross-Origin-Resource-Policy" header
108 * Added "navigate-to" and "prefetch-src" directives to "Content-Security-Policy" header
109
110 = 1.18.2 =
111 *Release Date - 24th April, 2021*
112
113 * Configurable paths to .htaccess and .user.ini files
114
115 = 1.18.1 =
116 *Release Date - 29th October, 2020*
117
118 * Added "allow-downloads" and "allow-top-navigation-by-user-activation" to "sandbox" directive, part of CSP
119
120 = 1.18.0 =
121 *Release Date - 20th September, 2020*
122
123 * Added "Permissions-Policy" header
124 * Fixed "Cookie Security"
125
126 = 1.17.0 =
127 *Release Date - 26th July, 2020*
128
129 * Added "Cross-Origin-Embedder-Policy" header
130 * Added "Cross-Origin-Opener-Policy" header
131
132 = 1.16.1 =
133 *Release Date - 23rd July, 2020*
134
135 * Fixed JS/CSS versioning
136
137 = 1.16.0 =
138 *Release Date - 23rd July, 2020*
139
140 * Added the "NEL" header
141 * Fixed the "Report-To" header
142
143 = 1.15.2 =
144 *Release Date - 18th June, 2020*
145
146 * Fixed a PHP Notice at "Expires" page
147 * Fixed comments in .user.ini file
148
149 = 1.15.1 =
150 *Release Date - 9th May, 2020*
151
152 * Fixed the "Access-Control-Allow-Origin" header
153
154 = 1.15.0 =
155 *Release Date - 26th January, 2020*
156
157 * Added the "Cross-Origin-Resource-Policy" header
158 * Removed the "Public-Key-Pins" header
159
160 = 1.14.2 =
161 *Release Date - 25th November, 2019*
162
163 * CORS headers updated (added "Vary: Origin")
164
165 = 1.14.1 =
166 *Release Date - 15th September, 2019*
167
168 * Simple filtering was replaced with Dynamic filtering
169
170 = 1.14.0 =
171 *Release Date - 1st September, 2019*
172
173 * Added the "Content-Type" header
174 * Fixed the "Access-Control-Allow-Credentials" header
175 * Improvement to "Access-Control-Allow-Headers" header
176 * Improvement to "Access-Control-Allow-Methods" header
177 * Improvement to "Access-Control-Expose-Headers" header
178 * Improvement to "Cache-Control" header
179 * Improvement to "Vary" header
180
181 = 1.13.4 =
182 *Release Date - 14th July, 2019*
183
184 * Added the "always" condition to Header (unset) directive
185 * Fixed the "import" function
186 * Fixed the "Access-Control-Allow-Origin" header
187
188 = 1.13.3 =
189 *Release Date - 16th June, 2019*
190
191 * Bugfix in "WWW-Authenticate" header
192 * Added support of Apache 2.4
193
194 = 1.13.2 =
195 *Release Date - 13th June, 2019*
196
197 * Bugfix in "Content-Encoding" header
198 * Bugfix in "Vary" header
199
200 = 1.13.1 =
201 *Release Date - 8th June, 2019*
202
203 * Added Brotli compression
204
205 = 1.13.0 =
206 *Release Date - 7th June, 2019*
207
208 * Added "SameSite" to Cookie Security
209 * Fixed import/export function
210 * Code refactoring
211
212 = 1.12.2 =
213 *Release Date - 5th April, 2019*
214
215 * UI improvement for Content-Security-Policy
216 * Fix for Access-Control-Allow-Headers
217 * Fix for Access-Control-Allow-Origin
218 * Fix for Feature-Policy
219
220 = 1.12.1 =
221 *Release Date - 9th January, 2019*
222
223 * Remove direct calls to cURL
224
225 = 1.12.0 =
226 *Release Date - 5th January, 2019*
227
228 * Better handling of activate/deactivate functions
229
230 = 1.11.0 =
231 *Release Date - 9th December, 2018*
232
233 * Added support of "Clear-Site-Data" header
234
235 = 1.10.5 =
236 *Release Date - 6th November, 2018*
237
238 * Hotfix: parallel work with third-party plugins
239
240 = 1.10.4 =
241 *Release Date - 30th September, 2018*
242
243 * Support of following Server APIs: CGI, FastCGI, PHP-FPM
244 * Error handling improvement
245
246 = 1.10.3 =
247 *Release Date - 8th August, 2018*
248
249 * HSTS improvement
250 * CORS improvement
251
252 = 1.10.2 =
253 *Release Date - 31st July, 2018*
254
255 * Export feature bug-fixed
256
257 = 1.10.1 =
258 *Release Date - 18th July, 2018*
259
260 * Feature-Policy header update: new features added
261
262 = 1.10.0 =
263 *Release Date - 17th July, 2018*
264
265 * Added support of "Feature-Policy" header
266
267 = 1.9.5 =
268 *Release Date - 12th July, 2018*
269
270 * CORS bugfix
271
272 = 1.9.4 =
273 *Release Date - 13th January, 2018*
274
275 * In-plugin security improvement
276
277 = 1.9.3 =
278 *Release Date - 10th January, 2018*
279
280 * Bug fix
281
282 = 1.9.2 =
283 *Release Date - 4th January, 2018*
284
285 * Security improvements
286
287 = 1.9.1 =
288 *Release Date - 27th December, 2017*
289
290 * Updated translations
291
292 = 1.9.0 =
293 *Release Date - 23th December, 2017*
294
295 * Added support of "Report-To" header
296 * Added support of translations
297 * Added support of Import/Export
298 * Updated "Content-Security-Policy" header (added directives: object-src, frame-src, worker-src, manifest-src, base-uri, report-to)
299 * Updated "WWW-Authenticate" header (support multiple users)
300 * Updated "Access-Control" headers (added list of origins)
301
302 = 1.8.0 =
303 *Release Date - 31st August, 2017*
304
305 * Added support of "Timing-Allow-Origin" header
306 * Added support of "X-Download-Options" header
307 * Added support of "X-DNS-Prefetch-Control" header
308 * Added support of "X-Permitted-Cross-Domain-Policies" header
309 * Added support of Custom headers
310
311 = 1.7.1 =
312 *Release Date - 18th August, 2017*
313
314 * PHP notice bugfixed
315
316 = 1.7.0 =
317 *Release Date - 15th August, 2017*
318
319 * Added support of "Content-Security-Policy-Report-Only" header
320 * Added support of "Public-Key-Pins-Report-Only" header
321 * Added "1; report=<reporting-URI>" directive to the "X-XSS-Protection" header
322 * Added "Inspect headers" tool
323 * UI bugfixes
324
325 = 1.6.0 =
326 *Release Date - 5th August, 2017*
327
328 * Added support of "Expect-CT" header
329
330 = 1.5.0 =
331 *Release Date - 30th July, 2017*
332
333 * Added support of "Age" header
334 * Added support of "Cache-Control" header
335 * Added support of "Connection" header
336 * Added support of "Content-Encoding" header
337 * Added support of "Expires" header
338 * Added support of "Pragma" header
339 * Added support of "Vary" header
340 * Added support of "WWW-Authenticate" header
341 * Added support of "X-Powered-By" header
342 * Added support of "Secure" and "HttpOnly" cookies
343
344 = 1.4.0 =
345 *Release Date - 5th July, 2017*
346
347 * Added support of Apache (via htaccess) inclusion method
348
349 = 1.3.0 =
350 *Release Date - 3rd June, 2017*
351
352 * Added support of Content-Security-Policy header
353 * Added dashboard
354
355 = 1.2.0 =
356 *Release Date - 28th April, 2017*
357
358 * Added support of Referrer-Policy header
359
360 = 1.1.2 =
361 *Release Date - 13th February, 2017*
362
363 * Added support of 'preload' directive to HSTS header
364
365 = 1.1.1 =
366 *Release Date - 8th November, 2016*
367
368 * Fixed typo in the X-Frame-Options header
369
370 = 1.1.0 =
371 *Release Date - 20th May, 2016*
372
373 * Added support of P3P header
374
375 = 1.0.0 =
376 *Release Date - 10th May, 2016*
377
378 * Initial version
1 select.readonly,
2 select[readonly] {
3 background-color: #eee;
4 }
5 .hh-table > tbody > tr > th,
6 .hh-table > tbody > tr > td,
7 .hh-table td{
8 vertical-align: top;
9 }
10 .hh-table tbody td.hh-td-inner{
11 padding: 0;
12 }
13 .hh-table > tbody > tr > th{
14 width: 35%;
15 }
16 .hh-table > tbody > tr > td:nth-child(2){
17 width: 10%;
18 }
19 .hh-table > tbody > tr > th .description{
20 font-weight: normal;
21 }
22 .hh-table .hh-center{
23 text-align: center;
24 }
25 .hh-table .hh-middle{
26 vertical-align: middle;
27 }
28 .hh-table .hh-p-sm td,
29 .hh-table .hh-p-sm th{
30 padding: 8px 5px;
31 }
32 .hh-bordered{
33 border-collapse: collapse;
34 }
35 .hh-bordered th,
36 .hh-bordered td{
37 border: dashed 1px #999;
38 }
39 .hh-panel{
40 background-color: #fff;
41 padding: .7em 2em 1em;
42 -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.04);
43 -moz-box-shadow: 0 1px 1px rgba(0,0,0,.04);
44 box-shadow: 0 1px 1px rgba(0,0,0,.04);
45 border: 1px solid #e5e5e5;
46 margin: 20px 0 0;
47 }
48
49 .hh-index-table{
50 border-collapse: separate;
51 border-spacing: 0;
52 width: 100%;
53 }
54 .hh-index-table tbody{
55 border-left: solid 1px rgba(0,0,0,.1);
56 border-right: solid 1px rgba(0,0,0,.1);
57 }
58 .hh-index-table th{
59 background-color: #fff;
60 font-weight: normal;
61 padding: 8px 10px;
62 text-align: left;
63 }
64 .hh-index-table td{
65 background-color: #fff;
66 color: gray;
67 padding: 8px 10px;
68 }
69 .hh-index-table td:first-child{
70 border-left: 4px solid #fff;
71 }
72 .hh-index-table .active td{
73 background-color: #f7fcfe;
74 color: green;
75 }
76 .hh-index-table .active td:first-child{
77 border-left: 4px solid #00a0d2;
78 }
79 .hh-index-table td{
80 box-shadow: 0 -1px 0 rgba(0,0,0,.1);
81 }
82 .hh-index-table .hh-status{
83 text-align: center;
84 }
85 .hh-index-table .hh-status span{
86 display: inline-block;
87 border-radius: 3px;
88 padding: 2px 5px;
89 }
90 .hh-index-table .hh-status-on span{
91 background-color: green;
92 color: #fff;
93 }
94 .hh-index-table .hh-status-off span{
95 background-color: #aaa;
96 color: #fff;
97 }
98 .hh-notice{
99 background-color: #FFFFCC;
100 margin: 20px 0;
101 padding: 8px 10px;
102 }
103 .hh-breadcrumbs{
104
105 }
106 .hh-breadcrumbs li{
107 display: inline-block;
108 }
109 .hh-breadcrumbs li:not(:last-child):after {
110 content: "\00A0\00BB\00A0";
111 display: inline-block;
112 }
113 .hh-breadcrumbs li a{
114
115 }
116 .hh-highlight{
117 background-color: #333;
118 color: #fff;
119 font-weight: 400;
120 padding: 3px 7px;
121 }
122 .hh-results{
123 border-collapse: collapse;
124 width: 100%;
125 }
126 .hh-results thead th,
127 .hh-results tbody td{
128 border-top: solid 1px #e0e0e0;
129 padding: 5px 5px 5px 0;
130 text-align: left;
131 }
132 .hh-results thead th{
133 border: none;
134 }
135 .hh-results tbody tr td:first-child{
136 white-space: nowrap;
137 }
138 .hh-results tbody tr.hh-found td{
139 background-color: #f7fcfe;
140 }
141 .hh-results tbody tr.hh-found td:first-child{
142 color: green;
143 }
144 .form-field .form-label{
145 font-weight: bold;
146 }
147 .form-field .form-lbl{
148 display: inline-block;
149 margin: 0 10px 0 0;
150 }
151 .form-row .form-col-6{
152 float: left;
153 width: 50%;
154 }
155 .form-row:after{
156 clear: left;
157 content: '';
158 display: table;
159 zoom: 1;
160 }
161 .hh-tabs > ul{
162 margin-bottom: -1px;
163 }
164 .hh-tabs > ul:after{
165 content: '';
166 display: table;
167 clear: left;
168 zoom: 1;
169 }
170 .hh-tabs > ul > li{
171 background-color: #fff;
172 border: solid 1px #ccc;
173 border-bottom: none;
174 display: inline-block;
175 float: left;
176 margin: 0 5px 0 0;
177 padding: 0;
178 }
179 .hh-tabs > ul > li a{
180 color: #222;
181 display: inline-block;
182 padding: 5px 10px;
183 text-decoration: none;
184 }
185 .hh-tabs > ul > li.hh-active{
186 border: solid 1px #222;
187 border-bottom-color: #fff;
188 }
189 .hh-tabs .hh-tab-active{
190 background-color: #fff;
191 border: solid 1px #222;
192 padding: 20px;
193 }
194 .hh-textarea-manual{
195 width: 100%;
196 }
197 .hh-hidden{
198 display: none;
199 }
200 .hh-wrapper{
201
202 }
203 .hh-sidebar{
204 float: right;
205 width: 20%;
206 }
207 .hh-sidebar-inner{
208 background-color: #fff;
209 border: solid 1px #92D295;
210 padding: 15px;
211 }
212 .hh-sidebar-inner h3{
213 margin: 0;
214 }
215 .hh-categories{
216 float: left;
217 width: 80%;
218 }
219 .hh-categories *{
220 -webkit-box-sizing: border-box;
221 -moz-box-sizing: border-box;
222 box-sizing: border-box;
223 }
224 .hh-wrapper:after,
225 .hh-categories:after{
226 content: '';
227 clear: both;
228 display: table;
229 zoom: 1;
230 }
231 a.hh-category{
232 background-color: #fff;
233 border: solid 1px #92D295;
234 display: inline-block;
235 float: left;
236 font-size: 16px;
237 height: 168px;
238 margin: 0 3% 3% 0;
239 position: relative;
240 text-align: center;
241 text-decoration: none;
242 text-transform: uppercase;
243 width: 30%;
244 }
245
246 a.hh-category i {
247 background-color: #92D295;
248 display: inline-block;
249 height: 48px;
250 margin: 35px 0 0;
251 text-align: center;
252 width: 48px;
253 -webkit-transform: rotate(20deg);
254 -moz-transform: rotate(20deg);
255 -ms-transform: rotate(20deg);
256 -o-transform: rotate(20deg);
257 }
258 a.hh-category i:after {
259 background-color: #92D295;
260 content: "";
261 display: inline-block;
262 height: 48px;
263 width: 48px;
264 -webkit-transform: rotate(135deg);
265 -moz-transform: rotate(135deg);
266 -ms-transform: rotate(135deg);
267 -o-transform: rotate(135deg);
268 }
269
270 a.hh-category span{
271 display: block;
272 color: #fff;
273 font-size: 24px;
274 font-weight: 600;
275 text-transform: uppercase;
276 left: 0;
277 position: absolute;
278 top: 48px;
279 width: 100%;
280 }
281
282 a.hh-category strong{
283 display: block;
284 font-weight: normal;
285 margin: 20px 0 0;
286 }
287
288 a.hh-category:hover{
289 box-shadow: 0 0 3px #6EC271;
290 }
291 a.hh-category:hover i{
292 -webkit-transform: rotate(160deg);
293 -moz-transform: rotate(160deg);
294 -ms-transform: rotate(160deg);
295 -o-transform: rotate(160deg);
296
297 -webkit-transition: -webkit-transform 0.5s ease-out;
298 -moz-transition: -moz-transform 0.5s ease-out;
299 -o-transition: -o-transform 0.5s ease-out;
300 transition: transform 0.5s ease-out;
301 }
302 .hh-p{
303 margin: 0.5em 0;
304 }
305 .hh-csv-value {
306 padding-left: 25px;
307 }
308 @media (min-width: 1280px) {
309 a.hh-category{
310 max-width: 260px;
311 }
312 }
313 @media (max-width: 960px) {
314 a.hh-category{
315 margin: 0 5% 20px;
316 width: 40%;
317 }
318 .hh-categories{
319 width: 70%;
320 }
321 .hh-sidebar{
322 width: 30%;
323 }
324 }
325 @media (max-width: 768px) {
326 .hh-categories{
327 width: 65%;
328 }
329 .hh-sidebar{
330 width: 35%;
331 }
332 }
333 @media (max-width: 640px) {
334 a.hh-category{
335 float: none;
336 margin: 0 0 20px;
337 width: 100%;
338 }
339 .hh-categories{
340 width: 55%;
341 }
342 .hh-sidebar{
343 width: 40%;
344 }
345 }
346 @media (max-width: 468px) {
347 a.hh-category{
348 max-width: 260px;
349 }
350 .hh-categories,
351 .hh-sidebar{
352 float: none;
353 margin: 0 auto;
354 max-width: 250px;
355 width: 100%;
356 }
357 }
...\ No newline at end of file ...\ No newline at end of file
1 <?php 1 <?php
2 # time to code 2 # Silence is golden.
...\ No newline at end of file ...\ No newline at end of file
......
1 <?php
2 // If uninstall is not called from WordPress, exit
3 if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) {
4 exit();
5 }
6
7 $options = include dirname(__FILE__) . '/views/includes/options.inc.php';
8
9 foreach ($options as $option)
10 {
11 delete_option( $option[0] );
12 }
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr>
7 <th scope="row">Access-Control-Allow-Credentials
8 <p class="description"><?php _e('The Access-Control-Allow-Credentials header indicates whether the response to request can be exposed when the credentials flag is true.', 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">Access-Control-Allow-Credentials</legend>
17 <?php
18 $access_control_allow_credentials = get_option('hh_access_control_allow_credentials', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_access_control_allow_credentials" value="<?php echo $k; ?>"<?php checked($access_control_allow_credentials, $k); ?> /> <?php echo $v; ?></label></p><?php
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-acac' ); ?>
28 <?php do_settings_sections( 'http-headers-acac' ); ?>
29 <select name="hh_access_control_allow_credentials_value" class="http-header-value"<?php echo $access_control_allow_credentials == 1 ? NULL : ' readonly'; ?>>
30 <?php
31 $items = array('true');
32 $access_control_allow_credentials_value = get_option('hh_access_control_allow_credentials_value');
33 foreach ($items as $item) {
34 ?><option value="<?php echo $item; ?>"<?php selected($access_control_allow_credentials_value, $item); ?>><?php echo $item; ?></option><?php
35 }
36 ?>
37 </select>
38 </td>
39 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr>
7 <th scope="row">Access-Control-Allow-Headers
8 <p class="description"><?php _e('The Access-Control-Allow-Headers header is returned by the server in a response to a preflight request and informs the browser about the HTTP headers that can be used in the actual request.', 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">Access-Control-Allow-Credentials</legend>
17 <?php
18 $access_control_allow_headers = get_option('hh_access_control_allow_headers', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_access_control_allow_headers" value="<?php echo $k; ?>"<?php checked($access_control_allow_headers, $k); ?> /> <?php echo $v; ?></label></p><?php
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-acah' ); ?>
28 <?php do_settings_sections( 'http-headers-acah' ); ?>
29 <table><tbody><tr>
30 <?php
31 $access_control_allow_headers_value = get_option('hh_access_control_allow_headers_value');
32 if (!$access_control_allow_headers_value)
33 {
34 $access_control_allow_headers_value = array();
35 }
36 $i = 0;
37 array_unshift($headers_list, '*');
38 foreach ($headers_list as $item) {
39 if (in_array($item, $cors_safe_request_headers)) {
40 continue;
41 }
42 if ($i % 3 === 0) {
43 ?></tr><tr><?php
44 }
45 ?><td><label><input type="checkbox" class="http-header-value" name="hh_access_control_allow_headers_value[<?php echo $item; ?>]" value="1"<?php echo !array_key_exists($item, $access_control_allow_headers_value) ? NULL : ' checked'; ?><?php echo $access_control_allow_headers == 1 ? NULL : ' readonly'; ?> /> <?php echo $item; ?></label></td><?php
46 $i += 1;
47 }
48 ?>
49 </tr></tbody></table>
50 <table><tbody>
51 <?php
52 $access_control_allow_headers_custom = get_option('hh_access_control_allow_headers_custom');
53 if (is_array($access_control_allow_headers_custom))
54 {
55 foreach ($access_control_allow_headers_custom as $header)
56 {
57 ?>
58 <tr>
59 <td><input type="text" name="hh_access_control_allow_headers_custom[]"
60 class="http-header-value" size="35"
61 value="<?php echo esc_attr($header); ?>"<?php echo $access_control_allow_headers == 1 ? NULL : ' readonly'; ?> />
62 </td>
63 <td>
64 <button type="button" class="button button-small hh-btn-delete-ac"
65 title="<?php esc_attr_e('Delete', 'http-headers'); ?>">x</button>
66 </td>
67 </tr>
68 <?php
69 }
70 }
71 ?>
72 <tr>
73 <td colspan="2">
74 <button type="button" class="button hh-btn-add-ac" data-name="hh_access_control_allow_headers_custom[]">+ <?php _e('Add header', 'http-headers'); ?></button>
75 </td>
76 </tr>
77 </tbody></table>
78 </td>
79 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr>
7 <th scope="row">Access-Control-Allow-Methods
8 <p class="description"><?php _e('The Access-Control-Allow-Methods header is returned by the server in a response to a preflight request and informs the browser about the HTTP methods that can be used in the actual request.', 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">Access-Control-Allow-Methods</legend>
17 <?php
18 $access_control_allow_methods = get_option('hh_access_control_allow_methods', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_access_control_allow_methods" value="<?php echo $k; ?>"<?php checked($access_control_allow_methods, $k); ?> /> <?php echo $v; ?></label></p><?php
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-acam' ); ?>
28 <?php do_settings_sections( 'http-headers-acam' ); ?>
29 <?php
30 $items = array('*', 'GET', 'POST', 'OPTIONS', 'HEAD', 'PUT', 'DELETE', 'TRACE', 'CONNECT', 'PATCH');
31 $access_control_allow_methods_value = get_option('hh_access_control_allow_methods_value');
32 if (!$access_control_allow_methods_value)
33 {
34 $access_control_allow_methods_value = array();
35 }
36 foreach ($items as $item)
37 {
38 ?><p><label><input type="checkbox" class="http-header-value" name="hh_access_control_allow_methods_value[<?php echo $item; ?>]" value="1"<?php echo !array_key_exists($item, $access_control_allow_methods_value) ? NULL : ' checked'; ?><?php echo $access_control_allow_methods == 1 ? NULL : ' readonly'; ?> /> <?php echo $item; ?></label></p><?php
39 }
40 ?>
41 </td>
42 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr>
7 <th scope="row">Access-Control-Allow-Origin
8 <p class="description"><?php _e('The Access-Control-Allow-Origin header indicates whether a resource can be shared.', 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">Access-Control-Allow-Origin</legend>
17 <?php
18 $access_control_allow_origin = get_option('hh_access_control_allow_origin', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_access_control_allow_origin" value="<?php echo $k; ?>"<?php checked($access_control_allow_origin, $k); ?> /> <?php echo $v; ?></label></p><?php
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-acao' ); ?>
28 <?php do_settings_sections( 'http-headers-acao' ); ?>
29 <?php
30 $access_control_allow_origin_url = get_option('hh_access_control_allow_origin_url');
31 if (is_scalar($access_control_allow_origin_url))
32 {
33 $access_control_allow_origin_url = array($access_control_allow_origin_url);
34 }
35 if (!is_array($access_control_allow_origin_url))
36 {
37 $access_control_allow_origin_url = array(NULL);
38 }
39 ?>
40 <table>
41 <tr>
42 <td>
43 <select name="hh_access_control_allow_origin_value" class="http-header-value"<?php echo $access_control_allow_origin == 1 ? NULL : ' readonly'; ?>>
44 <?php
45 $items = array('*', 'origin', 'null');
46 $access_control_allow_origin_value = get_option('hh_access_control_allow_origin_value');
47 foreach ($items as $item) {
48 ?><option value="<?php echo $item; ?>"<?php selected($access_control_allow_origin_value, $item); ?>><?php echo $item; ?></option><?php
49 }
50 ?>
51 </select>
52 </td>
53 <td class="hh-acao<?php echo $access_control_allow_origin_value != 'origin' ? ' hh-hidden' : NULL; ?>"><input type="text" name="hh_access_control_allow_origin_url[]" class="http-header-value" placeholder="http://domain.com" size="35" value="<?php echo esc_attr(@$access_control_allow_origin_url[0]); ?>"<?php echo $access_control_allow_origin == 1 && $access_control_allow_origin_value == 'origin' ? NULL : ' readonly'; ?> /></td>
54 <td class="hh-acao<?php echo $access_control_allow_origin_value != 'origin' ? ' hh-hidden' : NULL; ?>">&nbsp;</td>
55 </tr>
56 <?php
57 foreach ($access_control_allow_origin_url as $i => $url)
58 {
59 if ($i == 0)
60 {
61 continue;
62 }
63 ?>
64 <tr class="hh-acao<?php echo $access_control_allow_origin_value != 'origin' ? ' hh-hidden' : NULL; ?>">
65 <td>&nbsp;</td>
66 <td><input type="text" name="hh_access_control_allow_origin_url[]" class="http-header-value" placeholder="http://domain.com" size="35" value="<?php echo esc_attr($url); ?>"<?php echo $access_control_allow_origin == 1 && $access_control_allow_origin_value == 'origin' ? NULL : ' readonly'; ?> /></td>
67 <td><button type="button" class="button button-small hh-btn-delete-origin" title="<?php esc_attr_e('Delete', 'http-headers'); ?>">x</button></td>
68 </tr>
69 <?php
70 }
71 ?>
72 <tr class="hh-acao<?php echo $access_control_allow_origin_value != 'origin' ? ' hh-hidden' : NULL; ?>">
73 <td>&nbsp;</td>
74 <td><button type="button" class="button hh-btn-add-origin">+ <?php _e('Add origin', 'http-headers'); ?></button></td>
75 <td>&nbsp;</td>
76 </tr>
77 </table>
78 </td>
79 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr>
7 <th scope="row">Access-Control-Expose-Headers
8 <p class="description"><?php _e('The Access-Control-Expose-Headers response header brings information about headers that browsers could allow accessing.', 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">Access-Control-Expose-Headers</legend>
17 <?php
18 $access_control_expose_headers = get_option('hh_access_control_expose_headers', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_access_control_expose_headers" value="<?php echo $k; ?>"<?php checked($access_control_expose_headers, $k); ?> /> <?php echo $v; ?></label></p><?php
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-aceh' ); ?>
28 <?php do_settings_sections( 'http-headers-aceh' ); ?>
29
30 <?php
31 $access_control_expose_headers_value = get_option('hh_access_control_expose_headers_value');
32 if (!$access_control_expose_headers_value)
33 {
34 $access_control_expose_headers_value = array();
35 }
36 ?>
37 <table><tbody><tr>
38 <?php
39 $i = 0;
40 array_unshift($headers_list, '*');
41 foreach ($headers_list as $item) {
42 if (in_array($item, $cors_safe_response_headers) || in_array($item, $cors_safe_request_headers))
43 {
44 continue;
45 }
46 if ($i % 3 === 0) {
47 ?></tr><tr><?php
48 }
49 ?><td><label><input type="checkbox" class="http-header-value" name="hh_access_control_expose_headers_value[<?php echo $item; ?>]" value="1"<?php echo !array_key_exists($item, $access_control_expose_headers_value) ? NULL : ' checked'; ?><?php echo $access_control_expose_headers == 1 ? NULL : ' readonly'; ?> /> <?php echo $item; ?></label></td><?php
50 $i += 1;
51 }
52 ?>
53 </tr>
54 </tbody></table>
55 <table><tbody>
56 <?php
57 $access_control_expose_headers_custom = get_option('hh_access_control_expose_headers_custom');
58 if (is_array($access_control_expose_headers_custom))
59 {
60 foreach ($access_control_expose_headers_custom as $header)
61 {
62 ?>
63 <tr>
64 <td><input type="text" name="hh_access_control_expose_headers_custom[]" class="http-header-value" size="35" value="<?php echo esc_attr($header); ?>"<?php echo $access_control_expose_headers == 1 ? NULL : ' readonly'; ?> /></td>
65 <td><button type="button" class="button button-small hh-btn-delete-ac" title="<?php esc_attr_e('Delete', 'http-headers'); ?>">x</button></td>
66 </tr>
67 <?php
68 }
69 }
70 ?>
71 <tr>
72 <td colspan="2">
73 <button type="button" class="button hh-btn-add-ac" data-name="hh_access_control_expose_headers_custom[]">+ <?php _e('Add header', 'http-headers'); ?></button>
74 </td>
75 </tr>
76 </tbody></table>
77 </td>
78 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr>
7 <th scope="row">Access-Control-Max-Age
8 <p class="description"><?php _e('The Access-Control-Max-Age header indicates how much time, the result of a preflight request, can be cached.', 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Max-Age"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">Access-Control-Max-Age</legend>
17 <?php
18 $access_control_max_age = get_option('hh_access_control_max_age', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_access_control_max_age" value="<?php echo $k; ?>"<?php checked($access_control_max_age, $k); ?> /> <?php echo $v; ?></label></p><?php
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-acma' ); ?>
28 <?php do_settings_sections( 'http-headers-acma' ); ?>
29 <input type="text" name="hh_access_control_max_age_value" class="http-header-value" value="<?php echo esc_attr(get_option('hh_access_control_max_age_value')); ?>"<?php echo $access_control_max_age == 1 ? NULL : ' checked'; ?>>
30 <?php _e('seconds', 'http-headers'); ?>
31 </td>
32 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 include dirname(__FILE__) . '/includes/config.inc.php';
6 include dirname(__FILE__) . '/includes/breadcrumbs.inc.php';
7 ?>
8 <form method="post" action="options.php" accept-charset="utf-8">
9 <?php settings_fields( 'http-headers-mtd' ); ?>
10 <?php do_settings_sections( 'http-headers-mtd' ); ?>
11 <div style="overflow: hidden">
12 <div style="float: left; width: 49%">
13 <table class="hh-index-table">
14 <thead>
15 <tr>
16 <th>Directive</th>
17 <th>Value</th>
18 </tr>
19 </thead>
20 <tbody>
21 <tr class="active">
22 <td>PHP version</td>
23 <td><?php echo PHP_VERSION; ?></td>
24 </tr>
25 <tr class="active">
26 <td>Server Software</td>
27 <td><?php echo getenv('SERVER_SOFTWARE'); ?></td>
28 </tr>
29 <tr class="active">
30 <td>Server API</td>
31 <td><?php echo PHP_SAPI; ?></td>
32 </tr>
33 <tr class="active">
34 <td>user_ini.filename</td>
35 <td><?php echo ini_get('user_ini.filename'); ?></td>
36 </tr>
37 </tbody>
38 </table>
39 </div>
40 <section class="hh-panel" style="float: right; width: 49%; box-sizing: border-box; margin: 0">
41 <table style="width: 100%">
42 <thead>
43 <tr>
44 <th colspan="2" style="text-align: left"><?php _e('Setup Location', 'http-headers'); ?></th>
45 </tr>
46 </thead>
47 <tbody>
48 <tr>
49 <td>Location of <code>.htaccess</code></td>
50 <td><input type="text" name="hh_htaccess_path" placeholder="<?php echo get_home_path(); ?>.htaccess" style="width: 100%" value="<?php echo get_option('hh_htaccess_path'); ?>"></td>
51 </tr>
52 <tr>
53 <td>Location of <code>.user.ini</code></td>
54 <td><input type="text" name="hh_user_ini_path" placeholder="<?php echo get_home_path(); ?>.user.ini" style="width: 100%" value="<?php echo get_option('hh_user_ini_path'); ?>"></td>
55 </tr>
56 <tr>
57 <td>Location of <code>.hh-htpasswd</code></td>
58 <td><input type="text" name="hh_htpasswd_path" placeholder="<?php echo get_home_path(); ?>.hh-htpasswd" style="width: 100%" value="<?php echo get_option('hh_htpasswd_path'); ?>"></td>
59 </tr>
60 <tr>
61 <td>Location of <code>.hh-htdigest</code></td>
62 <td><input type="text" name="hh_htdigest_path" placeholder="<?php echo get_home_path(); ?>.hh-htdigest" style="width: 100%" value="<?php echo get_option('hh_htdigest_path'); ?>"></td>
63 </tr>
64 <tr>
65 <td></td>
66 <td><?php submit_button(null, 'primary', null, false); ?></td>
67 </tr>
68 </tbody>
69 </table>
70 </section>
71 </div>
72
73 <section class="hh-panel">
74 <table class="form-table hh-table">
75 <tbody>
76 <tr valign="top">
77 <th scope="row"><?php _e('Default mode', 'http-headers'); ?>
78 <p class="description"><?php _e('Choose a method for sending of headers. Usually, the PHP method works perfectly. However, some third-party plugins like WP Super Cache may require switching to Apache method.', 'http-headers'); ?></p>
79 </th>
80 <td>&nbsp;</td>
81 <td>
82 <fieldset>
83 <?php
84 $items = array(
85 'php' => __('Use PHP to send headers (deprecated)', 'http-headers'),
86 'htaccess' => __('Use Apache (mod_headers) to send headers', 'http-headers'),
87 );
88 $method = get_option('hh_method');
89 foreach ($items as $key => $val) {
90 ?><p><label><input type="radio" name="hh_method" value="<?php echo $key; ?>"<?php checked($method, $key, true); ?>><?php echo $val; ?></label></p><?php
91 }
92 ?>
93 </fieldset>
94 </td>
95 </tr>
96 </tbody>
97 </table>
98 <?php submit_button(); ?>
99 </section>
100 </form>
101
102 <section class="hh-panel">
103 <table class="form-table hh-table">
104 <tbody>
105 <tr valign="top">
106 <th scope="row"><?php _e('Export', 'http-headers'); ?>
107 <p class="description"><?php _e('Export the plugin current state of settings for later use if recovery needs.', 'http-headers'); ?></p>
108 </th>
109 <td>&nbsp;</td>
110 <td>
111 <fieldset>
112 <form method="post" action="<?php echo admin_url('admin-post.php'); ?>" target="_blank">
113 <?php wp_nonce_field('export'); ?>
114 <input type="hidden" name="action" value="export">
115 <button type="submit" class="button button-primary"><?php _e('Export settings', 'http-headers'); ?></button>
116 </form>
117 </fieldset>
118 </td>
119 </tr>
120 <tr valign="top">
121 <th scope="row"><?php _e('Import', 'http-headers'); ?>
122 <p class="description"><?php _e('Import a previously saved state of settings.', 'http-headers'); ?></p>
123 </th>
124 <td>&nbsp;</td>
125 <td>
126 <fieldset>
127 <form method="post" action="<?php echo admin_url('admin-post.php'); ?>" enctype="multipart/form-data">
128 <?php wp_nonce_field('import'); ?>
129 <input type="hidden" name="action" value="import">
130 <input type="file" name="file" id="hh-import-file" class="hh-hidden">
131 <div class="button-group">
132 <button type="button" class="button hh-btn-import-choose"><?php _e('Choose file...', 'http-headers'); ?></button>
133 <button type="submit" class="button button-primary"><?php _e('Import settings', 'http-headers'); ?></button>
134 </div>
135 <p id="hh-import-name"></p>
136 </form>
137 </fieldset>
138 </td>
139 </tr>
140 </tbody>
141 </table>
142 </section>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr>
7 <th scope="row">Age
8 <p class="description"><?php _e('The Age header contains the time in seconds the object has been in a proxy cache.', 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Age"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">Age</legend>
17 <?php
18 $age = get_option('hh_age', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_age" value="<?php echo $k; ?>"<?php checked($age, $k); ?> /> <?php echo $v; ?></label></p><?php
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-age' ); ?>
28 <?php do_settings_sections( 'http-headers-age' ); ?>
29 <input type="text" name="hh_age_value" class="http-header-value" size="5" value="<?php echo esc_attr(get_option('hh_age_value')); ?>"<?php echo $age == 1 ? NULL : ' checked'; ?>>
30 <?php _e('seconds', 'http-headers'); ?>
31 </td>
32 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!(isset($_POST['url']) && preg_match('|^https?://|', $_POST['url'])))
3 {
4 ?>
5 <section class="hh-panel">
6 <h3><span class="hh-highlight"><?php _e('URL malformed', 'http-headers'); ?></span></h3>
7 </section>
8 <?php
9 exit;
10 }
11
12 include 'includes/config.inc.php';
13
14 $args = array();
15
16 if (isset($_POST['authentication'], $_POST['username'], $_POST['password'])
17 && !empty($_POST['username'])
18 && !empty($_POST['password'])
19 )
20 {
21 $args['headers'] = array(
22 'Authorization' => sprintf('Basic %s', base64_encode($_POST['username'] .':'. $_POST['password']))
23 );
24 }
25
26 $response = wp_remote_head($_POST['url'], $args);
27 $status = wp_remote_retrieve_response_code($response);
28 $dictionary = wp_remote_retrieve_headers($response);
29 $responseHeaders = $dictionary ? $dictionary->getAll() : array();
30
31 if ($status !== 200)
32 {
33 ?>
34 <section class="hh-panel">
35 <h3><span class="hh-highlight"><?php _e('HTTP Status', 'http-headers'); ?>: <?php echo $status; ?></span></h3>
36 <p><?php
37 switch ($status)
38 {
39 case 400:
40 echo 'Bad Request';
41 break;
42 case 401:
43 echo 'Unauthorized';
44 break;
45 case 403:
46 echo 'Forbidden';
47 break;
48 case 404:
49 echo 'Not Found';
50 break;
51 case 405:
52 echo 'Method Not Allowed';
53 break;
54 default:
55 }
56 ?></p>
57 </section>
58 <?php
59 exit;
60 }
61 ?>
62 <section class="hh-panel">
63 <h3><span class="hh-highlight"><?php _e('Response headers', 'http-headers'); ?></span></h3>
64 <table class="hh-results">
65 <thead>
66 <tr>
67 <th style="width: 30%"><?php _e('Header', 'http-headers'); ?></th>
68 <th><?php _e('Value', 'http-headers'); ?></th>
69 </tr>
70 </thead>
71 <tbody>
72 <?php
73 $reportOnly = array('content-security-policy-report-only');
74 foreach ($responseHeaders as $k => $v)
75 {
76 $k = strtolower($k);
77 $found = in_array($k, $reportOnly);
78 $v = is_array($v) ? join(", ", $v) : $v;
79 ?>
80 <tr<?php echo array_key_exists($k, $headers) || $found ? ' class="hh-found"' : NULL; ?>>
81 <td><?php echo htmlspecialchars($k); ?></td>
82 <td><?php echo htmlspecialchars($v); ?></td>
83 </tr>
84 <?php
85 }
86 ?>
87 </tbody>
88 </table>
89 </section>
90 <?php
91 $special = array('content-security-policy');
92 $exclude = array('custom-headers', 'cookie-security', 'x-powered-by');
93 $missing = array();
94 foreach ($headers as $k => $v)
95 {
96 if (!array_key_exists($k, $responseHeaders)
97 && !in_array($k, $exclude)
98 && !(in_array($k, $special) && array_key_exists($k . '-report-only', $responseHeaders) ))
99 {
100 $missing[$k] = @$categories[$v[2]];
101 }
102 }
103
104 if (!empty($missing))
105 {
106 asort($missing);
107 ?>
108 <section class="hh-panel">
109 <h3><span class="hh-highlight"><?php _e('Missing headers', 'http-headers'); ?></span></h3>
110 <table class="hh-results">
111 <thead>
112 <tr>
113 <th style="width: 30%"><?php _e('Header', 'http-headers'); ?></th>
114 <th><?php _e('Category', 'http-headers'); ?></th>
115 </tr>
116 </thead>
117 <tbody>
118 <?php
119 foreach ($missing as $k => $v)
120 {
121 ?>
122 <tr>
123 <td><a href="<?php echo get_admin_url(); ?>options-general.php?page=http-headers&amp;header=<?php echo htmlspecialchars($k); ?>"><?php echo $k; ?></a></td>
124 <td><?php echo $v; ?></td>
125 </tr>
126 <?php
127 }
128 ?>
129 </tbody>
130 </table>
131 </section>
132 <?php
133 }
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr>
7 <th scope="row">Cache-Control
8 <p class="description"><?php _e('The Cache-Control general-header field is used to specify directives for caching mechanisms in both, requests and responses. Caching directives are unidirectional, meaning that a given directive in a request is not implying that the same directive is to be given in the response.', 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">Cache-Control</legend>
17 <?php
18 $cache_control = get_option('hh_cache_control', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_cache_control" value="<?php echo $k; ?>"<?php checked($cache_control, $k); ?> /> <?php echo $v; ?></label></p><?php
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-cc' ); ?>
28 <?php do_settings_sections( 'http-headers-cc' ); ?>
29 <?php
30 $items = array(
31 'must-revalidate' => 'bool',
32 'no-cache' => 'bool',
33 'no-store' => 'bool',
34 'no-transform' => 'bool',
35 'public' => 'bool',
36 'private' => 'bool',
37 'proxy-revalidate' => 'bool',
38 'max-age' => 'int',
39 's-maxage' => 'int',
40 'immutable' => 'bool',
41 'stale-while-revalidate' => 'int',
42 'stale-if-error' => 'int',
43 );
44 ?>
45 <table>
46 <?php
47 $cache_control_value = get_option('hh_cache_control_value');
48 if (!$cache_control_value)
49 {
50 $cache_control_value = array();
51 }
52 foreach ($items as $item => $type)
53 {
54 ?>
55 <tr>
56 <td><label for="hh_cache_control_value_<?php echo $item; ?>"><?php echo $item; ?></label></td>
57 <td><?php
58 switch ($type) {
59 case 'bool':
60 ?><input type="checkbox" class="http-header-value" name="hh_cache_control_value[<?php echo $item; ?>]" id="hh_cache_control_value_<?php echo $item; ?>" value="1"<?php checked(array_key_exists($item, $cache_control_value), 1, true); ?>><?php
61 break;
62 case 'int':
63 ?><input type="text" class="http-header-value" name="hh_cache_control_value[<?php echo $item; ?>]" id="hh_cache_control_value_<?php echo $item; ?>" size="6" value="<?php echo array_key_exists($item, $cache_control_value) && strlen($cache_control_value[$item]) > 0 ? (int) $cache_control_value[$item] : NULL; ?>"> <?php _e('seconds', 'http-headers');
64 break;
65 }
66 ?>
67 </td>
68 </tr>
69 <?php
70 }
71 ?>
72 </table>
73 </td>
74 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 include dirname(__FILE__) . '/includes/config.inc.php';
6 include dirname(__FILE__) . '/includes/breadcrumbs.inc.php';
7 ?>
8 <table class="hh-index-table">
9 <thead>
10 <tr>
11 <th><?php _e('Header', 'http-headers'); ?></th>
12 <th style="width: 45%"><?php _e('Value', 'http-headers'); ?></th>
13 <th class="hh-status"><?php _e('Status', 'http-headers'); ?></th>
14 <th></th>
15 </tr>
16 </thead>
17 <tbody>
18 <?php
19 foreach ($headers as $index => $item)
20 {
21 if (@$_GET['category'] != $item[2])
22 {
23 continue;
24 }
25
26 $key = $item[1];
27
28 $option = get_option($key, 0);
29 $isOn = (int) $option === 1;
30 $value = NULL;
31 if ($isOn)
32 {
33 $value = get_option($key .'_value');
34 switch ($key)
35 {
36 case 'hh_age':
37 $value = (int) $value;
38 break;
39 case 'hh_p3p':
40 if (!empty($value))
41 {
42 $value = sprintf('CP="%s"', join(' ', array_keys($value)));
43 }
44 break;
45 case 'hh_x_xxs_protection':
46 if ($value == '1; report=') {
47 $value .= get_option('hh_x_xxs_protection_uri');
48 }
49 break;
50 case 'hh_x_powered_by':
51 if (get_option('hh_x_powered_by_option') == 'unset') {
52 $value = '[Unset]';
53 }
54 break;
55 case 'hh_x_frame_options':
56 $value = strtoupper($value);
57 if ($value == 'ALLOW-FROM')
58 {
59 $value .= ' ' . get_option('hh_x_frame_options_domain');
60 }
61 break;
62 case 'hh_strict_transport_security':
63 $tmp = array();
64 $hh_strict_transport_security_max_age = get_option('hh_strict_transport_security_max_age');
65 if ($hh_strict_transport_security_max_age !== false)
66 {
67 $tmp[] = sprintf('max-age=%u', $hh_strict_transport_security_max_age);
68 if (get_option('hh_strict_transport_security_sub_domains'))
69 {
70 $tmp[] = 'includeSubDomains';
71 }
72 if (get_option('hh_strict_transport_security_preload'))
73 {
74 $tmp[] = 'preload';
75 }
76 } else {
77 $tmp = array(get_option('hh_strict_transport_security_value'));
78 }
79 if (!empty($tmp))
80 {
81 $value = join('; ', $tmp);
82 }
83 break;
84 case 'hh_timing_allow_origin':
85 if ($value == 'origin')
86 {
87 $value = get_option('hh_timing_allow_origin_url');
88 }
89 break;
90 case 'hh_access_control_allow_origin':
91 if ($value == 'origin')
92 {
93 $value = join('<br>', get_option('hh_access_control_allow_origin_url', array()));
94 }
95 break;
96 case 'hh_access_control_expose_headers':
97 case 'hh_access_control_allow_headers':
98 case 'hh_access_control_allow_methods':
99 $value = join(', ', array_keys($value));
100 break;
101 case 'hh_content_security_policy':
102 $value = build_csp_value($value);
103 if (get_option('hh_content_security_policy_report_only')) {
104 $item[0] .= '-Report-Only';
105 }
106 break;
107 case 'hh_content_encoding':
108 $value = !$value ? null : join(', ', array_keys($value));
109
110 $ext = get_option('hh_content_encoding_ext');
111 if (!empty($ext)) {
112 $ext = join(', ', array_keys($ext));
113 $value .= (!empty($value) ? '<br>' : null) . $ext;
114 }
115 $module = get_option('hh_content_encoding_module');
116 switch ($module) {
117 case 'brotli_deflate':
118 $enc = 'br, gzip';
119 break;
120 case 'brotli':
121 $enc = 'br';
122 break;
123 case 'deflate':
124 default:
125 $enc = 'gzip';
126 break;
127 }
128
129 $value = !empty($value) ? sprintf('%s (%s)', $enc, $value) : $enc;
130 break;
131 case 'hh_vary':
132 $value = !$value ? null : join(', ', array_keys($value));
133 break;
134 case 'hh_www_authenticate':
135 $value = get_option('hh_www_authenticate_type');
136 break;
137 case 'hh_cache_control':
138 $tmp = array();
139 foreach ($value as $k => $v) {
140 if (in_array($k, array('max-age', 's-maxage', 'stale-while-revalidate', 'stale-if-error'))) {
141 if (strlen($v) > 0) {
142 $tmp[] = sprintf("%s=%u", $k, $v);
143 }
144 } else {
145 $tmp[] = $k;
146 }
147 }
148 $value = join(', ', $tmp);
149 break;
150 case 'hh_expires':
151 $tmp = array();
152 $types = get_option('hh_expires_type', array());
153 foreach ($types as $type => $whatever) {
154 list($base, $period, $suffix) = explode('_', $value[$type]);
155 if (in_array($base, array('access', 'modification'))) {
156 $tmp[] = $type != 'default'
157 ? sprintf('%s = "%s plus %u %s"', $type, $base, $period, $suffix)
158 : sprintf('default = "%s plus %u %s"', $base, $period, $suffix);
159 } elseif ($base == 'invalid') {
160 $tmp[] = $type != 'default'
161 ? sprintf('%s = A0', $type)
162 : sprintf('default = A0');
163 }
164 }
165 $value = join('<br>', $tmp);
166 break;
167 case 'hh_cookie_security':
168 if (is_array($value)) {
169 if (isset($value['SameSite']) && !is_samesite_supported()) {
170 unset($value['SameSite']);
171 }
172 }
173 $value = is_array($value) && !empty($value)
174 ? '&#10004; ' . join(' &#10004; ', array_keys($value))
175 : NULL;
176 break;
177 case 'hh_expect_ct':
178 $tmp = array();
179 $tmp[] = sprintf('max-age=%u', get_option('hh_expect_ct_max_age'));
180 if (get_option('hh_expect_ct_enforce') == 1) {
181 $tmp[] = 'enforce';
182 }
183 $tmp[] = sprintf('report-uri="%s"', get_option('hh_expect_ct_report_uri'));
184 $value = join(', ', $tmp);
185 break;
186 case 'hh_custom_headers':
187 $_names = array($item[0]);
188 $_values = array('&nbsp;');
189 foreach ($value['name'] as $key => $name)
190 {
191 if (!empty($name) && !empty($value['value'][$key]))
192 {
193 $_names[] = '<p class="hh-p">&nbsp;&nbsp;&nbsp;&nbsp;'.$name.'</p>';
194 $_values[] = '<p class="hh-p">'.$value['value'][$key].'</p>';
195 }
196 }
197 $item[0] = join('', $_names);
198 $value = join('', $_values);
199 break;
200 case 'hh_report_to':
201 $value = get_http_header('report_to');
202 break;
203 case 'hh_nel':
204 $value = get_http_header('nel');
205 break;
206 case 'hh_feature_policy':
207 $value = get_http_header('feature_policy');
208 break;
209 case 'hh_permissions_policy':
210 $value = get_http_header('permissions_policy');
211 break;
212 case 'hh_x_robots_tag':
213 $value = get_http_header('x_robots_tag');
214 break;
215 case 'hh_clear_site_data':
216 $value = '"' . join('", "', array_keys($value)) . '"';
217 break;
218 case 'hh_content_type':
219 $tmp = array();
220 foreach ($value as $key => $val) {
221 $tmp[] = sprintf(".%s => %s", $key, $val);
222 }
223 $value = join("<br>", $tmp);
224 break;
225 default:
226 $value = !is_array($value) ? $value : join(', ', $value);
227 }
228 }
229 $status = $isOn ? __('On', 'http-headers') : __('Off', 'http-headers');
230 ?>
231 <tr<?php echo $isOn ? ' class="active"' : NULL; ?>>
232 <td><?php echo $item[0]; ?></td>
233 <td><?php echo $value; ?></td>
234 <td class="hh-status hh-status-<?php echo $isOn ? 'on' : 'off'; ?>"><span><?php echo $status; ?></span></td>
235 <td><a href="<?php echo get_admin_url(); ?>options-general.php?page=http-headers&header=<?php
236 echo $index; ?>"><?php _e('Edit', 'http-headers'); ?></a></td>
237 </tr>
238 <?php
239 }
240 ?>
241 </tbody>
242 </table>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr>
7 <th scope="row">Clear-Site-Data
8 <p class="description"><?php _e('The Clear-Site-Data header clears browsing data (cookies, storage, cache) associated with the requesting website. It allows web developers to have more control over the data stored locally by a browser for their origins.', 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Clear-Site-Data"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">Clear-Site-Data</legend>
17 <?php
18 $clear_site_data = get_option('hh_clear_site_data', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_clear_site_data" value="<?php echo $k; ?>"<?php checked($clear_site_data, $k); ?> /> <?php echo $v; ?></label></p><?php
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-csd' ); ?>
28 <?php do_settings_sections( 'http-headers-csd' ); ?>
29 <?php
30 $items = array(
31 'cache' => 'bool',
32 'cookies' => 'bool',
33 'storage' => 'bool',
34 'executionContexts' => 'bool',
35 '*' => 'bool',
36 );
37 ?>
38 <table>
39 <?php
40 $clear_site_data_value = get_option('hh_clear_site_data_value');
41 if (!$clear_site_data_value)
42 {
43 $clear_site_data_value = array();
44 }
45 foreach ($items as $item => $type)
46 {
47 ?>
48 <tr>
49 <td><label for="hh_clear_site_data_value_<?php echo $item; ?>">"<?php echo $item; ?>"</label></td>
50 <td><?php
51 switch ($type) {
52 case 'bool':
53 ?><input type="checkbox" class="http-header-value" name="hh_clear_site_data_value[<?php echo $item; ?>]" id="hh_clear_site_data_value_<?php echo $item; ?>" value="1"<?php checked(array_key_exists($item, $clear_site_data_value), 1, true); ?>><?php
54 break;
55 }
56 ?>
57 </td>
58 </tr>
59 <?php
60 }
61 ?>
62 </table>
63 </td>
64 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr valign="top">
7 <th scope="row">Connection
8 <p class="description"><?php _e('The Connection general header controls whether or not the network connection stays open after the current transaction finishes. If the value sent is keep-alive, the connection is persistent and not closed, allowing for subsequent requests to the same server to be done.', 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Connection"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">Connection</legend>
17 <?php
18 $connection = get_option('hh_connection', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_connection" value="<?php echo $k; ?>"<?php checked($connection, $k); ?> /> <?php echo $v; ?></label></p><?php
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-con' ); ?>
28 <?php do_settings_sections( 'http-headers-con' ); ?>
29 <select name="hh_connection_value" class="http-header-value"<?php echo $connection == 1 ? NULL : ' readonly'; ?>>
30 <?php
31 $items = array('keep-alive', 'close');
32 $connection_value = get_option('hh_connection_value');
33 foreach ($items as $item) {
34 ?><option value="<?php echo $item; ?>"<?php selected($connection_value, $item); ?>><?php echo $item; ?></option><?php
35 }
36 ?>
37 </select>
38 </td>
39 </tr>
...\ No newline at end of file ...\ No newline at end of file
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 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">Content-Encoding</legend>
17 <?php
18 $content_encoding = get_option('hh_content_encoding', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><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
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-ce' ); ?>
28 <?php do_settings_sections( 'http-headers-ce' ); ?>
29 <table>
30 <tbody>
31 <tr>
32 <th colspan="2"><?php _e('Module', 'http-headers'); ?></th>
33 </tr>
34 <?php
35 $content_encoding_module = get_option('hh_content_encoding_module');
36 ?>
37 <tr>
38 <td colspan="2" class="hh-td-inner">
39 <table style="width: 100%">
40 <tbody>
41 <tr>
42 <td>
43 <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>
44 </td>
45 <td>
46 <label><input type="radio" name="hh_content_encoding_module" value="brotli"<?php checked($content_encoding_module, 'brotli'); ?>> <?php _e('BROTLI', 'http-headers'); ?></label>
47 </td>
48 <td>
49 <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>
50 </td>
51 </tr>
52 </tbody>
53 </table>
54 </td>
55 </tr>
56 <tr>
57 <th colspan="2"><?php _e('By content type', 'http-headers'); ?></th>
58 </tr><tr>
59 <?php
60 $items = array(
61 'application/javascript',
62 'application/x-javascript',
63 'application/json',
64 'application/ld+json',
65 'application/manifest+json',
66 'application/rdf+xml',
67 'application/rss+xml',
68 'application/schema+json',
69 'application/vnd.geo+json',
70 'application/x-web-app-manifest+json',
71 'application/vnd.ms-fontobject',
72 'application/x-font-ttf',
73 'application/xhtml+xml',
74 'application/xml',
75 'font/opentype',
76 'font/eot',
77 'image/bmp',
78 'image/svg+xml',
79 'image/x-icon',
80 'image/vnd.microsoft.icon',
81 'text/javascript',
82 'text/css',
83 'text/html',
84 'text/plain',
85 'text/x-component',
86 'text/xml',
87 );
88 $content_encoding_value = get_option('hh_content_encoding_value');
89 if (!$content_encoding_value) {
90 $content_encoding_value = array();
91 }
92 foreach ($items as $i => $item) {
93 if ($i > 0 && $i % 2 === 0) {
94 ?></tr><tr><?php
95 }
96 ?><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
97 }
98 ?>
99 </tr>
100
101 <tr>
102 <th colspan="2"><?php _e('By extension', 'http-headers'); ?></th>
103 </tr>
104 <tr>
105 <?php
106 $content_encoding_ext = get_option('hh_content_encoding_ext');
107 if (!$content_encoding_ext) {
108 $content_encoding_ext = array();
109 }
110 $items = array('php', 'html', 'js', 'css', 'json', 'xml', 'svg', 'txt', 'bmp', 'ico', 'ttf', 'otf', 'eot');
111 foreach ($items as $i => $item) {
112 if ($i > 0 && $i % 2 === 0) {
113 ?></tr><tr><?php
114 }
115 ?><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
116 }
117 ?>
118 </tr>
119
120 </tbody></table>
121 </td>
122 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 $content_security_policy = get_option('hh_content_security_policy', 0);
6 ?>
7 <tr valign="top">
8 <th scope="row">Content Security Policy
9 <p class="description"><?php _e('Content Security Policy (CSP) is an added layer of security that helps to detect and mitigate certain types of attacks, including Cross Site Scripting (XSS) and data injection attacks. These attacks are used for everything from data theft to site defacement or distribution of malware.', 'http-headers'); ?></p>
10
11 <p>
12 <label><input type="checkbox" class="http-header-value"
13 name="hh_content_security_policy_report_only" value="1"
14 <?php checked(get_option('hh_content_security_policy_report_only'), 1, true); ?>
15 <?php echo $content_security_policy == 1 ? NULL : ' readonly'; ?> /> "Report-Only" (<?php _e('for reporting-only purposes', 'http-headers'); ?>)</label>
16 </p>
17 <hr>
18 <p class="description">Useful tools:</p>
19 <p class="description">
20 <a target="_blank" href="https://zinoui.com/tools/sri-generator">SRI Hash Generator</a>
21 - generates subresource integrity hashes using a cryptographic algorithm.
22 </p>
23 <p class="description">
24 <a target="_blank" href="https://zinoui.com/tools/csp-hash">CSP Hash Generator</a>
25 - generates CSP hashes to use in script-src and style-src directives.
26 </p>
27 <hr>
28 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
29 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
30 </p>
31 </th>
32 <td>
33 <fieldset>
34 <legend class="screen-reader-text">Content-Security-Policy</legend>
35 <?php
36 foreach ($bools as $k => $v)
37 {
38 ?><p><label><input type="radio" class="http-header" name="hh_content_security_policy" value="<?php echo $k; ?>"<?php checked($content_security_policy, $k, true); ?> /> <?php echo $v; ?></label></p><?php
39 }
40 ?>
41 </fieldset>
42 </td>
43 <td>
44 <?php settings_fields( 'http-headers-csp' ); ?>
45 <?php do_settings_sections( 'http-headers-csp' ); ?>
46 <table>
47 <tbody>
48 <tr>
49 <td><strong><?php _e('Directive', 'http-headers'); ?></strong></td>
50 <td><strong><?php _e('Value', 'http-headers'); ?></strong></td>
51 </tr>
52 <?php
53 $directives = array(
54 'default-src',
55 'script-src',
56 'style-src',
57 'img-src',
58 'connect-src',
59 'font-src',
60 'media-src',
61 'report-uri',
62 'child-src',
63 'form-action',
64 'frame-ancestors',
65 'object-src',
66 'frame-src',
67 'worker-src',
68 'manifest-src',
69 'navigate-to',
70 'prefetch-src',
71 'base-uri',
72 'plugin-types',
73 'report-to',
74 'sandbox',
75 'require-sri-for',
76 'block-all-mixed-content',
77 'upgrade-insecure-requests',
78 );
79 $csp_value = get_option('hh_content_security_policy_value');
80 foreach ($directives as $item)
81 {
82 ?>
83 <tr>
84 <td><?php echo $item; ?></td>
85 <td>
86 <?php
87
88 if ($item == 'sandbox')
89 {
90 include 'includes/csp-sandbox.inc.php';
91
92 } elseif (in_array($item, array('block-all-mixed-content', 'upgrade-insecure-requests'))) {
93
94 include 'includes/csp-inc.inc.php';
95
96 } elseif (in_array($item, array('report-to', 'plugin-types'))) {
97
98 include 'includes/csp-text.inc.php';
99
100 } elseif ($item == 'require-sri-for') {
101
102 include 'includes/csp-sri.inc.php';
103
104 } else {
105
106 include 'includes/csp-src.inc.php';
107
108 }
109 ?>
110 </td>
111 </tr>
112 <?php
113 }
114 ?>
115 </tbody>
116 </table>
117 </td>
118 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr>
7 <th scope="row">Content-Type
8 <p class="description"><?php _e('The Content-Type entity header is used to indicate the media type of the resource. In responses, a Content-Type header tells the client what the content type of the returned content actually is. Browsers will do MIME sniffing in some cases and will not necessarily follow the value of this header; to prevent this behavior, the header X-Content-Type-Options can be set to nosniff.', 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">Content-Type</legend>
17 <?php
18 $content_type = get_option('hh_content_type', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_content_type" value="<?php echo $k; ?>"<?php checked($content_type, $k); ?> /> <?php echo $v; ?></label></p><?php
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields('http-headers-cty'); ?>
28 <?php do_settings_sections('http-headers-cty'); ?>
29 <?php
30 $content_type_value = get_option('hh_content_type_value');
31 if (!$content_type_value) {
32 $content_type_value = array();
33 }
34
35 $map = array(
36 'eot' => 'application/vnd.ms-fontobject',
37 'otf' => 'application/x-font-opentype',
38 'svg' => 'image/svg+xml',
39 'ttf' => 'application/x-font-ttf',
40 'woff' => 'application/font-woff',
41 'woff2' => 'application/font-woff2',
42 'jsonp' => 'application/javascript',
43 );
44 ?>
45 <table>
46 <tbody>
47 <tr>
48 <td></td>
49 <td><strong><?php _e('Extension', 'http-headers'); ?></strong></td>
50 <td><strong><?php _e('Media type', 'http-headers'); ?></strong></td>
51 </tr>
52 <?php
53 foreach ($map as $ext => $media_type)
54 {
55 ?>
56 <tr>
57 <td>
58 <input type="checkbox" class="http-header-value"
59 name="hh_content_type_value[<?php echo $ext; ?>]"
60 value="<?php echo $media_type; ?>"<?php
61 echo !(array_key_exists($ext, $content_type_value) && $content_type_value[$ext] == $media_type) ? NULL : ' checked';
62 echo $content_type == 1 ? NULL : ' readonly'; ?>></td>
63 <td>.<?php echo $ext; ?></td>
64 <td><?php echo $media_type; ?></td>
65 </tr>
66 <?php
67 }
68 ?>
69 </tbody>
70 </table>
71 </td>
72 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr>
7 <th scope="row">Cookie security
8 <p class="description"><?php _e('A secure cookie is only sent to the server with a encrypted request over the HTTPS protocol.', 'http-headers'); ?></p>
9 <p class="description"><?php _e("To prevent cross-site scripting (XSS) attacks, HttpOnly cookies are inaccessible to JavaScript's Document.cookie API; they are only sent to the server.", 'http-headers'); ?></p>
10 <p class="description"><?php _e('SameSite prevents the browser from sending this cookie along with cross-site requests. The main goal is mitigate the risk of cross-origin information leakage. It also provides some protection against cross-site request forgery attacks.', 'http-headers'); ?></p>
11 <hr>
12 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
13 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#Secure_and_HttpOnly_cookies"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
14 </p>
15 </th>
16 <td>
17 <fieldset>
18 <legend class="screen-reader-text">Cookie security</legend>
19 <?php
20 $cookie_security = get_option('hh_cookie_security', 0);
21 foreach ($bools as $k => $v)
22 {
23 ?><p><label><input type="radio" class="http-header" name="hh_cookie_security" value="<?php echo $k; ?>"<?php checked($cookie_security, $k); ?> /> <?php echo $v; ?></label></p><?php
24 }
25 ?>
26 </fieldset>
27 </td>
28 <td>
29 <?php settings_fields( 'http-headers-cose' ); ?>
30 <?php do_settings_sections( 'http-headers-cose' ); ?>
31 <?php
32 $items = array('Secure', 'HttpOnly', 'SameSite');
33 $cookie_security_value = get_option('hh_cookie_security_value');
34 foreach ($items as $item)
35 {
36 $is_checked = is_array($cookie_security_value) && array_key_exists($item, $cookie_security_value);
37 ?>
38 <p>
39 <label><input type="checkbox"
40 class="http-header-value"
41 name="hh_cookie_security_value[<?php echo $item; ?>]"
42 value="1"<?php echo !$is_checked ? NULL : ' checked'; ?><?php echo $cookie_security == 1 ? NULL : ' readonly'; ?>> <?php echo $item; ?><?php
43 ?></label>
44 </p>
45 <?php
46 if ($item == 'SameSite')
47 {
48 foreach (array('None', 'Lax', 'Strict') as $s_val)
49 {
50 ?>
51 <p class="hh-csv-value<?php echo !$is_checked ? ' hh-hidden' : NULL; ?>">
52 <label><input type="radio"
53 class="http-header-value"
54 name="hh_cookie_security_value[SameSite]"
55 value="<?php echo $s_val; ?>"<?php echo !is_array($cookie_security_value) || !array_key_exists($item, $cookie_security_value) || $cookie_security_value[$item] != $s_val ? NULL : ' checked'; ?><?php echo $cookie_security == 1 ? NULL : ' readonly'; ?>> <?php echo $s_val; ?></label>
56 </p>
57 <?php
58 }
59 }
60 }
61 ?>
62 </td>
63 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr>
7 <th scope="row">Cross-Origin-Embedder-Policy
8 <p class="description"><?php _e("The HTTP Cross-Origin-Embedder-Policy (COEP) response header prevents a document from loading any cross-origin resources that don't explicitly grant the document permission (using CORP or CORS).", 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Embedder-Policy"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">Cross-Origin-Embedder-Policy</legend>
17 <?php
18 $cross_origin_embedder_policy = get_option('hh_cross_origin_embedder_policy', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_cross_origin_embedder_policy" value="<?php echo $k; ?>"<?php checked($cross_origin_embedder_policy, $k); ?> /> <?php echo $v; ?></label></p><?php
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-coep' ); ?>
28 <?php do_settings_sections( 'http-headers-coep' ); ?>
29 <select name="hh_cross_origin_embedder_policy_value" class="http-header-value"<?php echo $cross_origin_embedder_policy == 1 ? NULL : ' readonly'; ?>>
30 <?php
31 $items = array('unsafe-none', 'require-corp');
32 $cross_origin_embedder_policy_value = get_option('hh_cross_origin_embedder_policy_value');
33 foreach ($items as $item) {
34 ?><option value="<?php echo $item; ?>"<?php selected($cross_origin_embedder_policy_value, $item); ?>><?php echo $item; ?></option><?php
35 }
36 ?>
37 </select>
38 </td>
39 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr>
7 <th scope="row">Cross-Origin-Opener-Policy
8 <p class="description"><?php _e('The HTTP Cross-Origin-Opener-Policy (COOP) response header allows you to ensure a top-level document does not share a browsing context group with cross-origin documents.', 'http-headers'); ?></p>
9 <p class="description"><?php _e("COOP will process-isolate your document and potential attackers can't access to your global object if they were opening it in a popup, preventing a set of cross-origin attacks dubbed XS-Leaks.", 'http-headers'); ?></p>
10 <p class="description"><?php _e('If a cross-origin document with COOP is opened in a new window, the opening document will not have a reference to it, and the window.opener property of the new window will be null. This allows you to have more control over references to a window than rel=noopener, which only affects outgoing navigations.', 'http-headers'); ?></p>
11 <hr>
12 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
13 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
14 </p>
15 </th>
16 <td>
17 <fieldset>
18 <legend class="screen-reader-text">Cross-Origin-Opener-Policy</legend>
19 <?php
20 $cross_origin_opener_policy = get_option('hh_cross_origin_opener_policy', 0);
21 foreach ($bools as $k => $v)
22 {
23 ?><p><label><input type="radio" class="http-header" name="hh_cross_origin_opener_policy" value="<?php echo $k; ?>"<?php checked($cross_origin_opener_policy, $k); ?> /> <?php echo $v; ?></label></p><?php
24 }
25 ?>
26 </fieldset>
27 </td>
28 <td>
29 <?php settings_fields( 'http-headers-coop' ); ?>
30 <?php do_settings_sections( 'http-headers-coop' ); ?>
31 <select name="hh_cross_origin_opener_policy_value" class="http-header-value"<?php echo $cross_origin_opener_policy == 1 ? NULL : ' readonly'; ?>>
32 <?php
33 $items = array('unsafe-none', 'same-origin-allow-popups', 'same-origin');
34 $cross_origin_opener_policy_value = get_option('hh_cross_origin_opener_policy_value');
35 foreach ($items as $item) {
36 ?><option value="<?php echo $item; ?>"<?php selected($cross_origin_opener_policy_value, $item); ?>><?php echo $item; ?></option><?php
37 }
38 ?>
39 </select>
40 </td>
41 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr>
7 <th scope="row">Cross-Origin-Resource-Policy
8 <p class="description"><?php _e('The HTTP Cross-Origin-Resource-Policy response header conveys a desire that the browser blocks no-cors cross-origin/cross-site requests to the given resource.', 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Resource-Policy"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">Cross-Origin-Resource-Policy</legend>
17 <?php
18 $cross_origin_resource_policy = get_option('hh_cross_origin_resource_policy', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_cross_origin_resource_policy" value="<?php echo $k; ?>"<?php checked($cross_origin_resource_policy, $k); ?> /> <?php echo $v; ?></label></p><?php
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-corp' ); ?>
28 <?php do_settings_sections( 'http-headers-corp' ); ?>
29 <select name="hh_cross_origin_resource_policy_value" class="http-header-value"<?php echo $cross_origin_resource_policy == 1 ? NULL : ' readonly'; ?>>
30 <?php
31 $items = array('same-site', 'same-origin', 'cross-origin');
32 $cross_origin_resource_policy_value = get_option('hh_cross_origin_resource_policy_value');
33 foreach ($items as $item) {
34 ?><option value="<?php echo $item; ?>"<?php selected($cross_origin_resource_policy_value, $item); ?>><?php echo $item; ?></option><?php
35 }
36 ?>
37 </select>
38 </td>
39 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr>
7 <th scope="row">Custom headers
8 <p class="description"><?php _e('Common non-standard response fields:', 'http-headers'); ?>
9 <br>X-Pingback
10 <br>X-Cache
11 <br>X-Edge-Location
12 <br>X-HTTP-Method-Override
13 <br>X-Csrf-Token
14 <br>X-Request-ID
15 <br>X-Correlation-ID
16 <br>X-Content-Duration
17 </p>
18 </th>
19 <td>
20 <fieldset>
21 <legend class="screen-reader-text">Custom headers</legend>
22 <?php
23 $custom_headers = get_option('hh_custom_headers', 0);
24 foreach ($bools as $k => $v)
25 {
26 ?><p><label><input type="radio" class="http-header" name="hh_custom_headers" value="<?php echo $k; ?>"<?php checked($custom_headers, $k); ?> /> <?php echo $v; ?></label></p><?php
27 }
28 ?>
29 </fieldset>
30 </td>
31 <td>
32 <?php settings_fields( 'http-headers-che' ); ?>
33 <?php do_settings_sections( 'http-headers-che' ); ?>
34 <?php
35 $custom_headers_value = get_option('hh_custom_headers_value');
36 if (!$custom_headers_value) {
37 $custom_headers_value = array();
38 }
39 ?>
40 <table>
41 <thead>
42 <tr>
43 <th><?php _e('Header', 'http-headers'); ?></th>
44 <th><?php _e('Value', 'http-headers'); ?></th>
45 <th></th>
46 </tr>
47 </thead>
48 <tbody>
49 <?php
50 if (empty($custom_headers_value))
51 {
52 ?>
53 <tr>
54 <td><input type="text" name="hh_custom_headers_value[name][]" class="http-header-value" placeholder="X-Custom-Name"></td>
55 <td><input type="text" name="hh_custom_headers_value[value][]" class="http-header-value" placeholder="<?php esc_attr_e('Value', 'http-headers'); ?>"></td>
56 <td></td>
57 </tr>
58 <?php
59 } else {
60 foreach ($custom_headers_value['name'] as $key => $name)
61 {
62 if (empty($name) || empty($custom_headers_value['value'][$key]))
63 {
64 continue;
65 }
66 ?>
67 <tr>
68 <td><input type="text" name="hh_custom_headers_value[name][]" class="http-header-value" placeholder="X-Custom-Name" value="<?php echo esc_attr($name); ?>"<?php echo $custom_headers == 1 ? NULL : ' readonly'; ?>></td>
69 <td><input type="text" name="hh_custom_headers_value[value][]" class="http-header-value" placeholder="<?php esc_attr_e('Value', 'http-headers'); ?>" value="<?php echo esc_attr($custom_headers_value['value'][$key]); ?>"<?php echo $custom_headers == 1 ? NULL : ' readonly'; ?>></td>
70 <td><button type="button" class="button button-small hh-btn-delete-header" title="<?php esc_attr_e('Delete', 'http-headers'); ?>">x</button></td>
71 </tr>
72 <?php
73 }
74 }
75 ?>
76 <tr>
77 <td colspan="3"><button type="button" class="button" id="hh-btn-add-header">+ <?php _e('Add header', 'http-headers'); ?></button></td>
78 </tr>
79 </tbody>
80 </table>
81 </td>
82 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 include dirname(__FILE__) . '/includes/config.inc.php';
6 ?>
7 <div class="hh-wrapper">
8 <div class="hh-categories">
9 <?php
10 $tmp = array();
11 foreach ($headers as $item)
12 {
13 if (!isset($tmp[$item[2]]))
14 {
15 $tmp[$item[2]] = array('total' => 0, 'on' => 0);
16 }
17 $tmp[$item[2]]['total'] += 1;
18 if (get_option($item[1]) == 1)
19 {
20 $tmp[$item[2]]['on'] += 1;
21 }
22 }
23 foreach ($categories as $key => $val)
24 {
25 ?>
26 <a href="<?php echo get_admin_url(); ?>options-general.php?page=http-headers&amp;category=<?php echo $key; ?>" class="hh-category">
27 <i></i>
28 <span><?php echo $key[0]; ?></span>
29 <strong><?php echo $val; ?></strong>(<?php printf('%u/%u', @$tmp[$key]['on'], @$tmp[$key]['total']); ?>)</a>
30 <?php
31 }
32 ?>
33 </div>
34
35 <div class="hh-sidebar">
36 <div class="hh-sidebar-inner">
37 <h3><?php _e('Rate us', 'http-headers'); ?></h3>
38 <p><?php _e('Tell us what you think about this plugin', 'http-headers'); ?> <a href="https://wordpress.org/support/plugin/http-headers/reviews/?rate=5#new-post"><?php _e('writing a review', 'http-headers'); ?></a>.</p>
39 <h3><?php _e('Contribution', 'http-headers'); ?></h3>
40 <p><?php _e('Help us to continue developing this plugin with a small donation.', 'http-headers'); ?></p>
41 <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
42 <input type="hidden" name="cmd" value="_xclick">
43 <input type="hidden" name="business" value="biggie@abv.bg">
44 <input type="hidden" name="item_name" value="HTTP Headers Donation">
45 <input type="hidden" name="no_shipping" value="1">
46 <input type="hidden" name="lc" value="US">
47 <input type="hidden" name="currency_code" value="USD">
48 <input type="hidden" name="item_number" value="">
49 $ <input type="text" name="amount" value="5" size="3">
50 <button type="submit" class="button"><?php _e('Donate', 'http-headers'); ?></button>
51 </form>
52 </div>
53 </div>
54 </div>
...\ No newline at end of file ...\ No newline at end of file
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 _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 _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expect-CT"><?php _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 $expect_ct = get_option('hh_expect_ct', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_expect_ct" value="<?php echo $k; ?>"<?php checked($expect_ct, $k, true); ?> /> <?php echo $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 $expect_ct == 1 ? NULL : ' readonly'; ?>>
33 <?php
34 $items = array('3600' => '1 hour', '86400' => '1 day', '604800' => '7 days', '2592000' => '30 days', '5184000' => '60 days', '7776000' => '90 days', '31536000' => '1 year');
35 $expect_ct_max_age = get_option('hh_expect_ct_max_age');
36 foreach ($items as $key => $item) {
37 ?><option value="<?php echo $key; ?>"<?php selected($expect_ct_max_age, $key); ?>><?php echo $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 $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 $expect_ct == 1 ? NULL : ' readonly'; ?> /></td>
49 </tr>
50 </table>
51 </td>
52 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr>
7 <th scope="row">Expires
8 <p class="description"><?php _e('The Expires header contains the date/time after which the response is considered stale.', 'http-headers'); ?></p>
9 <p class="description"><?php _e('Invalid dates, like the value 0, represent a date in the past and mean that the resource is already expired.', 'http-headers'); ?></p>
10 <p class="description"><?php _e("If there is a Cache-Control header with the 'max-age' or 's-max-age' directive in the response, the Expires header is ignored.", 'http-headers'); ?></p>
11 <p class="description"><?php _e('* Works only in Apache mode', 'http-headers'); ?></p>
12
13 <hr>
14 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
15 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
16 </p>
17 </th>
18 <td>
19 <fieldset>
20 <legend class="screen-reader-text">Expires</legend>
21 <?php
22 $expires = get_option('hh_expires', 0);
23 foreach ($bools as $k => $v)
24 {
25 ?><p><label><input type="radio" class="http-header" name="hh_expires" value="<?php echo $k; ?>"<?php checked($expires, $k); ?> /> <?php echo $v; ?></label></p><?php
26 }
27 ?>
28 </fieldset>
29 </td>
30 <td>
31 <?php settings_fields( 'http-headers-exp' ); ?>
32 <?php do_settings_sections( 'http-headers-exp' ); ?>
33 <table>
34 <?php
35 $types = array(
36 'default',
37 'text/css',
38 'text/javascript',
39 'text/plain',
40 'image/gif',
41 'image/png',
42 'image/jpeg',
43 'image/x-icon',
44 'application/x-javascript',
45 'application/javascript',
46 'application/x-icon',
47 );
48 $items = array(
49 'invalid_0_date' => '0 (invalid date)',
50 'access_1_hour' => 'Access +1 hour',
51 'access_6_hours' => 'Access +6 hours',
52 'access_12_hours' => 'Access +12 hours',
53 'access_1_day' => 'Access +1 day',
54 'access_3_days' => 'Access +3 days',
55 'access_1_week' => 'Access +1 week',
56 'access_2_weeks' => 'Access +2 weeks',
57 'access_1_month' => 'Access +1 month',
58 'access_3_months' => 'Access +3 months',
59 'access_6_months' => 'Access +6 months',
60 'access_1_year' => 'Access +1 year',
61 'modification_1_hour' => 'Modification +1 hour',
62 'modification_6_hours' => 'Modification +6 hours',
63 'modification_12_hours' => 'Modification +12 hours',
64 'modification_1_day' => 'Modification +1 day',
65 'modification_3_days' => 'Modification +3 days',
66 'modification_1_week' => 'Modification +1 week',
67 'modification_2_weeks' => 'Modification +2 weeks',
68 'modification_1_month' => 'Modification +1 month',
69 'modification_3_months' => 'Modification +3 months',
70 'modification_6_months' => 'Modification +6 months',
71 'modification_1_year' => 'Modification +1 year',
72 );
73 $expires_value = get_option('hh_expires_value');
74 $expires_type = get_option('hh_expires_type');
75 if (!$expires_value)
76 {
77 $expires_value = array();
78 }
79 if (!$expires_type)
80 {
81 $expires_type = array();
82 }
83 foreach ($types as $type) {
84 ?>
85 <tr>
86 <td><input type="checkbox" class="http-header-value" name="hh_expires_type[<?php echo $type; ?>]" value="1"<?php echo !is_array($expires_type) || !array_key_exists($type, $expires_type) ? NULL : ' checked'; ?><?php echo $expires == 1 ? NULL : ' readonly'; ?>></td>
87 <td><?php echo $type; ?></td>
88 <td>
89 <select class="http-header-value" name="hh_expires_value[<?php echo $type; ?>]"<?php echo $expires == 1 ? NULL : ' readonly'; ?>>
90 <?php
91 foreach ($items as $k => $v) {
92 $val_type = !empty($expires_value[$type]) ? $expires_value[$type] : '';
93 ?><option value="<?php echo $k; ?>"<?php selected($val_type, $k); ?>><?php echo $v; ?></option><?php
94 }
95 ?>
96 </select>
97 </td>
98 </tr>
99 <?php
100 }
101 ?>
102 </table>
103 </td>
104 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr valign="top">
7 <th scope="row">Feature-Policy
8 <p class="description"><?php _e('With Feature Policy, you opt-in to a set of policies for the browser to enforce on specific features used throughout your site. These policies restrict what APIs the site can access or modify the browser\'s default behavior for certain features.', 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">Feature-Policy</legend>
17 <?php
18 $feature_policy = get_option('hh_feature_policy', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_feature_policy" value="<?php echo $k; ?>"<?php checked($feature_policy, $k, true); ?> /> <?php echo $v; ?></label></p><?php
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-fp' ); ?>
28 <?php do_settings_sections( 'http-headers-fp' ); ?>
29 <table>
30 <tbody>
31 <?php
32 $features = array(
33 'accelerometer',
34 'ambient-light-sensor',
35 'autoplay',
36 'camera',
37 'cookie',
38 'docwrite',
39 'domain',
40 'encrypted-media',
41 'fullscreen',
42 'geolocation',
43 'gyroscope',
44 'magnetometer',
45 'microphone',
46 'midi',
47 'payment',
48 'picture-in-picture',
49 'speaker',
50 'sync-script',
51 'sync-xhr',
52 'unsized-media',
53 'usb',
54 'vertical-scroll',
55 'vibrate',
56 'vr',
57 );
58 $origins = array("'self'", "'none'", '*', 'origin(s)');
59
60 $feature_policy_value = get_option('hh_feature_policy_value');
61 $feature_policy_feature = get_option('hh_feature_policy_feature');
62 $feature_policy_origin = get_option('hh_feature_policy_origin');
63 if (!$feature_policy_value)
64 {
65 $feature_policy_value = array();
66 }
67 if (!$feature_policy_feature)
68 {
69 $feature_policy_feature = array();
70 }
71 if (!$feature_policy_origin)
72 {
73 $feature_policy_origin = array();
74 }
75
76 foreach ($features as $feature)
77 {
78 ?>
79 <tr>
80 <td><input type="checkbox" name="hh_feature_policy_feature[<?php echo $feature; ?>]" class="http-header-value"
81 value="1"<?php echo !is_array($feature_policy_feature) || !array_key_exists($feature, $feature_policy_feature) ? NULL : ' checked'; ?><?php echo $feature_policy == 1 ? NULL : ' readonly'; ?>></td>
82 <td><?php echo $feature; ?></td>
83 <td>
84 <select name="hh_feature_policy_value[<?php echo $feature; ?>]"
85 class="http-header-value"<?php echo $feature_policy == 1 ? NULL : ' readonly'; ?>>
86 <?php
87 foreach ($origins as $origin)
88 {
89 ?><option value="<?php echo $origin; ?>"<?php selected(@$feature_policy_value[$feature], $origin); ?>><?php echo $origin; ?></option><?php
90 }
91 ?>
92 </select>
93 <input type="text" name="hh_feature_policy_origin[<?php echo $feature; ?>]"
94 value="<?php echo @$feature_policy_origin[$feature]; ?>" size="30"<?php echo isset($feature_policy_value[$feature]) && in_array($feature_policy_value[$feature], array('origin(s)', "'self'")) ? NULL : ' style="display: none"'; ?>
95 class="http-header-value"<?php echo $feature_policy == 1 ? NULL : ' readonly'; ?>>
96 </td>
97 </tr>
98 <?php
99 }
100 ?>
101 </tbody>
102 </table>
103 </td>
104 </td>
105 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 include dirname(__FILE__) . '/includes/config.inc.php';
6 include dirname(__FILE__) . '/includes/breadcrumbs.inc.php';
7 ?>
8
9 <section class="hh-panel">
10 <form method="post" action="options.php">
11 <table class="form-table hh-table">
12 <tbody>
13 <?php
14 $header_file = sprintf('%s/%s.php', dirname(__FILE__), basename($_GET['header']));
15 if (is_file($header_file))
16 {
17 include $header_file;
18 }
19 ?>
20 </tbody>
21 </table>
22 <?php submit_button(); ?>
23 </form>
24 </section>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <ul class="hh-breadcrumbs">
7 <li><a href="<?php echo get_admin_url(); ?>options-general.php?page=http-headers"><?php _e('Dashboard', 'http-headers'); ?></a></li>
8 <?php
9 if (isset($_GET['category']))
10 {
11 ?><li><?php echo @$categories[$_GET['category']]; ?></li><?php
12 } elseif (isset($_GET['header'])) {
13 ?><li><a href="<?php echo get_admin_url(); ?>options-general.php?page=http-headers&amp;category=<?php echo htmlspecialchars($headers[$_GET['header']][2]); ?>"><?php echo @$categories[$headers[$_GET['header']][2]]; ?></a></li><?php
14 ?><li><?php echo @$headers[$_GET['header']][0]; ?></li><?php
15 } elseif (isset($_GET['tab']) && $_GET['tab'] == 'advanced') {
16 ?><li><?php _e('Advanced settings', 'http-headers'); ?></li><?php
17 } elseif (isset($_GET['tab']) && $_GET['tab'] == 'manual') {
18 ?><li><?php _e('Manual setup', 'http-headers'); ?></li><?php
19 } elseif (isset($_GET['tab']) && $_GET['tab'] == 'inspect') {
20 ?><li><?php _e('Inspect headers', 'http-headers'); ?></li><?php
21 }
22 ?>
23 </ul>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 $bools = array(
6 0 => __('Off', 'http-headers'),
7 1 => __('On', 'http-headers'),
8 );
9
10 $categories = array(
11 'security' => __('Security', 'http-headers'),
12 'access-control' => __('Access control', 'http-headers'),
13 'authentication' => __('Authentication', 'http-headers'),
14 'compression' => __('Compression', 'http-headers'),
15 'caching' => __('Caching', 'http-headers'),
16 'misc' => __('Miscellaneous', 'http-headers'),
17 );
18
19 $headers = array(
20 'x-frame-options' => array('X-Frame-Options', 'hh_x_frame_options', 'security'),
21 'x-xss-protection' => array('X-XSS-Protection', 'hh_x_xxs_protection', 'security'),
22 'x-content-type-options' => array('X-Content-Type-Options', 'hh_x_content_type_options', 'security'),
23 'x-ua-compatible' => array('X-UA-Compatible', 'hh_x_ua_compatible', 'misc'),
24 'strict-transport-security' => array('Strict-Transport-Security', 'hh_strict_transport_security', 'security'),
25 'p3p' => array('P3P', 'hh_p3p', 'access-control'),
26 'referrer-policy' => array('Referrer-Policy', 'hh_referrer_policy', 'security'),
27 'content-security-policy' => array('Content-Security-Policy', 'hh_content_security_policy', 'security'),
28 'access-control-allow-origin' => array('Access-Control-Allow-Origin', 'hh_access_control_allow_origin', 'access-control'),
29 'access-control-allow-credentials' => array('Access-Control-Allow-Credentials', 'hh_access_control_allow_credentials', 'access-control'),
30 'access-control-max-age' => array('Access-Control-Max-Age', 'hh_access_control_max_age', 'access-control'),
31 'access-control-allow-methods' => array('Access-Control-Allow-Methods', 'hh_access_control_allow_methods', 'access-control'),
32 'access-control-allow-headers' => array('Access-Control-Allow-Headers', 'hh_access_control_allow_headers', 'access-control'),
33 'access-control-expose-headers' => array('Access-Control-Expose-Headers', 'hh_access_control_expose_headers', 'access-control'),
34 'content-encoding' => array('Content-Encoding', 'hh_content_encoding', 'compression'),
35 'vary' => array('Vary', 'hh_vary', 'compression'),
36 'x-powered-by' => array('X-Powered-By', 'hh_x_powered_by', 'misc'),
37 'www-authenticate' => array('WWW-Authenticate', 'hh_www_authenticate', 'authentication'),
38 'cache-control' => array('Cache-Control', 'hh_cache_control', 'caching'),
39 'expires' => array('Expires', 'hh_expires', 'caching'),
40 'pragma' => array('Pragma', 'hh_pragma', 'caching'),
41 'age' => array('Age', 'hh_age', 'caching'),
42 'connection' => array('Connection', 'hh_connection', 'misc'),
43 'cookie-security' => array('Cookie security', 'hh_cookie_security', 'security'),
44 'expect-ct' => array('Expect-CT', 'hh_expect_ct', 'security'),
45 'timing-allow-origin' => array('Timing-Allow-Origin', 'hh_timing_allow_origin', 'access-control'),
46 'custom-headers' => array('Custom headers', 'hh_custom_headers', 'misc'),
47 'x-dns-prefetch-control' => array('X-DNS-Prefetch-Control', 'hh_x_dns_prefetch_control', 'security'),
48 'x-download-options' => array('X-Download-Options', 'hh_x_download_options', 'security'),
49 'x-permitted-cross-domain-policies' => array('X-Permitted-Cross-Domain-Policies', 'hh_x_permitted_cross_domain_policies', 'security'),
50 'report-to' => array('Report-To', 'hh_report_to', 'security'),
51 'feature-policy' => array('Feature-Policy', 'hh_feature_policy', 'security'),
52 'permissions-policy' => array('Permissions-Policy', 'hh_permissions_policy', 'security'),
53 'clear-site-data' => array('Clear-Site-Data', 'hh_clear_site_data', 'security'),
54 'content-type' => array('Content-Type', 'hh_content_type', 'misc'),
55 'cross-origin-resource-policy' => array('Cross-Origin-Resource-Policy', 'hh_cross_origin_resource_policy', 'security'),
56 'nel' => array('NEL', 'hh_nel', 'misc'),
57 'cross-origin-embedder-policy' => array('Cross-Origin-Embedder-Policy', 'hh_cross_origin_embedder_policy', 'security'),
58 'cross-origin-opener-policy' => array('Cross-Origin-Opener-Policy', 'hh_cross_origin_opener_policy', 'security'),
59 'x-robots-tag' => array('X-Robots-Tag', 'hh_x_robots_tag', 'misc'),
60 );
61
62 $headers_list = array(
63 'Accept',
64 'Accept-Charset',
65 'Accept-Encoding',
66 'Accept-Language',
67 'Accept-Datetime',
68 'Authorization',
69 'Cache-Control',
70 'Connection',
71 'Permanent',
72 'Cookie',
73 'Content-Length',
74 'Content-MD5',
75 'Content-Type',
76 'Date',
77 'Expect',
78 'Forwarded',
79 'From',
80 'Host',
81 'Permanent',
82 'If-Match',
83 'If-Modified-Since',
84 'If-None-Match',
85 'If-Range',
86 'If-Unmodified-Since',
87 'Max-Forwards',
88 'Origin',
89 'Pragma',
90 'Proxy-Authorization',
91 'Range',
92 'Referer',
93 'TE',
94 'User-Agent',
95 'Upgrade',
96 'Via',
97 'Warning',
98 'X-Requested-With',
99 'DNT',
100 'X-Forwarded-For',
101 'X-Forwarded-Host',
102 'X-Forwarded-Proto',
103 'Front-End-Https',
104 'X-Http-Method-Override',
105 'X-ATT-DeviceId',
106 'X-Wap-Profile',
107 'Proxy-Connection',
108 'X-UIDH',
109 'X-Csrf-Token',
110 'X-PINGOTHER',
111 'X-WP-Nonce',
112 );
113
114 $cors_safe_request_headers = array(
115 'Accept',
116 'Accept-Language',
117 'Content-Language',
118 'Content-Type',
119 );
120
121 $cors_safe_response_headers = array(
122 'Cache-Control',
123 'Content-Language',
124 'Content-Type',
125 'Expires',
126 'Last-Modified',
127 'Pragma',
128 );
...\ No newline at end of file ...\ No newline at end of file
1 <input type="checkbox"
2 name="hh_content_security_policy_value[<?php echo $item; ?>]"
3 value="1"<?php echo isset($csp_value[$item]) ? ' checked' : NULL; ?>
4 class="http-header-value"<?php echo $content_security_policy == 1 ? NULL : ' readonly'; ?>>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 $sandbox = array(
3 'allow-forms',
4 'allow-same-origin',
5 'allow-scripts',
6 'allow-popups',
7 'allow-modals',
8 'allow-downloads',
9 'allow-orientation-lock',
10 'allow-pointer-lock',
11 'allow-presentation',
12 'allow-popups-to-escape-sandbox',
13 'allow-top-navigation',
14 'allow-top-navigation-by-user-activation',
15 );
16 foreach ($sandbox as $origin)
17 {
18 ?>
19 <p>
20 <input type="checkbox"
21 name="hh_content_security_policy_value[<?php echo $item; ?>][<?php echo $origin; ?>]"
22 id="csp-<?php echo $item; ?>-<?php echo $origin; ?>"
23 value="1"<?php echo isset($csp_value[$item][$origin]) ? ' checked' : NULL; ?>
24 class="http-header-value"<?php echo $content_security_policy == 1 ? NULL : ' readonly'; ?>>
25 <label for="csp-<?php echo $item; ?>-<?php echo $origin; ?>"><?php echo $origin; ?></label>
26 </p>
27 <?php
28 }
29 ?>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 $origins = array(
3 'wildcard' => '*',
4 'self' => "'self'",
5 'none' => "'none'",
6 'unsafe-inline' => "'unsafe-inline'",
7 'unsafe-eval' => "'unsafe-eval'",
8 'strict-dynamic' => "'strict-dynamic'",
9 'report-sample' => "'report-sample'",
10 'http' => 'http:',
11 'https' => 'https:',
12 'data' => 'data:',
13 'mediastream' => 'mediastream:',
14 'blob' => 'blob:',
15 'filesystem' => 'filesystem:',
16 );
17
18 foreach ($origins as $k => $origin)
19 {
20 ?>
21 <p<?php echo $origin == '*' || !isset($csp_value[$item]['*']) ? NULL : ' style="display: none"'; ?>>
22 <input type="checkbox"
23 name="hh_content_security_policy_value[<?php echo $item; ?>][<?php echo $origin; ?>]"
24 id="csp-<?php echo $item; ?>-<?php echo $k; ?>"
25 value="1"<?php echo isset($csp_value[$item][$origin]) ? ' checked' : NULL; ?>
26 class="http-header-value"<?php echo $content_security_policy == 1 ? NULL : ' readonly'; ?>>
27 <label for="csp-<?php echo $item; ?>-<?php echo $k; ?>"><?php echo $origin; ?></label>
28 </p>
29 <?php
30 }
31
32 switch ($item) {
33 case 'script-src':
34 $host_sources = array(
35 'js.example.com',
36 'http://js.example.com',
37 'https://js.example.com',
38 );
39 break;
40 case 'style-src':
41 $host_sources = array(
42 'css.example.com',
43 'http://css.example.com',
44 'https://css.example.com',
45 );
46 break;
47 case 'img-src':
48 $host_sources = array(
49 'img.example.com',
50 'http://img.example.com',
51 'https://img.example.com',
52 );
53 break;
54 case 'font-src':
55 $host_sources = array(
56 'font.example.com',
57 'http://font.example.com',
58 'https://font.example.com',
59 );
60 break;
61 case 'default-src':
62 $host_sources = array(
63 'http://*.example.com',
64 'mail.example.com:443',
65 'https://assets.example.com',
66 'cdn.example.com',
67 );
68 break;
69 default:
70 $host_sources = array(
71 'https://store.example.com',
72 'store.example.com',
73 '*.example.com',
74 );
75 }
76 shuffle($host_sources);
77 ?>
78 <p<?php echo !isset($csp_value[$item]['*']) ? NULL : ' style="display: none"'; ?>>
79 <input type="text"
80 name="hh_content_security_policy_value[<?php echo $item; ?>][source]"
81 class="http-header-value"
82 size="40"
83 placeholder="<?php echo $host_sources[0]; ?>"
84 value="<?php echo esc_attr(@$csp_value[$item]['source']); ?>"<?php echo $content_security_policy == 1 ? NULL : ' readonly'; ?>
85 </p>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 $origins = array(
3 'script',
4 'style',
5 );
6
7 foreach ($origins as $origin)
8 {
9 ?>
10 <p>
11 <input type="checkbox"
12 name="hh_content_security_policy_value[<?php echo $item; ?>][<?php echo $origin; ?>]"
13 id="csp-<?php echo $item; ?>-<?php echo $origin; ?>"
14 value="1"<?php echo isset($csp_value[$item][$origin]) ? ' checked' : NULL; ?>
15 class="http-header-value"<?php echo $content_security_policy == 1 ? NULL : ' readonly'; ?>>
16 <label for="csp-<?php echo $item; ?>-<?php echo $origin; ?>"><?php echo $origin; ?></label>
17 </p>
18 <?php
19 }
20 ?>
...\ No newline at end of file ...\ No newline at end of file
1 <input type="text" name="hh_content_security_policy_value[<?php echo $item; ?>]" class="http-header-value" size="40"
2 value="<?php echo esc_attr(@$csp_value[$item]); ?>"<?php echo $content_security_policy == 1 ? NULL : ' readonly'; ?>>
3 <?php
4 if ($item == 'plugin-types')
5 {
6 ?>
7 <br>
8 <em>Example: application/x-shockwave-flash application/x-java-applet</em>
9 <?php
10 }
11 ?>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 return array(
3 array('hh_method', 'htaccess'),
4 array('hh_htaccess_path', str_replace('\\', '/', ABSPATH) . '.htaccess'),
5 array('hh_user_ini_path', str_replace('\\', '/', ABSPATH) . '.user.ini'),
6 array('hh_htpasswd_path', str_replace('\\', '/', ABSPATH) . '.hh-htpasswd'),
7 array('hh_htdigest_path', str_replace('\\', '/', ABSPATH) . '.hh-htdigest'),
8 array('hh_x_frame_options', 0),
9 array('hh_x_frame_options_value', ''),
10 array('hh_x_frame_options_domain', ''),
11 array('hh_x_xxs_protection', 0),
12 array('hh_x_xxs_protection_value', ''),
13 array('hh_x_xxs_protection_uri', ''),
14 array('hh_x_content_type_options', 0),
15 array('hh_x_content_type_options_value', ''),
16 array('hh_strict_transport_security', 0),
17 array('hh_strict_transport_security_value', ''), //obsolete
18 array('hh_strict_transport_security_max_age', ''),
19 array('hh_strict_transport_security_sub_domains', ''),
20 array('hh_strict_transport_security_preload', ''),
21 array('hh_public_key_pins', 0),
22 array('hh_public_key_pins_sha256_1', ''),
23 array('hh_public_key_pins_sha256_2', ''),
24 array('hh_public_key_pins_max_age', ''),
25 array('hh_public_key_pins_sub_domains', ''),
26 array('hh_public_key_pins_report_uri', ''),
27 array('hh_public_key_pins_report_only', ''),
28 array('hh_x_ua_compatible', 0),
29 array('hh_x_ua_compatible_value', ''),
30 array('hh_p3p', 0),
31 array('hh_p3p_value', ''),
32 array('hh_referrer_policy', 0),
33 array('hh_referrer_policy_value', ''),
34 array('hh_content_security_policy', 0),
35 array('hh_content_security_policy_value', ''),
36 array('hh_content_security_policy_report_only', ''),
37 array('hh_access_control_allow_origin', 0),
38 array('hh_access_control_allow_origin_value', ''),
39 array('hh_access_control_allow_origin_url', ''),
40 array('hh_access_control_allow_credentials', 0),
41 array('hh_access_control_allow_credentials_value', ''),
42 array('hh_access_control_allow_methods', 0),
43 array('hh_access_control_allow_methods_value', ''),
44 array('hh_access_control_allow_headers', 0),
45 array('hh_access_control_allow_headers_value', ''),
46 array('hh_access_control_allow_headers_custom', ''),
47 array('hh_access_control_expose_headers', 0),
48 array('hh_access_control_expose_headers_value', ''),
49 array('hh_access_control_expose_headers_custom', ''),
50 array('hh_access_control_max_age', 0),
51 array('hh_access_control_max_age_value', ''),
52 array('hh_content_encoding', 0),
53 array('hh_content_encoding_module', ''),
54 array('hh_content_encoding_value', ''),
55 array('hh_content_encoding_ext', ''),
56 array('hh_vary', 0),
57 array('hh_vary_value', ''),
58 array('hh_x_powered_by', 0),
59 array('hh_x_powered_by_option', ''),
60 array('hh_x_powered_by_value', ''),
61 array('hh_www_authenticate', 0),
62 array('hh_www_authenticate_type', ''),
63 array('hh_www_authenticate_realm', ''),
64 array('hh_www_authenticate_user', ''),
65 array('hh_www_authenticate_pswd', ''),
66 array('hh_cache_control', 0),
67 array('hh_cache_control_value', ''),
68 array('hh_age', 0),
69 array('hh_age_value', ''),
70 array('hh_pragma', 0),
71 array('hh_pragma_value', ''),
72 array('hh_expires', 0),
73 array('hh_expires_value', ''),
74 array('hh_expires_type', ''),
75 array('hh_connection', 0),
76 array('hh_connection_value', ''),
77 array('hh_cookie_security', 0),
78 array('hh_cookie_security_value', ''),
79 array('hh_expect_ct', 0),
80 array('hh_expect_ct_max_age', ''),
81 array('hh_expect_ct_report_uri', ''),
82 array('hh_expect_ct_enforce', ''),
83 array('hh_timing_allow_origin', 0),
84 array('hh_timing_allow_origin_value', ''),
85 array('hh_timing_allow_origin_url', ''),
86 array('hh_x_permitted_cross_domain_policies', 0),
87 array('hh_x_permitted_cross_domain_policies_value', ''),
88 array('hh_x_download_options', 0),
89 array('hh_x_download_options_value', ''),
90 array('hh_x_dns_prefetch_control', 0),
91 array('hh_x_dns_prefetch_control_value', ''),
92 array('hh_custom_headers', 0),
93 array('hh_custom_headers_value', ''),
94 array('hh_report_to', 0),
95 array('hh_report_to_value', ''),
96 array('hh_feature_policy', 0),
97 array('hh_feature_policy_feature', ''),
98 array('hh_feature_policy_origin', ''),
99 array('hh_feature_policy_value', ''),
100 array('hh_permissions_policy', 0),
101 array('hh_permissions_policy_feature', ''),
102 array('hh_permissions_policy_origin', ''),
103 array('hh_permissions_policy_value', ''),
104 array('hh_clear_site_data', 0),
105 array('hh_clear_site_data_value', ''),
106 array('hh_content_type', 0),
107 array('hh_content_type_value', ''),
108 array('hh_content_nel', 0),
109 array('hh_content_nel_value', ''),
110 array('hh_x_robots_tag', 0),
111 array('hh_x_robots_tag_value', ''),
112 );
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <div class="wrap">
7 <h1>HTTP Headers</h1>
8 <?php
9 $check = check_web_server_requirements();
10 if ($check !== true) {
11 ?>
12 <div class="notice notice-error">
13 <h2><?php _e('Error!', 'http-headers'); ?></h2>
14 <?php
15 if ($check == -1) {
16 ?><p><?php _e('The following file was not found. Please make sure the file exists and has write permissions:', 'http-headers'); ?> <code><?php echo get_web_server_filename(); ?></code></p><?php
17 } elseif ($check == -2) {
18 ?><p><?php _e('Please make sure the following file has write permissions:', 'http-headers'); ?> <code><?php echo get_web_server_filename(); ?></code></p><?php
19 }
20 ?>
21 </div>
22 <?php
23 }
24 $check = check_php_requirements();
25 if ($check !== true) {
26 ?>
27 <div class="notice notice-warning">
28 <h2><?php _e('Warning!', 'http-headers'); ?></h2>
29 <?php
30 if ($check == -1) {
31 ?><p><?php _e('The following file was not found. Please make sure the file exists and has write permissions:', 'http-headers'); ?> <code><?php echo get_user_ini_filename(); ?></code></p><?php
32 } elseif ($check == -2) {
33 ?><p><?php _e('Please make sure the following file has write permissions:', 'http-headers'); ?> <code><?php echo get_user_ini_filename(); ?></code></p><?php
34 }
35 ?>
36 </div>
37 <?php
38 }
39 ?>
40 <p><?php _e('Quick links', 'http-headers'); ?>:
41 <a href="https://zinoui.com/blog/http-headers-for-wordpress" target="_blank" title="HTTP Headers"><?php _e('Getting started', 'http-headers'); ?></a>,
42 <a href="<?php echo get_admin_url(); ?>options-general.php?page=http-headers&amp;tab=advanced"><?php _e('Advanced settings', 'http-headers'); ?></a>,
43 <a href="<?php echo get_admin_url(); ?>options-general.php?page=http-headers&amp;tab=manual"><?php _e('Manual setup', 'http-headers'); ?></a>,
44 <a href="<?php echo get_admin_url(); ?>options-general.php?page=http-headers&amp;tab=inspect"><?php _e('Inspect headers', 'http-headers'); ?></a>
45 </p>
46 <?php
47 if (isset($_GET['header']) && !empty($_GET['header']))
48 {
49 include dirname(__FILE__) . '/header.php';
50 } elseif (isset($_GET['tab']) && $_GET['tab'] == 'advanced') {
51 include dirname(__FILE__) . '/advanced.php';
52 } elseif (isset($_GET['tab']) && $_GET['tab'] == 'manual') {
53 include dirname(__FILE__) . '/manual.php';
54 } elseif (isset($_GET['tab']) && $_GET['tab'] == 'inspect') {
55 include dirname(__FILE__) . '/inspect.php';
56 } elseif (isset($_GET['category'])) {
57 include dirname(__FILE__) . '/category.php';
58 } else {
59 include dirname(__FILE__) . '/dashboard.php';
60 }
61 ?>
62 </div>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 include dirname(__FILE__) . '/includes/config.inc.php';
6 include dirname(__FILE__) . '/includes/breadcrumbs.inc.php';
7 ?>
8 <section class="hh-panel">
9 <h3><span class="hh-highlight"><?php _e('Inspect headers', 'http-headers'); ?></span></h3>
10 <p><?php _e("Use this tool to inspect the HTTP headers of your website or your competitor's website.", 'http-headers'); ?></p>
11 <div class="form-wrap">
12 <form action="<?php echo admin_url('admin-ajax.php'); ?>" method="get" id="frmIspect">
13 <?php wp_nonce_field('inspect'); ?>
14 <input type="hidden" name="action" value="inspect">
15 <div class="form-row">
16 <div class="form-field form-col-6">
17 <label class="form-label">URL:</label>
18 <input type="text" name="url" size="40" placeholder="<?php echo home_url('/'); ?>" value="<?php echo home_url('/'); ?>">
19 </div>
20 <div class="form-field form-col-6">
21 <label class="form-label">&nbsp;</label>
22 <label><input type="checkbox" name="authentication" id="authentication"><?php _e('Authentication', 'http-headers'); ?></label>
23 </div>
24 </div>
25 <div id="box-authentication" style="display: none">
26 <div class="form-row">
27 <div class="form-field form-col-6">
28 <label class="form-label" for="username"><?php _e('Username', 'http-headers'); ?>:</label>
29 <input type="text" name="username">
30 </div>
31 <div class="form-field form-col-6">
32 <label class="form-label" for="password"><?php _e('Password', 'http-headers'); ?>:</label>
33 <input type="text" name="password">
34 </div>
35 </div>
36 </div>
37 <?php submit_button(__('Inspect', 'http-headers')); ?>
38 </form>
39 </div>
40 </section>
41
42 <div id="hh-result"></div>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 include dirname(__FILE__) . '/includes/breadcrumbs.inc.php';
6 ?>
7 <div class="hh-tabs">
8 <ul>
9 <li class="hh-active"><a href="#hh-tab-1">Apache</a></li>
10 <li><a href="#hh-tab-2">Nginx</a></li>
11 </ul>
12 <div id="hh-tab-1" class="hh-tab-active">
13 <h3><span class="hh-highlight"><?php echo get_htaccess_filename(); ?></span></h3>
14 <textarea class="hh-textarea-manual" rows="20" readonly><?php
15 $lines = apache_headers_directives();
16 if ($lines)
17 {
18 echo join("\n", $lines);
19 echo "\n\n";
20 }
21
22 $lines = apache_auth_directives();
23 if ($lines)
24 {
25 echo join("\n", $lines);
26 echo "\n\n";
27 }
28
29 $lines = apache_content_encoding_directives();
30 if ($lines)
31 {
32 echo join("\n", $lines);
33 echo "\n\n";
34 }
35
36 $lines = apache_expires_directives();
37 if ($lines)
38 {
39 echo join("\n", $lines);
40 echo "\n\n";
41 }
42
43 $lines = apache_cookie_security_directives();
44 if ($lines)
45 {
46 echo join("\n", $lines);
47 echo "\n\n";
48 }
49
50 $lines = apache_timing_directives();
51 echo join("\n", $lines);
52 ?></textarea>
53 <?php
54 $credentials = apache_auth_credentials();
55 if ($credentials)
56 {
57 ?>
58 <h3><span class="hh-highlight"><?php echo $credentials['ht_file']; ?></span></h3>
59 <textarea class="hh-textarea-manual" rows="5" readonly><?php
60 echo $credentials['auth'];
61 ?></textarea><?php
62 }
63 ?>
64 </div>
65 <div id="hh-tab-2" class="hh-hidden">
66 <textarea class="hh-textarea-manual" rows="20" readonly><?php
67 $lines = nginx_headers_directives();
68 if ($lines)
69 {
70 echo join("\n", $lines);
71 echo "\n\n";
72 }
73
74 $lines = nginx_auth_directives();
75 if ($lines)
76 {
77 echo join("\n", $lines);
78 echo "\n\n";
79 }
80
81 $lines = nginx_content_encoding_directives();
82 if ($lines)
83 {
84 echo join("\n", $lines);
85 echo "\n\n";
86 }
87
88 $lines = nginx_expires_directives();
89 if ($lines)
90 {
91 echo join("\n", $lines);
92 echo "\n\n";
93 }
94
95 $lines = nginx_cookie_security_directives();
96 if ($lines)
97 {
98 echo join("\n", $lines);
99 echo "\n\n";
100 }
101
102 $lines = nginx_timing_directives();
103 if ($lines)
104 {
105 echo join("\n", $lines);
106 echo "\n\n";
107 }
108 ?></textarea>
109 <?php
110 $credentials = nginx_auth_credentials();
111 if ($credentials)
112 {
113 ?>
114 <h3><span class="hh-highlight"><?php echo $credentials['ht_file']; ?></span></h3>
115 <textarea class="hh-textarea-manual" rows="5" readonly><?php
116 echo $credentials['auth'];
117 ?></textarea><?php
118 }
119 ?>
120 </div>
121 </div>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr valign="top">
7 <th scope="row">NEL
8 <p class="description"><?php _e('Network Error Logging is a mechanism that can be configured via the NEL HTTP response header. This experimental header allows web sites and applications to opt-in to receive reports about failed (and, if desired, successful) network fetches from supporting browsers.', 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Network_Error_Logging"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">NEL</legend>
17 <?php
18 $nel = get_option('hh_nel', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_nel" value="<?php echo $k; ?>"<?php checked($nel, $k, true); ?> /> <?php echo $v; ?></label></p><?php
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-nel' ); ?>
28 <?php do_settings_sections( 'http-headers-nel' ); ?>
29 <?php
30 $nel_value = get_option('hh_nel_value', array());
31
32 $report_to = isset($nel_value['report_to']) ? $nel_value['report_to'] : NULL;
33 $max_age = isset($nel_value['max_age']) ? $nel_value['max_age'] : NULL;
34 $include_subdomains = isset($nel_value['include_subdomains']) ? $nel_value['include_subdomains'] : NULL;
35 $success_fraction = isset($nel_value['success_fraction']) ? $nel_value['success_fraction'] : NULL;
36 $failure_fraction = isset($nel_value['failure_fraction']) ? $nel_value['failure_fraction'] : NULL;
37 $request_headers = isset($nel_value['request_headers']) ? $nel_value['request_headers'] : NULL;
38 $response_headers = isset($nel_value['response_headers']) ? $nel_value['response_headers'] : NULL;
39 ?>
40 <table>
41 <tr>
42 <td>report_to:</td>
43 <td><input type="text" class="http-header-value" name="hh_nel_value[report_to]" value="<?php echo esc_attr($report_to); ?>"<?php echo $nel == 1 ? NULL : ' readonly'; ?>></td>
44 </tr>
45 <tr>
46 <td>max_age:</td>
47 <td><select name="hh_nel_value[max_age]" class="http-header-value"<?php echo $nel == 1 ? NULL : ' readonly'; ?>>
48 <?php
49 $items = array('3600' => '1 hour', '86400' => '1 day', '604800' => '7 days', '2592000' => '30 days', '5184000' => '60 days', '7776000' => '90 days', '31536000' => '1 year');
50 foreach ($items as $key => $item) {
51 ?><option value="<?php echo $key; ?>"<?php selected($max_age, $key); ?>><?php echo $item; ?></option><?php
52 }
53 ?>
54 </select></td>
55 </tr>
56 <tr>
57 <td>include_subdomains:</td>
58 <td><input type="checkbox" class="http-header-value" name="hh_nel_value[include_subdomains]" value="1"<?php checked($include_subdomains, 1, true); ?><?php echo $nel == 1 ? NULL : ' readonly'; ?>></td>
59 </tr>
60 <tr>
61 <td>success_fraction:</td>
62 <td><input type="number" class="http-header-value" name="hh_nel_value[success_fraction]" value="<?php echo esc_attr($success_fraction); ?>"<?php echo $nel == 1 ? NULL : ' readonly'; ?> min="0.0" max="1.0" step="0.1"></td>
63 </tr>
64 <tr>
65 <td>failure_fraction:</td>
66 <td><input type="number" class="http-header-value" name="hh_nel_value[failure_fraction]" value="<?php echo esc_attr($failure_fraction); ?>"<?php echo $nel == 1 ? NULL : ' readonly'; ?> min="0.0" max="1.0" step="0.1"></td>
67 </tr>
68 <tr>
69 <td>request_headers:</td>
70 <td><input type="text" class="http-header-value" name="hh_nel_value[request_headers]" value="<?php echo esc_attr($request_headers); ?>"<?php echo $nel == 1 ? NULL : ' readonly'; ?>></td>
71 </tr>
72 <tr>
73 <td>response_headers:</td>
74 <td><input type="text" class="http-header-value" name="hh_nel_value[response_headers]" value="<?php echo esc_attr($response_headers); ?>"<?php echo $nel == 1 ? NULL : ' readonly'; ?>></td>
75 </tr>
76 </table>
77 </td>
78 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr valign="top">
7 <th scope="row">P3P
8 <p class="description"><?php _e('The Platform for Privacy Preferences Project (P3P) is a protocol allowing websites to declare their intended use of information they collect about web browser users.', 'http-headers'); ?></p>
9 </th>
10 <td>
11 <fieldset>
12 <legend class="screen-reader-text">P3P</legend>
13 <?php
14 $p3p = get_option('hh_p3p', 0);
15 foreach ($bools as $k => $v)
16 {
17 ?><p><label><input type="radio" class="http-header" name="hh_p3p" value="<?php echo $k; ?>"<?php checked($p3p, $k); ?> /> <?php echo $v; ?></label></p><?php
18 }
19 ?>
20 </fieldset>
21 </td>
22 <td>
23 <?php settings_fields( 'http-headers-p3p' ); ?>
24 <?php do_settings_sections( 'http-headers-p3p' ); ?>
25 <?php
26 $p3p_value = get_option('hh_p3p_value');
27 if (!$p3p_value)
28 {
29 $p3p_value = array();
30 }
31 $in_creq = array('ADM', 'DEV', 'TAI', 'PSA', 'PSD', 'IVA', 'IVD', 'CON', 'HIS', 'TEL', 'OTP', 'DEL', 'SAM', 'UNR', 'PUB', 'OTR',);
32 $creq = array('a', 'i', 'o');
33 ?>
34 <table>
35 <tbody>
36 <tr>
37 <td>Compact ACCESS</td>
38 <td class="hh-td-inner">
39 <table><tbody><tr><?php
40 $items = array('NOI', 'ALL', 'CAO', 'IDC', 'OTI', 'NON');
41 foreach ($items as $i => $item) {
42 if ($i > 0 && $i % 4 === 0) {
43 ?></tr><tr><?php
44 }
45 ?><td><label><input type="checkbox" class="http-header-value" name="hh_p3p_value[<?php echo $item; ?>]" value="1"<?php echo !array_key_exists($item, $p3p_value) ? NULL : ' checked'; ?><?php echo $p3p == 1 ? NULL : ' readonly'; ?> /> <?php echo $item; ?></label></td><?php
46 }
47 ?></tr></tbody></table>
48 </td>
49 </tr>
50 <tr>
51 <td>Compact DISPUTES</td>
52 <td class="hh-td-inner">
53 <table><tbody><tr><?php
54 $items = array('DSP');
55 foreach ($items as $i => $item) {
56 if ($i > 0 && $i % 4 === 0) {
57 ?></tr><tr><?php
58 }
59 ?><td><label><input type="checkbox" class="http-header-value" name="hh_p3p_value[<?php echo $item; ?>]" value="1"<?php echo !array_key_exists($item, $p3p_value) ? NULL : ' checked'; ?><?php echo $p3p == 1 ? NULL : ' readonly'; ?> /> <?php echo $item; ?></label></td><?php
60 }
61 ?></tr></tbody></table>
62 </td>
63 </tr>
64 <tr>
65 <td>Compact REMEDIES</td>
66 <td class="hh-td-inner">
67 <table><tbody><tr><?php
68 $items = array('COR', 'MON', 'LAW');
69 foreach ($items as $i => $item) {
70 if ($i > 0 && $i % 4 === 0) {
71 ?></tr><tr><?php
72 }
73 ?><td><label><input type="checkbox" class="http-header-value" name="hh_p3p_value[<?php echo $item; ?>]" value="1"<?php echo !array_key_exists($item, $p3p_value) ? NULL : ' checked'; ?><?php echo $p3p == 1 ? NULL : ' readonly'; ?> /> <?php echo $item; ?></label></td><?php
74 }
75 ?></tr></tbody></table>
76 </td>
77 </tr>
78 <tr>
79 <td>Compact NON-IDENTIFIABLE</td>
80 <td class="hh-td-inner">
81 <table><tbody><tr><?php
82 $items = array('NID');
83 foreach ($items as $i => $item) {
84 if ($i > 0 && $i % 4 === 0) {
85 ?></tr><tr><?php
86 }
87 ?><td><label><input type="checkbox" class="http-header-value" name="hh_p3p_value[<?php echo $item; ?>]" value="1"<?php echo !array_key_exists($item, $p3p_value) ? NULL : ' checked'; ?><?php echo $p3p == 1 ? NULL : ' readonly'; ?> /> <?php echo $item; ?></label></td><?php
88 }
89 ?></tr></tbody></table>
90 </td>
91 </tr>
92 <tr>
93 <td>Compact PURPOSE</td>
94 <td class="hh-td-inner">
95 <table><tbody><tr><?php
96 $items = array('CUR', 'ADM', 'DEV', 'TAI', 'PSA', 'PSD', 'IVA', 'IVD', 'CON', 'HIS', 'TEL', 'OTP');
97 foreach ($items as $i => $item) {
98 if ($i > 0 && $i % 4 === 0) {
99 ?></tr><tr><?php
100 }
101 ?><td><label><input type="checkbox" class="http-header-value" name="hh_p3p_value[<?php echo $item; ?>]" value="1"<?php echo !array_key_exists($item, $p3p_value) ? NULL : ' checked'; ?><?php echo $p3p == 1 ? NULL : ' readonly'; ?> /> <?php echo $item; ?></label></td><?php
102 }
103 ?></tr></tbody></table>
104 </td>
105 </tr>
106 <tr>
107 <td>Compact RECIPIENT</td>
108 <td class="hh-td-inner">
109 <table><tbody><tr><?php
110 $items = array('OUR', 'DEL', 'SAM', 'UNR', 'PUB', 'OTR');
111 foreach ($items as $i => $item) {
112 if ($i > 0 && $i % 4 === 0) {
113 ?></tr><tr><?php
114 }
115 ?><td><label><input type="checkbox" class="http-header-value" name="hh_p3p_value[<?php echo $item; ?>]" value="1"<?php echo !array_key_exists($item, $p3p_value) ? NULL : ' checked'; ?><?php echo $p3p == 1 ? NULL : ' readonly'; ?> /> <?php echo $item; ?></label></td><?php
116 }
117 ?></tr></tbody></table>
118 </td>
119 </tr>
120 <tr>
121 <td>Compact RETENTION</td>
122 <td class="hh-td-inner">
123 <table><tbody><tr><?php
124 $items = array('NOR', 'STP', 'LEG', 'BUS', 'IND');
125 foreach ($items as $i => $item) {
126 if ($i > 0 && $i % 4 === 0) {
127 ?></tr><tr><?php
128 }
129 ?><td><label><input type="checkbox" class="http-header-value" name="hh_p3p_value[<?php echo $item; ?>]" value="1"<?php echo !array_key_exists($item, $p3p_value) ? NULL : ' checked'; ?><?php echo $p3p == 1 ? NULL : ' readonly'; ?> /> <?php echo $item; ?></label></td><?php
130 }
131 ?></tr></tbody></table>
132 </td>
133 </tr>
134 <tr>
135 <td>Compact CATEGORIES</td>
136 <td class="hh-td-inner">
137 <table><tbody><tr><?php
138 $items = array('PHY', 'ONL', 'UNI', 'PUR', 'FIN', 'COM', 'NAV', 'INT', 'DEM', 'CNT', 'STA', 'POL', 'HEA', 'PRE', 'LOC', 'GOV', 'OTC');
139 foreach ($items as $i => $item) {
140 if ($i > 0 && $i % 4 === 0) {
141 ?></tr><tr><?php
142 }
143 ?><td><label><input type="checkbox" class="http-header-value" name="hh_p3p_value[<?php echo $item; ?>]" value="1"<?php echo !array_key_exists($item, $p3p_value) ? NULL : ' checked'; ?><?php echo $p3p == 1 ? NULL : ' readonly'; ?> /> <?php echo $item; ?></label></td><?php
144 }
145 ?></tr></tbody></table>
146 </td>
147 </tr>
148 <tr>
149 <td>Compact TEST</td>
150 <td class="hh-td-inner">
151 <table><tbody><tr><?php
152 $items = array('TST');
153 foreach ($items as $i => $item) {
154 if ($i > 0 && $i % 4 === 0) {
155 ?></tr><tr><?php
156 }
157 ?><td><label><input type="checkbox" class="http-header-value" name="hh_p3p_value[<?php echo $item; ?>]" value="1"<?php echo !array_key_exists($item, $p3p_value) ? NULL : ' checked'; ?><?php echo $p3p == 1 ? NULL : ' readonly'; ?> /> <?php echo $item; ?></label></td><?php
158 }
159 ?></tr></tbody></table>
160 </td>
161 </tr>
162 </tbody>
163 </table>
164
165 </td>
166 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr valign="top">
7 <th scope="row">Permissions-Policy
8 <p class="description"><?php _e('Permissions Policy is a web platform API which gives a website the ability to allow or block the use of browser features in its own frame or in iframes that it embeds.', 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://www.w3.org/TR/permissions-policy-1/"><?php _e('W3C Working Draft', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">Permissions-Policy</legend>
17 <?php
18 $permissions_policy = get_option('hh_permissions_policy', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_permissions_policy" value="<?php echo $k; ?>"<?php checked($permissions_policy, $k, true); ?> /> <?php echo $v; ?></label></p><?php
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-pp' ); ?>
28 <?php do_settings_sections( 'http-headers-pp' ); ?>
29 <table>
30 <tbody>
31 <?php
32 # https://github.com/w3c/webappsec-permissions-policy/blob/master/features.md
33 $features = array(
34 'accelerometer',
35 'ambient-light-sensor',
36 'autoplay',
37 'battery',
38 'camera',
39 'cross-origin-isolated',
40 'display-capture',
41 'document-domain',
42 'encrypted-media',
43 'execution-while-not-rendered',
44 'execution-while-out-of-viewport',
45 'fullscreen',
46 'geolocation',
47 'gyroscope',
48 'interest-cohort',
49 'layout-animations',
50 'legacy-image-formats',
51 'magnetometer',
52 'microphone',
53 'midi',
54 'navigation-override',
55 'oversized-images',
56 'payment',
57 'picture-in-picture',
58 'publickey-credentials-get',
59 'screen-wake-lock',
60 'sync-script',
61 'sync-xhr',
62 'usb',
63 'vertical-scroll',
64 'web-share',
65 'wake-lock',
66 'xr-spatial-tracking',
67 );
68 $origins = array('none', 'self', '*', 'origin(s)');
69
70 $permissions_policy_value = get_option('hh_permissions_policy_value');
71 $permissions_policy_feature = get_option('hh_permissions_policy_feature');
72 $permissions_policy_origin = get_option('hh_permissions_policy_origin');
73 if (!$permissions_policy_value)
74 {
75 $permissions_policy_value = array();
76 }
77 if (!$permissions_policy_feature)
78 {
79 $permissions_policy_feature = array();
80 }
81 if (!$permissions_policy_origin)
82 {
83 $permissions_policy_origin = array();
84 }
85
86 foreach ($features as $feature)
87 {
88 ?>
89 <tr>
90 <td><input type="checkbox" name="hh_permissions_policy_feature[<?php echo $feature; ?>]" class="http-header-value"
91 value="1"<?php echo !is_array($permissions_policy_feature) || !array_key_exists($feature, $permissions_policy_feature) ? NULL : ' checked'; ?><?php echo $permissions_policy == 1 ? NULL : ' readonly'; ?>></td>
92 <td><?php echo $feature; ?></td>
93 <td>
94 <select name="hh_permissions_policy_value[<?php echo $feature; ?>]"
95 class="http-header-value"<?php echo $permissions_policy == 1 ? NULL : ' readonly'; ?>>
96 <?php
97 foreach ($origins as $origin)
98 {
99 ?><option value="<?php echo $origin; ?>"<?php selected(@$permissions_policy_value[$feature], $origin); ?>><?php echo $origin; ?></option><?php
100 }
101 ?>
102 </select>
103 <input type="text" name="hh_permissions_policy_origin[<?php echo $feature; ?>]"
104 value="<?php echo htmlspecialchars( @$permissions_policy_origin[$feature] ); ?>" size="30"<?php echo isset($permissions_policy_value[$feature]) && in_array($permissions_policy_value[$feature], array('origin(s)', 'self')) ? NULL : ' style="display: none"'; ?>
105 class="http-header-value"<?php echo $permissions_policy == 1 ? NULL : ' readonly'; ?>>
106 </td>
107 </tr>
108 <?php
109 }
110 ?>
111 </tbody>
112 </table>
113 </td>
114 </td>
115 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr valign="top">
7 <th scope="row">Pragma
8 <p class="description"><?php _e('The Pragma HTTP/1.0 general header is an implementation-specific header that may have various effects along the request-response chain. It is used for backwards compatibility with HTTP/1.0 caches where the Cache-Control HTTP/1.1 header is not yet present.', 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Pragma"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">Pragma</legend>
17 <?php
18 $pragma = get_option('hh_pragma', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_pragma" value="<?php echo $k; ?>"<?php checked($pragma, $k); ?> /> <?php echo $v; ?></label></p><?php
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-pra' ); ?>
28 <?php do_settings_sections( 'http-headers-pra' ); ?>
29 <select name="hh_pragma_value" class="http-header-value"<?php echo $pragma == 1 ? NULL : ' readonly'; ?>>
30 <?php
31 $items = array('no-cache');
32 $pragma_value = get_option('hh_pragma_value');
33 foreach ($items as $item) {
34 ?><option value="<?php echo $item; ?>"<?php selected($pragma_value, $item); ?>><?php echo $item; ?></option><?php
35 }
36 ?>
37 </select>
38 </td>
39 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr valign="top">
7 <th scope="row">Referrer-Policy
8 <p class="description"><?php _e('The Referrer-Policy HTTP header governs which referrer information, sent in the Referer header, should be included with requests made.', 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">Referrer-Policy</legend>
17 <?php
18 $referrer_policy = get_option('hh_referrer_policy', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_referrer_policy" value="<?php echo $k; ?>"<?php checked($referrer_policy, $k, true); ?> /> <?php echo $v; ?></label></p><?php
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-rp' ); ?>
28 <?php do_settings_sections( 'http-headers-rp' ); ?>
29 <select name="hh_referrer_policy_value" class="http-header-value"<?php echo $referrer_policy == 1 ? NULL : ' readonly'; ?>>
30 <?php
31 $items = array("", "no-referrer", "no-referrer-when-downgrade", "same-origin", "origin", "strict-origin", "origin-when-cross-origin", "strict-origin-when-cross-origin", "unsafe-url");
32 $referrer_policy_value = get_option('hh_referrer_policy_value');
33 foreach ($items as $item) {
34 ?><option value="<?php echo $item; ?>"<?php selected($referrer_policy_value, $item); ?>><?php echo !empty($item) ? $item : '(empty string)'; ?></option><?php
35 }
36 ?>
37 </select>
38 </td>
39 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr valign="top">
7 <th scope="row">Report-To
8 <p class="description"><?php _e('The Report-To HTTP response header field instructs the user agent to store reporting endpoints for an origin.', 'http-headers'); ?></p>
9 </th>
10 <td>
11 <fieldset>
12 <legend class="screen-reader-text">Report-To</legend>
13 <?php
14 $report_to = get_option('hh_report_to', 0);
15 foreach ($bools as $k => $v)
16 {
17 ?><p><label><input type="radio" class="http-header" name="hh_report_to" value="<?php echo $k; ?>"<?php checked($report_to, $k, true); ?> /> <?php echo $v; ?></label></p><?php
18 }
19 ?>
20 </fieldset>
21 <?php settings_fields( 'http-headers-rt' ); ?>
22 <?php do_settings_sections( 'http-headers-rt' ); ?>
23 </td>
24 </tr>
25 <?php
26 $default_value = array(
27 array(
28 'endpoints' => array(),
29 'group' => '',
30 'max_age' => '',
31 )
32 );
33 $report_to_value = get_option('hh_report_to_value');
34 if (!is_array($report_to_value) || empty($report_to_value))
35 {
36 $report_to_value = $default_value;
37 }
38 ?>
39 <tr>
40 <td colspan="2">
41 <div style="max-width: 1024px; overflow-x: auto">
42 <table class="hh-bordered hh-p-sm">
43 <tr>
44 <th rowspan="2" class="hh-center hh-middle">group</th>
45 <th rowspan="2" class="hh-center hh-middle">max_age</th>
46 <th rowspan="2" class="hh-center hh-middle">include_subdomains</th>
47 <th colspan="3" class="hh-center">endpoints</th>
48 <th>&nbsp;</th>
49 <th>&nbsp;</th>
50 </tr>
51 <tr>
52 <th class="hh-center">url</th>
53 <th class="hh-center">priority</th>
54 <th class="hh-center">weight</th>
55 <th>&nbsp;</th>
56 <th>&nbsp;</th>
57 </tr>
58 <?php
59 $items = array('0' => '0 (Delete entire reporting cache)', '3600' => '1 hour', '86400' => '1 day', '604800' => '7 days', '2592000' => '30 days', '5184000' => '60 days', '7776000' => '90 days', '31536000' => '1 year', '63072000' => '2 years');
60 $i = 0;
61 foreach ($report_to_value as $item)
62 {
63 if (isset($item['endpoints']) && !empty($item['endpoints']))
64 {
65 $cnt = count($item['endpoints']);
66 $c = 0;
67 foreach ($item['endpoints'] as $k => $v)
68 {
69 $classes = array();
70 if ($c == 0)
71 {
72 if ($i == 0)
73 {
74 $classes[] = 'hh-tr-first';
75 }
76 $classes[] = 'hh-tr-group-start';
77 }
78
79 if ($c == $cnt - 1)
80 {
81 $classes[] = 'hh-tr-group-end';
82 }
83 ?>
84 <tr class="<?php echo join(' ', $classes); ?>">
85 <?php
86 if ($c == 0)
87 {
88 ?>
89 <td rowspan="<?php echo $cnt; ?>" class="hh-middle"><input type="text" class="http-header-value" name="hh_report_to_value[<?php echo $i; ?>][group]" value="<?php echo esc_attr($item['group']); ?>" placeholder="csp-endpoint"<?php echo $report_to == 1 ? NULL : ' readonly'; ?>></td>
90 <td rowspan="<?php echo $cnt; ?>" class="hh-middle"><select class="http-header-value" name="hh_report_to_value[<?php echo $i; ?>][max_age]"<?php echo $report_to == 1 ? NULL : ' readonly'; ?>>
91 <?php
92 foreach ($items as $key => $val) {
93 ?><option value="<?php echo $key; ?>"<?php selected($item['max_age'], $key); ?>><?php echo $val; ?></option><?php
94 }
95 ?>
96 </select></td>
97 <td rowspan="<?php echo $cnt; ?>" class="hh-middle hh-center"><input type="checkbox" class="http-header-value" name="hh_report_to_value[<?php echo $i; ?>][include_subdomains]" value="1"<?php checked(@$item['include_subdomains'], 1, true); ?><?php echo $report_to == 1 ? NULL : ' readonly'; ?> /></td>
98 <?php
99 }
100 ?>
101
102 <td><input type="text" class="http-header-value" name="hh_report_to_value[<?php echo $i; ?>][endpoints][<?php echo $k; ?>][url]" value="<?php echo esc_attr($v['url']); ?>" placeholder="https://example.com/report/csp"<?php echo $report_to == 1 ? NULL : ' readonly'; ?> size="40"></td>
103 <td><input type="number" class="http-header-value" name="hh_report_to_value[<?php echo $i; ?>][endpoints][<?php echo $k; ?>][priority]" value="<?php echo esc_attr($v['priority']); ?>" min="0" step="1"></td>
104 <td><input type="number" class="http-header-value" name="hh_report_to_value[<?php echo $i; ?>][endpoints][<?php echo $k; ?>][weight]" value="<?php echo esc_attr($v['weight']); ?>" min="0" step="1"></td>
105
106 <td><?php
107 if ($c == 0)
108 {
109 ?>
110 <button type="button" class="button hh-btn-add-endpoint"><?php _e('Add endpoint', 'http-headers'); ?></button>
111 <?php
112 } else {
113 ?>
114 <button type="button" class="button hh-btn-delete-endpoint"><?php _e('Remove endpoint', 'http-headers'); ?></button>
115 <?php
116 }
117 ?></td>
118 <?php
119 if ($c == 0)
120 {
121 ?>
122 <td rowspan="<?php echo $cnt; ?>" class="hh-middle hh-center"><?php
123 if ($i > 0)
124 {
125 ?>
126 <button type="button" class="button hh-btn-delete-endpoint-group" title="<?php esc_attr_e('Delete', 'http-headers'); ?>"><?php _e('Remove group', 'http-headers'); ?></button>
127 <?php
128 }
129 ?></td>
130 <?php
131 }
132 ?>
133 </tr>
134 <?php
135 $c += 1;
136 }
137 } else {
138 ?>
139 <tr class="hh-tr-first hh-tr-group-start hh-tr-group-end">
140 <td><input type="text" class="http-header-value" name="hh_report_to_value[<?php echo $i; ?>][group]" value="<?php echo esc_attr($item['group']); ?>" placeholder="csp-endpoint"<?php echo $report_to == 1 ? NULL : ' readonly'; ?>></td>
141 <td><select class="http-header-value" name="hh_report_to_value[<?php echo $i; ?>][max_age]"<?php echo $report_to == 1 ? NULL : ' readonly'; ?>>
142 <?php
143 foreach ($items as $key => $val) {
144 ?><option value="<?php echo $key; ?>"<?php selected($item['max_age'], $key); ?>><?php echo $val; ?></option><?php
145 }
146 ?>
147 </select></td>
148 <td class="hh-center"><input type="checkbox" class="http-header-value" name="hh_report_to_value[<?php echo $i; ?>][include_subdomains]" value="1"<?php checked(@$item['include_subdomains'], 1, true); ?><?php echo $report_to == 1 ? NULL : ' readonly'; ?> /></td>
149
150 <td><input type="text" class="http-header-value" name="hh_report_to_value[<?php echo $i; ?>][endpoints][0][url]" placeholder="https://example.com/report/csp"<?php echo $report_to == 1 ? NULL : ' readonly'; ?> size="40"></td>
151 <td><input type="number" class="http-header-value" name="hh_report_to_value[<?php echo $i; ?>][endpoints][0][priority]" min="0" step="1"></td>
152 <td><input type="number" class="http-header-value" name="hh_report_to_value[<?php echo $i; ?>][endpoints][0][weight]" min="0" step="1"></td>
153
154 <td>
155 <button type="button" class="button hh-btn-add-endpoint"><?php _e('Add endpoint', 'http-headers'); ?></button>
156 </td>
157 <td rowspan="1"><?php
158 if ($i > 0)
159 {
160 ?><button type="button" class="button hh-btn-delete-endpoint-group" title="<?php esc_attr_e('Delete', 'http-headers'); ?>"><?php _e('Remove group', 'http-headers'); ?></button><?php
161 }
162 ?></td>
163 </tr>
164 <?php
165 }
166 $i += 1;
167 }
168 ?>
169 <tr>
170 <td colspan="8">
171 <button type="button" class="button" id="hh-btn-add-endpoint-group">+ <?php _e('Add endpoint group', 'http-headers'); ?></button>
172 </td>
173 </tr>
174 </table>
175 </div>
176 </td>
177 </tr>
...\ No newline at end of file ...\ No newline at end of file
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 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">Strict-Transport-Security</legend>
17 <?php
18 $strict_transport_security = get_option('hh_strict_transport_security', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><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
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-sts' ); ?>
28 <?php do_settings_sections( 'http-headers-sts' ); ?>
29 <table>
30 <tr>
31 <td>max-age:</td>
32 <td><select name="hh_strict_transport_security_max_age" class="http-header-value"<?php echo $strict_transport_security == 1 ? NULL : ' readonly'; ?>>
33 <?php
34 $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');
35 $strict_transport_security_max_age = get_option('hh_strict_transport_security_max_age');
36 foreach ($items as $key => $item) {
37 ?><option value="<?php echo $key; ?>"<?php selected($strict_transport_security_max_age, $key); ?>><?php echo $item; ?></option><?php
38 }
39 ?>
40 </select></td>
41 </tr>
42 <tr>
43 <td>includeSubDomains:</td>
44 <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>
45 </tr>
46 <tr>
47 <td>preload:</td>
48 <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>
49 </tr>
50 </table>
51 </td>
52 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr>
7 <th scope="row">Timing-Allow-Origin
8 <p class="description"><?php _e('The Timing-Allow-Origin header indicates whether a resource provides the complete timing information. SEO tools use the Resource Timing API to analyze the speed and weight of your web page resources.', 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Timing-Allow-Origin"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">Timing-Allow-Origin</legend>
17 <?php
18 $timing_allow_origin = get_option('hh_timing_allow_origin', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_timing_allow_origin" value="<?php echo $k; ?>"<?php checked($timing_allow_origin, $k); ?> /> <?php echo $v; ?></label></p><?php
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-tao' ); ?>
28 <?php do_settings_sections( 'http-headers-tao' ); ?>
29 <select name="hh_timing_allow_origin_value" class="http-header-value"<?php echo $timing_allow_origin == 1 ? NULL : ' readonly'; ?>>
30 <?php
31 $items = array('*', 'origin');
32 $timing_allow_origin_value = get_option('hh_timing_allow_origin_value');
33 foreach ($items as $item) {
34 ?><option value="<?php echo $item; ?>"<?php selected($timing_allow_origin_value, $item); ?>><?php echo $item; ?></option><?php
35 }
36 ?>
37 </select>
38 <input type="text" name="hh_timing_allow_origin_url" class="http-header-value" placeholder="http://domain.com" value="<?php echo esc_attr(get_option('hh_timing_allow_origin_url')); ?>" size="35"<?php echo $timing_allow_origin == 1 && $timing_allow_origin_value == 'origin' ? NULL : ' style="display: none" readonly'; ?> />
39 </td>
40 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr>
7 <th scope="row">Vary
8 <p class="description"><?php _e('The Vary HTTP response header determines how to match future request headers to decide whether a cached response can be used rather than requesting a fresh one from the origin server. It is used by the server to indicate which headers it used when selecting a representation of a resource in a content negotiation algorithm.', 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Vary"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">Vary</legend>
17 <?php
18 $vary = get_option('hh_vary', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_vary" value="<?php echo $k; ?>"<?php checked($vary, $k); ?> /> <?php echo $v; ?></label></p><?php
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-vary' ); ?>
28 <?php do_settings_sections( 'http-headers-vary' ); ?>
29 <table>
30 <tbody>
31 <tr>
32 <td>
33 <?php
34 $items = array(
35 '*', 'Accept-Encoding', 'User-Agent', 'Referer', 'Cookie',
36 );
37 $vary_value = get_option('hh_vary_value');
38 if (!$vary_value) {
39 $vary_value = array();
40 }
41 foreach ($items as $item)
42 {
43 ?><p><label><input type="checkbox" class="http-header-value" name="hh_vary_value[<?php echo $item; ?>]" value="1"<?php echo !array_key_exists($item, $vary_value) ? NULL : ' checked'; ?><?php echo $vary == 1 ? NULL : ' readonly'; ?> /> <?php echo $item; ?></label></p><?php
44 }
45 ?>
46 </td>
47 </tr>
48 </tbody>
49 </table>
50 </td>
51 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr valign="top">
7 <th scope="row">WWW-Authenticate
8 <p class="description"><?php _e('HTTP supports the use of several authentication mechanisms to control access to pages and other resources. These mechanisms are all based around the use of the 401 status code and the WWW-Authenticate response header.', 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/WWW-Authenticate"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">WWW-Authenticate</legend>
17 <?php
18 $www_authenticate = get_option ( 'hh_www_authenticate', 0 );
19 foreach ( $bools as $k => $v ) {
20 ?><p>
21 <label><input type="radio" class="http-header" name="hh_www_authenticate" value="<?php echo $k; ?>" <?php checked($www_authenticate, $k, true); ?> /> <?php echo $v; ?></label>
22 </p><?php
23 }
24 ?>
25 </fieldset>
26 </td>
27 <td>
28 <?php settings_fields( 'http-headers-wwa' ); ?>
29 <?php do_settings_sections( 'http-headers-wwa' ); ?>
30 <table>
31 <tbody>
32 <tr>
33 <td>Type</td>
34 <td colspan="3">
35 <select name="hh_www_authenticate_type" class="http-header-value"<?php echo $www_authenticate == 1 ? NULL : ' readonly'; ?>>
36 <?php
37 $items = array ('Basic', 'Digest');
38 $www_authenticate_type = get_option ( 'hh_www_authenticate_type' );
39 foreach ( $items as $item ) {
40 ?><option value="<?php echo $item; ?>" <?php selected($www_authenticate_type, $item); ?>><?php echo $item; ?></option><?php
41 }
42 ?>
43 </select>
44 </td>
45 </tr>
46 <tr>
47 <td>Realm</td>
48 <td colspan="3"><input type="text" name="hh_www_authenticate_realm" class="http-header-value" size="30" value="<?php echo esc_attr(get_option('hh_www_authenticate_realm')); ?>"<?php echo $www_authenticate == 1 ? NULL : ' readonly'; ?> placeholder="Restricted area"></td>
49 </tr>
50 <tr>
51 <td>&nbsp;</td>
52 <td><strong><?php _e('Username', 'http-headers'); ?></strong></td>
53 <td><strong><?php _e('Password', 'http-headers'); ?></strong></td>
54 <td>&nbsp;</td>
55 </tr>
56 <?php
57 $usernames = get_option('hh_www_authenticate_user', array());
58 $passwords = get_option('hh_www_authenticate_pswd', array());
59 if (!is_array($usernames)) {
60 $usernames = array($usernames);
61 }
62 if (!is_array($passwords)) {
63 $passwords = array($passwords);
64 }
65 $i = 0;
66 foreach ($usernames as $k => $user) {
67 ?>
68 <tr>
69 <td>&nbsp;</td>
70 <td><input type="text" name="hh_www_authenticate_user[]" class="http-header-value" value="<?php echo esc_attr($user); ?>"<?php echo $www_authenticate == 1 ? NULL : ' readonly'; ?>></td>
71 <td><input type="text" name="hh_www_authenticate_pswd[]" class="http-header-value" value="<?php echo esc_attr($passwords[$k]); ?>"<?php echo $www_authenticate == 1 ? NULL : ' readonly'; ?>></td>
72 <td><?php
73 if ($i > 0)
74 {
75 ?><button type="button" class="button button-small hh-btn-delete-user" title="<?php esc_attr_e('Delete', 'http-headers'); ?>">x</button><?php
76 } else {
77 echo "&nbsp;";
78 }
79 ?></td>
80 </tr>
81 <?php
82 $i += 1;
83 }
84 ?>
85 <tr>
86 <td>&nbsp;</td>
87 <td colspan="3">
88 <button type="button" class="button hh-btn-add-user">+ <?php _e('Add user', 'http-headers'); ?></button>
89 </td>
90 </tr>
91 </tbody>
92 </table>
93 </td>
94 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr valign="top">
7 <th scope="row">X-Content-Type-Options
8 <p class="description"><?php _e('Prevents Internet Explorer and Google Chrome from MIME-sniffing a response away from the declared content-type. This also applies to Google Chrome, when downloading extensions. This reduces exposure to drive-by download attacks and sites serving user uploaded content that, by clever naming, could be treated by MSIE as executable or dynamic HTML files.', 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">X-Content-Type-Options</legend>
17 <?php
18 $x_content_type_options = get_option('hh_x_content_type_options', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_x_content_type_options" value="<?php echo $k; ?>"<?php checked($x_content_type_options, $k); ?> /> <?php echo $v; ?></label></p><?php
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-cto' ); ?>
28 <?php do_settings_sections( 'http-headers-cto' ); ?>
29 <select name="hh_x_content_type_options_value" class="http-header-value"<?php echo $x_content_type_options == 1 ? NULL : ' readonly'; ?>>
30 <?php
31 $items = array('nosniff');
32 $x_content_type_options_value = get_option('hh_x_content_type_options_value');
33 foreach ($items as $item) {
34 ?><option value="<?php echo $item; ?>"<?php selected($x_content_type_options_value, $item); ?>><?php echo $item; ?></option><?php
35 }
36 ?>
37 </select>
38 </td>
39 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr valign="top">
7 <th scope="row">X-DNS-Prefetch-Control
8 <p class="description"><?php _e('The X-DNS-Prefetch-Control HTTP response header controls DNS prefetching, a feature by which browsers proactively perform domain name resolution on both links that the user may choose to follow as well as URLs for items referenced by the document, including images, CSS, JavaScript, and so forth.', 'http-headers'); ?></p>
9 <p class="description"><?php _e('This prefetching is performed in the background, so that the DNS is likely to have been resolved by the time the referenced items are needed. This reduces latency when the user clicks a link.', 'http-headers'); ?></p>
10 <hr>
11 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
12 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-DNS-Prefetch-Control"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
13 </p>
14 </th>
15 <td>
16 <fieldset>
17 <legend class="screen-reader-text">X-DNS-Prefetch-Control</legend>
18 <?php
19 $x_dns_prefetch_control = get_option('hh_x_dns_prefetch_control', 0);
20 foreach ($bools as $k => $v)
21 {
22 ?><p><label><input type="radio" class="http-header" name="hh_x_dns_prefetch_control" value="<?php echo $k; ?>"<?php checked($x_dns_prefetch_control, $k); ?> /> <?php echo $v; ?></label></p><?php
23 }
24 ?>
25 </fieldset>
26 </td>
27 <td>
28 <?php settings_fields( 'http-headers-xdpc' ); ?>
29 <?php do_settings_sections( 'http-headers-xdpc' ); ?>
30 <select name="hh_x_dns_prefetch_control_value" class="http-header-value"<?php echo $x_dns_prefetch_control == 1 ? NULL : ' readonly'; ?>>
31 <?php
32 $items = array('on', 'off');
33 $x_dns_prefetch_control_value = get_option('hh_x_dns_prefetch_control_value');
34 foreach ($items as $item) {
35 ?><option value="<?php echo $item; ?>"<?php selected($x_dns_prefetch_control_value, $item); ?>><?php echo $item; ?></option><?php
36 }
37 ?>
38 </select>
39 </td>
40 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr valign="top">
7 <th scope="row">X-Download-Options
8 <p class="description"><?php _e("For web applications that need to serve untrusted HTML files, Microsoft IE introduced a mechanism to help prevent the untrusted content from compromising your site's security. When the X-Download-Options header is present with the value noopen, the user is prevented from opening a file download directly; instead, they must first save the file locally. When the locally saved file is later opened, it no longer executes in the security context of your site, helping to prevent script injection.", 'http-headers'); ?></p>
9 </th>
10 <td>
11 <fieldset>
12 <legend class="screen-reader-text">X-Download-Options</legend>
13 <?php
14 $x_download_options = get_option('hh_x_download_options', 0);
15 foreach ($bools as $k => $v)
16 {
17 ?><p><label><input type="radio" class="http-header" name="hh_x_download_options" value="<?php echo $k; ?>"<?php checked($x_download_options, $k); ?> /> <?php echo $v; ?></label></p><?php
18 }
19 ?>
20 </fieldset>
21 </td>
22 <td>
23 <?php settings_fields( 'http-headers-xdo' ); ?>
24 <?php do_settings_sections( 'http-headers-xdo' ); ?>
25 <select name="hh_x_download_options_value" class="http-header-value"<?php echo $x_download_options == 1 ? NULL : ' readonly'; ?>>
26 <?php
27 $items = array('noopen');
28 $x_download_options_value = get_option('hh_x_download_options_value');
29 foreach ($items as $item) {
30 ?><option value="<?php echo $item; ?>"<?php selected($x_download_options_value, $item); ?>><?php echo $item; ?></option><?php
31 }
32 ?>
33 </select>
34 </td>
35 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr valign="top">
7 <th scope="row">X-Frame-Options
8 <p class="description"><?php _e('This header can be used to indicate whether or not a browser should be allowed to render a page in a &lt;frame&gt;, &lt;iframe&gt; or &lt;object&gt;. Use this to avoid clickjacking attacks.', 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">X-Frame-Options</legend>
17 <?php
18 $x_frame_options = get_option('hh_x_frame_options', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_x_frame_options" value="<?php echo $k; ?>"<?php checked($x_frame_options, $k, true); ?> /> <?php echo $v; ?></label></p><?php
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-xfo' ); ?>
28 <?php do_settings_sections( 'http-headers-xfo' ); ?>
29 <select name="hh_x_frame_options_value" class="http-header-value"<?php echo $x_frame_options == 1 ? NULL : ' readonly'; ?>>
30 <?php
31 $items = array('deny', 'sameorigin', 'allow-from');
32 $x_frame_options_value = get_option('hh_x_frame_options_value');
33 foreach ($items as $item)
34 {
35 ?><option value="<?php echo $item; ?>"<?php selected($x_frame_options_value, $item); ?>><?php echo strtoupper($item); ?></option><?php
36 }
37 ?>
38 </select>
39 <input type="text" name="hh_x_frame_options_domain" class="http-header-value" placeholder="Domain" value="<?php echo esc_attr(get_option('hh_x_frame_options_domain')); ?>"<?php echo $x_frame_options == 1 && $x_frame_options_value == 'allow-from' ? NULL : ' style="display: none" readonly'; ?> />
40 </td>
41 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr valign="top">
7 <th scope="row">X-Permitted-Cross-Domain-Policies
8 <p class="description"><?php _e('A cross-domain policy file is an XML document that grants a web client, such as Adobe Flash Player or Adobe Acrobat (though not necessarily limited to these), permission to handle data across domains.', 'http-headers'); ?></p>
9 </th>
10 <td>
11 <fieldset>
12 <legend class="screen-reader-text">X-Permitted-Cross-Domain-Policies</legend>
13 <?php
14 $x_permitted_cross_domain_policies = get_option('hh_x_permitted_cross_domain_policies', 0);
15 foreach ($bools as $k => $v)
16 {
17 ?><p><label><input type="radio" class="http-header" name="hh_x_permitted_cross_domain_policies" value="<?php echo $k; ?>"<?php checked($x_permitted_cross_domain_policies, $k); ?> /> <?php echo $v; ?></label></p><?php
18 }
19 ?>
20 </fieldset>
21 </td>
22 <td>
23 <?php settings_fields( 'http-headers-xpcd' ); ?>
24 <?php do_settings_sections( 'http-headers-xpcd' ); ?>
25 <select name="hh_x_permitted_cross_domain_policies_value" class="http-header-value"<?php echo $x_permitted_cross_domain_policies == 1 ? NULL : ' readonly'; ?>>
26 <?php
27 $items = array('none', 'master-only', 'by-content-type', 'by-ftp-filename', 'all');
28 $x_permitted_cross_domain_policies_value = get_option('hh_x_permitted_cross_domain_policies_value');
29 foreach ($items as $item) {
30 ?><option value="<?php echo $item; ?>"<?php selected($x_permitted_cross_domain_policies_value, $item); ?>><?php echo $item; ?></option><?php
31 }
32 ?>
33 </select>
34 </td>
35 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr valign="top">
7 <th scope="row">X-Powered-By
8 <p class="description"><?php _e('Specifies the technology (e.g. ASP.NET, PHP, JBoss, Express) supporting the web application, i.e. the scripting language. It is recommended to remove it or provide misleading information to throw off hackers that might target a particular technology/version.', 'http-headers'); ?></p>
9 </th>
10 <td>
11 <fieldset>
12 <legend class="screen-reader-text">X-Powered-By</legend>
13 <?php
14 $x_powered_by = get_option ( 'hh_x_powered_by', 0 );
15 foreach ( $bools as $k => $v ) {
16 ?><p>
17 <label><input type="radio" class="http-header" name="hh_x_powered_by" value="<?php echo $k; ?>" <?php checked($x_powered_by, $k, true); ?> /> <?php echo $v; ?></label>
18 </p><?php
19 }
20 ?>
21 </fieldset>
22 </td>
23 <td>
24 <?php settings_fields( 'http-headers-xpb' ); ?>
25 <?php do_settings_sections( 'http-headers-xpb' ); ?>
26 <select name="hh_x_powered_by_option" class="http-header-value"<?php echo $x_powered_by == 1 ? NULL : ' readonly'; ?>>
27 <?php
28 $items = array (
29 'unset' => 'Unset',
30 'set' => 'Set',
31 );
32 $x_powered_by_option = get_option ( 'hh_x_powered_by_option' );
33 foreach ( $items as $k => $v ) {
34 ?><option value="<?php echo $k; ?>" <?php selected($x_powered_by_option, $k); ?>><?php echo $v; ?></option><?php
35 }
36 ?>
37 </select>
38 <input type="text" name="hh_x_powered_by_value" class="http-header-value" placeholder="PHP/<?php echo PHP_VERSION; ?>" value="<?php echo esc_attr(get_option('hh_x_powered_by_value')); ?>"
39 <?php echo $x_powered_by == 1 && $x_powered_by_option == 'set' ? NULL : ' style="display: none" readonly'; ?> />
40 </td>
41 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr valign="top">
7 <th scope="row">X-Robots-Tag
8 <p class="description"><?php _e('The X-Robots-Tag HTTP header is used to indicate how a web page is to be indexed within public search engine results. The header is effectively equivalent to <code>&lt;meta name="robots" content="..."&gt;</code>.', 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developers.google.com/search/docs/advanced/robots/robots_meta_tag"><?php _e('Google Search Central', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">X-Robots-Tag</legend>
17 <?php
18 $x_robots_tag = get_option('hh_x_robots_tag', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_x_robots_tag" value="<?php echo $k; ?>"<?php checked($x_robots_tag, $k); ?> /> <?php echo $v; ?></label></p><?php
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-rob' ); ?>
28 <?php do_settings_sections( 'http-headers-rob' ); ?>
29 <?php
30 $items = array(
31 'all' => 'bool',
32 'noindex' => 'bool',
33 'nofollow' => 'bool',
34 'none' => 'bool',
35 'noarchive' => 'bool',
36 'nosnippet' => 'bool',
37 'max-snippet' => 'number',
38 'max-image-preview' => 'setting',
39 'max-video-preview' => 'number',
40 'notranslate' => 'bool',
41 'noimageindex' => 'bool',
42 'unavailable_after' => 'datetime',
43 );
44 ?>
45 <table>
46 <?php
47 $x_robots_tag_value = get_option('hh_x_robots_tag_value');
48 if (!$x_robots_tag_value)
49 {
50 $x_robots_tag_value = array();
51 }
52 foreach ($items as $item => $type)
53 {
54 ?>
55 <tr>
56 <td><label for="hh_x_robots_tag_value_<?php echo $item; ?>"><?php echo $item; ?></label></td>
57 <td><?php
58 switch ($type) {
59 case 'bool':
60 ?><input type="checkbox" class="http-header-value" name="hh_x_robots_tag_value[<?php echo $item; ?>]"
61 id="hh_x_robots_tag_value_<?php echo $item; ?>"<?php echo $x_robots_tag == 1 ? NULL : ' readonly'; ?>
62 value="1"<?php checked(array_key_exists($item, $x_robots_tag_value), 1, true); ?>><?php
63 break;
64 case 'number':
65 ?><input type="number" class="http-header-value" name="hh_x_robots_tag_value[<?php echo $item; ?>]"
66 id="hh_x_robots_tag_value_<?php echo $item; ?>"
67 size="6" min="-1" step="1"<?php echo $x_robots_tag == 1 ? NULL : ' readonly'; ?>
68 value="<?php echo array_key_exists($item, $x_robots_tag_value) && strlen($x_robots_tag_value[$item]) > 0 ? (int) $x_robots_tag_value[$item] : NULL; ?>"><?php
69 break;
70 case 'setting':
71 ?><select class="http-header-value" name="hh_x_robots_tag_value[<?php echo $item; ?>]"
72 id="hh_x_robots_tag_value_<?php echo $item; ?>"<?php echo $x_robots_tag == 1 ? NULL : ' readonly'; ?>>
73 <option value="">---</option>
74 <?php
75 foreach (array('none', 'standard', 'large') as $k)
76 {
77 ?><option value="<?php echo $k; ?>"<?php echo array_key_exists($item, $x_robots_tag_value) && $k == $x_robots_tag_value[$item] ? ' selected="selected"' : NULL; ?>><?php echo $k; ?></option><?php
78 }
79 ?>
80 </select><?php
81 break;
82 case 'datetime':
83 ?><input type="date" class="http-header-value" name="hh_x_robots_tag_value[<?php echo $item; ?>]"
84 id="hh_x_robots_tag_value_<?php echo $item; ?>"<?php echo $x_robots_tag == 1 ? NULL : ' readonly'; ?>
85 value="<?php echo array_key_exists($item, $x_robots_tag_value) && strlen($x_robots_tag_value[$item]) > 0 ? $x_robots_tag_value[$item] : NULL; ?>"><?php
86 break;
87 }
88 ?>
89 </td>
90 </tr>
91 <?php
92 }
93 ?>
94 </table>
95 </td>
96 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr valign="top">
7 <th scope="row">X-UA-Compatible
8 <p class="description"><?php _e('In some cases, it might be necessary to restrict a webpage to a document mode supported by an older version of Windows Internet Explorer. Here we look at the x-ua-compatible header, which allows a webpage to be displayed as if it were viewed by an earlier version of the browser.', 'http-headers'); ?></p>
9 </th>
10 <td>
11 <fieldset>
12 <legend class="screen-reader-text">X-UA-Compatible</legend>
13 <?php
14 $x_ua_compatible = get_option('hh_x_ua_compatible', 0);
15 foreach ($bools as $k => $v)
16 {
17 ?><p><label><input type="radio" class="http-header" name="hh_x_ua_compatible" value="<?php echo $k; ?>"<?php checked($x_ua_compatible, $k, true); ?> /> <?php echo $v; ?></label></p><?php
18 }
19 ?>
20 </fieldset>
21 </td>
22 <td>
23 <?php settings_fields( 'http-headers-uac' ); ?>
24 <?php do_settings_sections( 'http-headers-uac' ); ?>
25 <select name="hh_x_ua_compatible_value" class="http-header-value"<?php echo $x_ua_compatible == 1 ? NULL : ' readonly'; ?>>
26 <?php
27 $items = array('IE=7', 'IE=8', 'IE=9', 'IE=10', 'IE=edge', 'IE=edge,chrome=1');
28 $x_ua_compatible_value = get_option('hh_x_ua_compatible_value');
29 foreach ($items as $item) {
30 ?><option value="<?php echo $item; ?>"<?php selected($x_ua_compatible_value, $item); ?>><?php echo $item; ?></option><?php
31 }
32 ?>
33 </select>
34 </td>
35 </tr>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr valign="top">
7 <th scope="row">X-XSS-Protection
8 <p class="description"><?php _e("This header enables the Cross-site scripting (XSS) filter built into most recent web browsers. It's usually enabled by default anyway, so the role of this header is to re-enable the filter for this particular website if it was disabled by the user.", 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php _e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection"><?php _e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">X-XSS-Protection</legend>
17 <?php
18 $x_xxs_protection = get_option('hh_x_xxs_protection', 0);
19 foreach ($bools as $k => $v)
20 {
21 ?><p><label><input type="radio" class="http-header" name="hh_x_xxs_protection" value="<?php echo $k; ?>"<?php checked($x_xxs_protection, $k, true); ?> /> <?php echo $v; ?></label></p><?php
22 }
23 ?>
24 </fieldset>
25 </td>
26 <td>
27 <?php settings_fields( 'http-headers-xss' ); ?>
28 <?php do_settings_sections( 'http-headers-xss' ); ?>
29 <select name="hh_x_xxs_protection_value" class="http-header-value"<?php echo $x_xxs_protection == 1 ? NULL : ' readonly'; ?>>
30 <?php
31 $items = array('0', '1', '1; mode=block', '1; report=');
32 $x_xxs_protection_value = get_option('hh_x_xxs_protection_value');
33 foreach ($items as $item)
34 {
35 ?><option value="<?php echo $item; ?>"<?php selected($x_xxs_protection_value, $item); ?>><?php echo $item; ?></option><?php
36 }
37 ?>
38 </select>
39 <input type="text" name="hh_x_xxs_protection_uri" class="http-header-value" placeholder="Reporting URI" value="<?php echo esc_attr(get_option('hh_x_xxs_protection_uri')); ?>"<?php echo $x_xxs_protection == 1 && $x_xxs_protection_value == '1; report=' ? NULL : ' style="display: none" readonly'; ?> />
40 </td>
41 </tr>
...\ No newline at end of file ...\ No newline at end of file