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

report-to.php in HTTP Headers 1.13.0, at views/report-to.php

85 lines 3.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr 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 </td>
22 <td>
23 <?php settings_fields( 'http-headers-rt' ); ?>
24 <?php do_settings_sections( 'http-headers-rt' ); ?>
25 </td>
26 </tr>
27 <?php
28 $report_to_value = get_option('hh_report_to_value');
29 if (!is_array($report_to_value) || empty($report_to_value))
30 {
31 $report_to_value = array(
32 array(
33 'url' => '',
34 'group' => '',
35 'max-age' => '',
36 )
37 );
38 }
39 ?>
40 <tr>
41 <td colspan="3">
42 <table>
43 <tr>
44 <th>url</th>
45 <th>group</th>
46 <th>max-age</th>
47 <th class="hh-center">includeSubDomains</th>
48 <th>&nbsp;</th>
49 </tr>
50 <?php
51 $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');
52 $i = 0;
53 foreach ($report_to_value as $endpoint)
54 {
55 ?>
56 <tr>
57 <td><input type="text" class="http-header-value" name="hh_report_to_value[<?php echo $i; ?>][url]" value="<?php echo esc_attr($endpoint['url']); ?>" placeholder="https://example.com/report/csp"<?php echo $report_to == 1 ? NULL : ' readonly'; ?> size="40" /></td>
58 <td><input type="text" class="http-header-value" name="hh_report_to_value[<?php echo $i; ?>][group]" value="<?php echo esc_attr($endpoint['group']); ?>" placeholder="csp-endpoint"<?php echo $report_to == 1 ? NULL : ' readonly'; ?> /></td>
59 <td><select class="http-header-value" name="hh_report_to_value[<?php echo $i; ?>][max-age]"<?php echo $report_to == 1 ? NULL : ' readonly'; ?>>
60 <?php
61 foreach ($items as $key => $item) {
62 ?><option value="<?php echo $key; ?>"<?php selected($endpoint['max-age'], $key); ?>><?php echo $item; ?></option><?php
63 }
64 ?>
65 </select></td>
66 <td class="hh-center"><input type="checkbox" class="http-header-value" name="hh_report_to_value[<?php echo $i; ?>][includeSubDomains]" value="1"<?php checked(@$endpoint['includeSubDomains'], 1, true); ?><?php echo $report_to == 1 ? NULL : ' readonly'; ?> /></td>
67 <td><?php
68 if ($i > 0)
69 {
70 ?><button type="button" class="button button-small hh-btn-delete-endpoint" title="<?php esc_attr_e('Delete', 'http-headers'); ?>">x</button><?php
71 }
72 ?></td>
73 </tr>
74 <?php
75 $i += 1;
76 }
77 ?>
78 <tr>
79 <td colspan="5">
80 <button type="button" class="button" id="hh-btn-add-endpoint">+ <?php _e('Add endpoint', 'http-headers'); ?></button>
81 </td>
82 </tr>
83 </table>
84 </td>
85 </tr>