PluginProbe
GD Security Headers / trunk
GD Security Headers vtrunk
trunk 1.0 1.1 1.1.1 1.2 1.3 1.4 1.5 1.6 1.6.1 1.7 1.7.1 1.8 1.9
gd-security-headers / forms / headers.php

headers.php in GD Security Headers trunk, at forms/headers.php

103 lines 3.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6
7 include( GDSIH_PATH . 'forms/shared/top.php' );
8
9 $list = gdsih()->build_headers_to_array();
10
11 ?>
12
13 <div class="d4p-content-left">
14 <div class="d4p-panel-scroller d4p-scroll-active">
15 <div class="d4p-panel-title">
16 <i aria-hidden="true" class="fa fa-code"></i>
17 <h3><?php esc_html_e( 'Headers', 'gd-security-headers' ); ?></h3>
18 </div>
19 <div class="d4p-panel-info">
20 <?php esc_html_e( 'All HTTP headers generated so they can be copied into server side config. Headers are generated based on the plugin settings.', 'gd-security-headers' ) ?>
21 <br/><br/><strong><?php esc_html_e( 'If you are not sure how to do that, please consult with your website hosting company support.', 'gd-security-headers' ) ?></strong>
22 </div>
23 <div class="d4p-return-to-top">
24 <a href="#wpwrap"><?php esc_html_e( 'Return to top', 'gd-security-headers' ); ?></a>
25 </div>
26 </div>
27 </div>
28 <div class="d4p-content-right">
29 <div class="d4p-group d4p-group-extra d4p-group-important">
30 <h3><?php esc_html_e( 'Apache Server', 'gd-security-headers' ); ?></h3>
31 <div class="d4p-group-inner">
32 <p><?php esc_html_e( 'If you use Apache server, this plugin can add headers automatically into HTACCESS file. But, if you have disabled HTACCESS or you prefer using global server config, you can copy rules from here.', 'gd-security-headers' ); ?></p>
33 <div class="gdsih-code-block">
34 <pre>&lt;IfModule mod_headers.c><br/><?php
35
36 $first = true;
37 foreach ( $list as $key => $value ) {
38 if ( ! $first ) {
39 echo '<br/>';
40 }
41
42 echo ' # ' . $key . '<br/>';
43 echo ' Header set ' . $value . '<br/>';
44
45 $first = false;
46 }
47
48 ?>&lt;/IfModule></pre>
49 </div>
50 </div>
51 </div>
52
53 <div class="d4p-group d4p-group-extra d4p-group-important">
54 <h3><?php esc_html_e( 'Nginx Server', 'gd-security-headers' ); ?></h3>
55 <div class="d4p-group-inner">
56 <p><?php esc_html_e( 'If you use NGINX server, you can copy rules from here to add to the server \'conf\' file.', 'gd-security-headers' ); ?></p>
57 <div class="gdsih-code-block">
58 <pre><?php
59
60 $first = true;
61 foreach ( $list as $key => $value ) {
62 if ( ! $first ) {
63 echo '<br/>';
64 }
65
66 echo '# ' . $key . '<br/>';
67 echo 'add_header ' . $value . ';<br/>';
68
69 $first = false;
70 }
71
72 ?></pre>
73 </div>
74 </div>
75 </div>
76
77 <div class="d4p-group d4p-group-extra d4p-group-important">
78 <h3><?php esc_html_e( 'IIS Server', 'gd-security-headers' ); ?></h3>
79 <div class="d4p-group-inner">
80 <p><?php esc_html_e( 'If you use IIS server, you can copy rules from here to add to the server \'Web.config\' file.', 'gd-security-headers' ); ?></p>
81 <div class="gdsih-code-block">
82 <pre>&lt;system.webServer>
83 &lt;httpProtocol>
84 &lt;customHeaders><br/><?php
85
86 foreach ( $list as $key => $value ) {
87 $parts = explode( ' ', $value, 2 );
88
89 echo ' &lt;add name="' . $parts[0] . '" value=' . $parts[1] . ' /><br/>';
90 }
91
92 ?> &lt;/customHeaders>
93 &lt;httpProtocol>
94 &lt;system.webServer></pre>
95 </div>
96 </div>
97 </div>
98 </div>
99
100 <?php
101
102 include( GDSIH_PATH . 'forms/shared/bottom.php' );
103