PluginProbe
GD Security Headers / 1.6
GD Security Headers v1.6
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 / tools.php

tools.php in GD Security Headers 1.6, at forms/tools.php

107 lines 4.7 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')) { exit; }
4
5 $panels = array(
6 'index' => array(
7 'title' => __("Tools Index", "gd-security-headers"), 'icon' => 'wrench',
8 'info' => __("All plugin tools are split into several panels, and you can access each starting from the right.", "gd-security-headers"))
9 );
10
11 if (gdsih_scope()->is_master_network_admin()) {
12 $panels['reportslog'] = array(
13 'title' => __("Reports Logs Cleanup", "gd-security-headers"), 'icon' => 'trash-o',
14 'break' => __("Cleanup", "gd-security-headers"),
15 'button' => 'submit', 'button_text' => 'Clean Log',
16 'info' => __("Remove old reports from CSP and XXP reports logs.", "gd-security-headers"));
17 $panels['recheck'] = array(
18 'title' => __("Recheck and Update", "gd-security-headers"), 'icon' => 'refresh',
19 'break' => __("Maintenance", "gd-security-headers"),
20 'button' => 'none', 'button_text' => '',
21 'info' => __("Recheck plugin database tables, check for new templates and clean cache.", "gd-security-headers"));
22 $panels['export'] = array(
23 'title' => __("Export Settings", "gd-security-headers"), 'icon' => 'download',
24 'button' => 'button', 'button_text' => __("Export", "gd-security-headers"),
25 'info' => __("Export all plugin settings into file.", "gd-security-headers"));
26 $panels['import'] = array(
27 'title' => __("Import Settings", "gd-security-headers"), 'icon' => 'upload',
28 'button' => 'submit', 'button_text' => __("Import", "gd-security-headers"),
29 'info' => __("Import all plugin settings from export file.", "gd-security-headers"));
30 $panels['remove'] = array(
31 'title' => __("Reset / Remove", "gd-security-headers"), 'icon' => 'remove',
32 'button' => 'submit', 'button_text' => __("Remove", "gd-security-headers"),
33 'info' => __("Remove selected plugin settings, database tables and optionally disable plugin.", "gd-security-headers"));
34 }
35
36 include(GDSIH_PATH.'forms/shared/top.php');
37
38 ?>
39
40 <form method="post" action="" enctype="multipart/form-data" id="gdsih-tools-form">
41 <?php settings_fields('gd-security-headers-tools'); ?>
42 <input type="hidden" value="<?php echo $_panel; ?>" name="gdsihtools[panel]" />
43 <input type="hidden" value="postback" name="gdsih_handler" />
44
45 <div class="d4p-content-left">
46 <div class="d4p-panel-scroller d4p-scroll-active">
47 <div class="d4p-panel-title">
48 <i aria-hidden="true" class="fa fa-wrench"></i>
49 <h3><?php _e("Tools", "gd-security-headers"); ?></h3>
50 <?php if ($_panel != 'index') { ?>
51 <h4><i aria-hidden="true" class="fa fa-<?php echo $panels[$_panel]['icon']; ?>"></i> <?php echo $panels[$_panel]['title']; ?></h4>
52 <?php } ?>
53 </div>
54 <div class="d4p-panel-info">
55 <?php echo $panels[$_panel]['info']; ?>
56 </div>
57 <?php if ($_panel != 'index' && $panels[$_panel]['button'] != 'none') { ?>
58 <div class="d4p-panel-buttons">
59 <input id="gdsih-tool-<?php echo $_panel; ?>" class="button-primary" type="<?php echo $panels[$_panel]['button']; ?>" value="<?php echo $panels[$_panel]['button_text']; ?>" />
60 </div>
61 <?php } ?>
62 <div class="d4p-return-to-top">
63 <a href="#wpwrap"><?php _e("Return to top", "gd-security-headers"); ?></a>
64 </div>
65 </div>
66 </div>
67 <div class="d4p-content-right">
68 <?php
69
70 if ($_panel == 'index') {
71 foreach ($panels as $panel => $obj) {
72 if ($panel == 'index') continue;
73
74 $url = 'admin.php?page=gd-security-headers-'.$_page.'&panel='.$panel;
75
76 if (isset($obj['break'])) { ?>
77
78 <div style="clear: both"></div>
79 <div class="d4p-panel-break d4p-clearfix">
80 <h4><?php echo $obj['break']; ?></h4>
81 </div>
82 <div style="clear: both"></div>
83
84 <?php } ?>
85
86 <div class="d4p-options-panel">
87 <i aria-hidden="true" class="fa fa-<?php echo $obj['icon']; ?>"></i>
88 <h5><?php echo $obj['title']; ?></h5>
89 <div>
90 <a class="button-primary" href="<?php echo $url; ?>"><?php _e("Tools Panel", "gd-security-headers"); ?></a>
91 </div>
92 </div>
93
94 <?php
95 }
96 } else {
97 include(GDSIH_PATH.'forms/tools/'.$_panel.'.php');
98 }
99
100 ?>
101 </div>
102 </form>
103
104 <?php
105
106 include(GDSIH_PATH.'forms/shared/bottom.php');
107