Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .wordpress-org/screenshot-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions admin/css/webdecoy-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -1214,3 +1214,42 @@
.wd-analytics .notice-info p { display: inline-block; margin: 8px 8px 8px 0; }

.wd-table-scroll { overflow-x: auto; margin-bottom: 24px; }

/* Keep technical columns readable; scroll the table instead of crushing User Agent. */
.wd-detections-scroll { width: 100%; overflow-x: auto; }
.wd-detections-table { min-width: 1440px; }
.wd-detections-table .column-ua { width: 180px; display: table-cell; overflow-wrap: anywhere; }
.wd-detections-table .column-what { width: 210px; }
.wd-detections-table .column-intel { width: 130px; }
.wd-detections-table .column-date { width: 125px; }
.wd-detections-table .column-source { width: 105px; }
.wd-detections-table td { vertical-align: top; }

/* Dashboard overview stays useful at the native WordPress widget width. */
#webdecoy_dashboard_widget .wd-widget-brand { display:flex; align-items:center; gap:8px; padding:8px 0 14px; border-bottom:2px solid #f90289; }
#webdecoy_dashboard_widget .wd-widget-brand a { margin-left:auto; font-size:12px; }
#webdecoy_dashboard_widget .webdecoy-widget-stats { gap:8px; padding:14px 0; }
#webdecoy_dashboard_widget .webdecoy-stat { flex:1; min-width:0; }
#webdecoy_dashboard_widget .webdecoy-stat-value { font-size:25px; }
#webdecoy_dashboard_widget .webdecoy-stat-label { font-size:11px; line-height:1.3; display:block; margin-top:4px; }
#webdecoy_dashboard_widget .webdecoy-widget-crawlers h4 { margin-top:12px; }
#webdecoy_dashboard_widget .webdecoy-widget-agents { margin:10px 0; }
#webdecoy_dashboard_widget .wd-widget-bar-row { position:relative; isolation:isolate; padding:6px 9px; margin-bottom:4px; gap:8px; }
#webdecoy_dashboard_widget .wd-widget-bar { position:absolute; z-index:-1; inset:0 auto 0 0; background:#fce4f1; border-radius:3px; }
#webdecoy_dashboard_widget .webdecoy-widget-ai-referrals .wd-widget-bar { background:#eeebfa; }
#webdecoy_dashboard_widget .webdecoy-count { font-variant-numeric:tabular-nums; font-weight:600; }
#webdecoy_dashboard_widget .webdecoy-widget-footnote { margin-bottom:0; }
#webdecoy_dashboard_widget .wd-widget-details { padding:12px 0; border-bottom:1px solid #eee; }
#webdecoy_dashboard_widget .wd-widget-details summary { cursor:pointer; font-weight:600; }
#webdecoy_dashboard_widget .webdecoy-widget-upsell { margin-top:12px; padding:8px 10px; background:#faf7fb; border-left:3px solid #f90289; }
@media (max-width:480px) {
#webdecoy_dashboard_widget .wd-widget-brand { flex-wrap:wrap; }
#webdecoy_dashboard_widget .wd-widget-brand a { margin-left:40px; }
}
@media (max-width:782px) {
.webdecoy-date-buttons { flex-wrap:wrap; margin-right:0; }
.webdecoy-filters { min-width:0; max-width:100%; }
}
@media (max-width:782px) {
.webdecoy-stat-box { box-sizing:border-box; min-width:0; }
}
17 changes: 14 additions & 3 deletions admin/partials/dashboard-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@
?>

<div class="webdecoy-widget">
<div class="wd-widget-brand">
<img src="<?php echo esc_url(WEBDECOY_PLUGIN_URL . 'assets/duck.png'); ?>" width="32" height="32" alt="" />
<strong><?php esc_html_e('Your AI & bot traffic', 'webdecoy'); ?></strong>
<a href="<?php echo esc_url(admin_url('admin.php?page=webdecoy-statistics')); ?>"><?php esc_html_e('Open analytics →', 'webdecoy'); ?></a>
</div>
<?php
// Trip-it-yourself prompt (app#679): shown only while the widget has
// nothing to report — once real detections exist, the numbers speak.
Expand Down Expand Up @@ -116,7 +121,8 @@
</p>
<ul class="webdecoy-widget-agents">
<?php foreach (array_slice($crawlers['agents'], 0, 5) as $webdecoy_dw_agent) : ?>
<li>
<li class="wd-widget-bar-row">
<span class="wd-widget-bar" aria-hidden="true" style="width: <?php echo esc_attr((string) min(100, 100 * (int) $webdecoy_dw_agent['hits'] / max(1, (int) $crawlers['agents'][0]['hits']))); ?>%"></span>
<span class="webdecoy-agent-name">
<strong><?php echo esc_html($webdecoy_dw_agent['name']); ?></strong>
<span class="webdecoy-agent-category"><?php echo esc_html(WebDecoy_Crawler_Visits::category_label((string) $webdecoy_dw_agent['category'])); ?></span>
Expand All @@ -141,7 +147,8 @@
<?php if ((int) $ai_referrals['total'] > 0) : ?>
<ul class="webdecoy-widget-agents">
<?php foreach (array_slice($ai_referrals['platforms'], 0, 5) as $webdecoy_dw_ref) : ?>
<li>
<li class="wd-widget-bar-row">
<span class="wd-widget-bar" aria-hidden="true" style="width: <?php echo esc_attr((string) min(100, 100 * (int) $webdecoy_dw_ref['referrals'] / max(1, (int) $ai_referrals['platforms'][0]['referrals']))); ?>%"></span>
<span class="webdecoy-agent-name"><strong><?php echo esc_html($webdecoy_dw_ref['platform']); ?></strong></span>
<span class="webdecoy-count"><?php echo esc_html(number_format((int) $webdecoy_dw_ref['referrals'])); ?></span>
</li>
Expand All @@ -154,6 +161,8 @@
<?php endif; ?>
</div>

<details class="wd-widget-details">
<summary><?php esc_html_e('Protection & request counts', 'webdecoy'); ?></summary>
<div class="webdecoy-widget-request-counts">
<h4><?php esc_html_e('Detection rows and requests today (UTC)', 'webdecoy'); ?></h4>
<?php if ($request_counts_today['available']) : ?>
Expand Down Expand Up @@ -226,14 +235,16 @@
</a>
</div>

</details>

<?php
$options = get_option('webdecoy_options', []);
if (empty($options['api_key'])) :
?>
<div class="webdecoy-widget-upsell">
<p>
<strong><?php esc_html_e('Everything above works without an account.', 'webdecoy'); ?></strong>
<?php esc_html_e('Connect for free to see these detections in the WebDecoy dashboard and get a monthly report. Paid plans add whether an address has been seen attacking other sites, and webhook alerts.', 'webdecoy'); ?>

<a href="<?php echo esc_url(admin_url('admin.php?page=webdecoy&tab=cloud')); ?>">
<?php esc_html_e('Connect this site', 'webdecoy'); ?>
</a>
Expand Down
4 changes: 3 additions & 1 deletion admin/partials/detections-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ class="button <?php echo empty($active_range) ? 'button-primary' : ''; ?>">
<p><?php esc_html_e('No detections found.', 'webdecoy'); ?></p>
<?php endif; ?>
<?php else : ?>
<table class="wp-list-table widefat fixed striped">
<div class="wd-detections-scroll" role="region" aria-label="<?php esc_attr_e('Bot detections', 'webdecoy'); ?>" tabindex="0">
<table class="wp-list-table widefat fixed striped wd-detections-table">
<thead>
<tr>
<th class="check-column"><input type="checkbox" id="webdecoy-select-all" /></th>
Expand Down Expand Up @@ -527,6 +528,7 @@ class="button button-small">
<?php endforeach; ?>
</tbody>
</table>
</div>

<?php if ($total_pages > 1) : ?>
<div class="tablenav bottom">
Expand Down
Loading