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

expires.php in HTTP Headers 1.15.0, at views/expires.php

98 lines 3.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr>
7 <th scope="row">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 </th>
13 <td>
14 <fieldset>
15 <legend class="screen-reader-text">Expires</legend>
16 <?php
17 $expires = get_option('hh_expires', 0);
18 foreach ($bools as $k => $v)
19 {
20 ?><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
21 }
22 ?>
23 </fieldset>
24 </td>
25 <td>
26 <?php settings_fields( 'http-headers-exp' ); ?>
27 <?php do_settings_sections( 'http-headers-exp' ); ?>
28 <table>
29 <?php
30 $types = array(
31 'default',
32 'text/css',
33 'text/javascript',
34 'text/plain',
35 'image/gif',
36 'image/png',
37 'image/jpeg',
38 'image/x-icon',
39 'application/x-javascript',
40 'application/javascript',
41 'application/x-icon',
42 );
43 $items = array(
44 'invalid_0_date' => '0 (invalid date)',
45 'access_1_hour' => 'Access +1 hour',
46 'access_6_hours' => 'Access +6 hours',
47 'access_12_hours' => 'Access +12 hours',
48 'access_1_day' => 'Access +1 day',
49 'access_3_days' => 'Access +3 days',
50 'access_1_week' => 'Access +1 week',
51 'access_2_weeks' => 'Access +2 weeks',
52 'access_1_month' => 'Access +1 month',
53 'access_3_months' => 'Access +3 months',
54 'access_6_months' => 'Access +6 months',
55 'access_1_year' => 'Access +1 year',
56 'modification_1_hour' => 'Modification +1 hour',
57 'modification_6_hours' => 'Modification +6 hours',
58 'modification_12_hours' => 'Modification +12 hours',
59 'modification_1_day' => 'Modification +1 day',
60 'modification_3_days' => 'Modification +3 days',
61 'modification_1_week' => 'Modification +1 week',
62 'modification_2_weeks' => 'Modification +2 weeks',
63 'modification_1_month' => 'Modification +1 month',
64 'modification_3_months' => 'Modification +3 months',
65 'modification_6_months' => 'Modification +6 months',
66 'modification_1_year' => 'Modification +1 year',
67 );
68 $expires_value = get_option('hh_expires_value');
69 $expires_type = get_option('hh_expires_type');
70 if (!$expires_value)
71 {
72 $expires_value = array();
73 }
74 if (!$expires_type)
75 {
76 $expires_type = array();
77 }
78 foreach ($types as $type) {
79 ?>
80 <tr>
81 <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>
82 <td><?php echo $type; ?></td>
83 <td>
84 <select class="http-header-value" name="hh_expires_value[<?php echo $type; ?>]"<?php echo $expires == 1 ? NULL : ' readonly'; ?>>
85 <?php
86 foreach ($items as $k => $v) {
87 ?><option value="<?php echo $k; ?>"<?php selected($expires_value[$type], $k); ?>><?php echo $v; ?></option><?php
88 }
89 ?>
90 </select>
91 </td>
92 </tr>
93 <?php
94 }
95 ?>
96 </table>
97 </td>
98 </tr>