| 1 |
<div class="d4p-group d4p-group-dashboard-card d4p-group-dashboard-basic"> |
| 2 |
<h3><?php _e("CSS and XXP reports logged in the past 7 days", "gd-security-headers"); ?></h3> |
| 3 |
<div class="d4p-group-stats"> |
| 4 |
<ul> |
| 5 |
|
| 6 |
<?php |
| 7 |
|
| 8 |
$_data = gdsih_statistics()->get_reports_overview_week(); |
| 9 |
|
| 10 |
foreach ($_data as $component => $obj) { |
| 11 |
if ($obj['active']) { |
| 12 |
?><li><a href="admin.php?page=gd-security-headers-<?php echo $component; ?>-reports"> |
| 13 |
<strong><?php echo $obj['label']; ?></strong> |
| 14 |
<?php echo '<strong>'.$obj['reports'].'</strong> '._n("report", "reports", $obj['reports'], "gd-security-headers"); ?></a> |
| 15 |
</li><?php |
| 16 |
} else { |
| 17 |
?><li><strong><?php echo $obj['label']; ?></strong> |
| 18 |
<?php echo '<strong>'.$obj['reports'].'</strong> '._n("report", "reports", $obj['reports'], "gd-security-headers"); ?> |
| 19 |
</li><?php |
| 20 |
} |
| 21 |
|
| 22 |
} |
| 23 |
|
| 24 |
?> |
| 25 |
|
| 26 |
</ul><div class="d4p-clearfix"></div> |
| 27 |
</div> |
| 28 |
<div class="d4p-group-inner"> |
| 29 |
<h4><?php _e("Content Security Policy - Reports for URL's", "gd-security-headers"); ?></h4> |
| 30 |
|
| 31 |
<?php if (!$_data['csp']['active']) { ?> |
| 32 |
<p><?php _e("It is highly recommended to configure CSP security header with reporting enabled.", "gd-security-headers"); ?></p> |
| 33 |
<?php } else { ?> |
| 34 |
<?php |
| 35 |
|
| 36 |
$_list = gdsih_statistics()->get_csp_urls_week(); |
| 37 |
|
| 38 |
if (empty($_list)) { ?> |
| 39 |
<p><?php _e("No reports logged in the past 7 days.", "gd-security-headers"); ?></p> |
| 40 |
<?php } else { |
| 41 |
|
| 42 |
?> |
| 43 |
<ul class="gdsih-security-reports"> |
| 44 |
<?php |
| 45 |
|
| 46 |
foreach ($_list as $obj) { |
| 47 |
|
| 48 |
?><li> |
| 49 |
<strong><?php echo $obj->url; ?></strong> |
| 50 |
<a href="admin.php?page=gd-security-headers-csp-reports&s=<?php echo esc_attr($obj->url); ?>"><?php echo '<strong>'.$obj->reports.'</strong> '._n("report", "reports", $obj->reports, "gd-security-headers"); ?></a> |
| 51 |
</li><?php |
| 52 |
|
| 53 |
} |
| 54 |
|
| 55 |
?> |
| 56 |
</ul> |
| 57 |
<?php } ?> |
| 58 |
<?php } ?> |
| 59 |
|
| 60 |
<hr/> |
| 61 |
|
| 62 |
<h4><?php _e("X XSS Protection - Reports for URL's", "gd-security-headers"); ?></h4> |
| 63 |
|
| 64 |
<?php if (!$_data['xxp']['active']) { ?> |
| 65 |
<p><?php _e("It is highly recommended to configure X XSS Protection security header with reporting enabled.", "gd-security-headers"); ?></p> |
| 66 |
<?php } else { ?> |
| 67 |
<?php |
| 68 |
|
| 69 |
$_list = gdsih_statistics()->get_xxp_urls_week(); |
| 70 |
|
| 71 |
if (empty($_list)) { ?> |
| 72 |
<p><?php _e("No reports logged in the past 7 days.", "gd-security-headers"); ?></p> |
| 73 |
<?php } else { |
| 74 |
|
| 75 |
?> |
| 76 |
<ul class="gdsih-security-reports"> |
| 77 |
<?php |
| 78 |
|
| 79 |
foreach ($_list as $obj) { |
| 80 |
|
| 81 |
?><li> |
| 82 |
<strong><?php echo $obj->url; ?></strong> |
| 83 |
<a href="admin.php?page=gd-security-headers-xxp-reports&s=<?php echo esc_attr($obj->url); ?>"><?php echo '<strong>'.$obj->reports.'</strong> '._n("report", "reports", $obj->reports, "gd-security-headers"); ?></a> |
| 84 |
</li><?php |
| 85 |
|
| 86 |
} |
| 87 |
|
| 88 |
?> |
| 89 |
</ul> |
| 90 |
<?php } ?> |
| 91 |
<?php } ?> |
| 92 |
</div> |
| 93 |
<div class="d4p-group-footer"> |
| 94 |
<?php if ($_data['csp']['active']) { ?> |
| 95 |
<a href="admin.php?page=gd-security-headers-csp-reports" class="button-primary"><?php _e("All CSP reports", "gd-security-headers"); ?></a> |
| 96 |
<?php } if ($_data['xxp']['active']) { ?> |
| 97 |
<a href="admin.php?page=gd-security-headers-xxp-reports" class="button-primary"><?php _e("All XXP reports", "gd-security-headers"); ?></a> |
| 98 |
<?php } ?> |
| 99 |
</div> |
| 100 |
</div> |