advanced.php
5.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?php
if (!defined('ABSPATH')) {
exit;
}
include dirname(__FILE__) . '/includes/config.inc.php';
include dirname(__FILE__) . '/includes/breadcrumbs.inc.php';
?>
<form method="post" action="options.php" accept-charset="utf-8">
<?php settings_fields( 'http-headers-mtd' ); ?>
<?php do_settings_sections( 'http-headers-mtd' ); ?>
<div style="overflow: hidden">
<div style="float: left; width: 49%">
<table class="hh-index-table">
<thead>
<tr>
<th>Directive</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr class="active">
<td>PHP version</td>
<td><?php echo PHP_VERSION; ?></td>
</tr>
<tr class="active">
<td>Server Software</td>
<td><?php echo getenv('SERVER_SOFTWARE'); ?></td>
</tr>
<tr class="active">
<td>Server API</td>
<td><?php echo PHP_SAPI; ?></td>
</tr>
<tr class="active">
<td>user_ini.filename</td>
<td><?php echo ini_get('user_ini.filename'); ?></td>
</tr>
</tbody>
</table>
</div>
<section class="hh-panel" style="float: right; width: 49%; box-sizing: border-box; margin: 0">
<table style="width: 100%">
<thead>
<tr>
<th colspan="2" style="text-align: left"><?php _e('Setup Location', 'http-headers'); ?></th>
</tr>
</thead>
<tbody>
<tr>
<td>Location of <code>.htaccess</code></td>
<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>
</tr>
<tr>
<td>Location of <code>.user.ini</code></td>
<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>
</tr>
<tr>
<td>Location of <code>.hh-htpasswd</code></td>
<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>
</tr>
<tr>
<td>Location of <code>.hh-htdigest</code></td>
<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>
</tr>
<tr>
<td></td>
<td><?php submit_button(null, 'primary', null, false); ?></td>
</tr>
</tbody>
</table>
</section>
</div>
<section class="hh-panel">
<table class="form-table hh-table">
<tbody>
<tr valign="top">
<th scope="row"><?php _e('Default mode', 'http-headers'); ?>
<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>
</th>
<td> </td>
<td>
<fieldset>
<?php
$items = array(
'php' => __('Use PHP to send headers (deprecated)', 'http-headers'),
'htaccess' => __('Use Apache (mod_headers) to send headers', 'http-headers'),
);
$method = get_option('hh_method');
foreach ($items as $key => $val) {
?><p><label><input type="radio" name="hh_method" value="<?php echo $key; ?>"<?php checked($method, $key, true); ?>><?php echo $val; ?></label></p><?php
}
?>
</fieldset>
</td>
</tr>
</tbody>
</table>
<?php submit_button(); ?>
</section>
</form>
<section class="hh-panel">
<table class="form-table hh-table">
<tbody>
<tr valign="top">
<th scope="row"><?php _e('Export', 'http-headers'); ?>
<p class="description"><?php _e('Export the plugin current state of settings for later use if recovery needs.', 'http-headers'); ?></p>
</th>
<td> </td>
<td>
<fieldset>
<form method="post" action="<?php echo admin_url('admin-post.php'); ?>" target="_blank">
<?php wp_nonce_field('export'); ?>
<input type="hidden" name="action" value="export">
<button type="submit" class="button button-primary"><?php _e('Export settings', 'http-headers'); ?></button>
</form>
</fieldset>
</td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Import', 'http-headers'); ?>
<p class="description"><?php _e('Import a previously saved state of settings.', 'http-headers'); ?></p>
</th>
<td> </td>
<td>
<fieldset>
<form method="post" action="<?php echo admin_url('admin-post.php'); ?>" enctype="multipart/form-data">
<?php wp_nonce_field('import'); ?>
<input type="hidden" name="action" value="import">
<input type="file" name="file" id="hh-import-file" class="hh-hidden">
<div class="button-group">
<button type="button" class="button hh-btn-import-choose"><?php _e('Choose file...', 'http-headers'); ?></button>
<button type="submit" class="button button-primary"><?php _e('Import settings', 'http-headers'); ?></button>
</div>
<p id="hh-import-name"></p>
</form>
</fieldset>
</td>
</tr>
</tbody>
</table>
</section>