Contents
Get Stats - Plugixa Activity Log
GET /plugixa-activity-log/v1/stats
The figures behind the dashboard for a window of days: totals, events per day, a count per severity, the most active users and addresses, and the latest high-severity events. Takes the same filters as the log.
Needs the view access level (who can call what), and the Dashboard module on under Plugixa Activity Log -> Monitors.
Request
GET https://your-site.example/wp-json/plugixa-activity-log/v1/stats?days=7&group=authentication
Query parameters
| Name | Type | Default | Description |
|---|---|---|---|
days |
integer |
30 |
The window, 1 to 365: whole days of the site’s calendar, today included. 7 starts at midnight six days ago, site time. |
Plus the filter parameters of List Events. The paging parameters do not apply.
Note. The window always applies. A
date_fromearlier than its start is moved up to it, andper_dayalways lists thedaysdays ending today, whateverdate_tosays. Answers are kept for 60 seconds, so a figure can be up to a minute behind the log.
Responses
200 OK. data holds the figures.
{
"success": true,
"data": {
"totals": {
"events": 412,
"high_or_above": 3,
"failed_sign_ins": 27,
"active_users": 6
},
"per_day": [
{ "date": "2026-11-06", "count": 40, "high": 0 },
{ "date": "2026-11-07", "count": 55, "high": 0 },
{ "date": "2026-11-08", "count": 61, "high": 1 },
{ "date": "2026-11-09", "count": 58, "high": 0 },
{ "date": "2026-11-10", "count": 62, "high": 0 },
{ "date": "2026-11-11", "count": 66, "high": 1 },
{ "date": "2026-11-12", "count": 70, "high": 1 }
],
"by_severity": [
{ "severity": "informational", "count": 301 },
{ "severity": "low", "count": 64 },
{ "severity": "medium", "count": 44 },
{ "severity": "high", "count": 3 },
{ "severity": "critical", "count": 0 }
],
"top_users": [
{
"user": { "id": 1, "login": "alex", "name": "Alex Martin", "exists": true },
"count": 154
}
],
"top_ips": [
{ "ip": "203.0.113.9", "count": 120 }
],
"recent_high": [
{
"id": 48190,
"occurred_at": "2026-11-12T07:02:11Z",
"event_code": 1006,
"severity": "high",
"group": "authentication",
"group_label": "Sign-ins",
"site_id": 1,
"user": { "id": 0, "login": "", "name": null, "exists": false },
"user_role": "",
"ip": "198.51.100.23",
"object": { "type": "user", "id": null, "label": "", "url": "" },
"action": "flood",
"message": "More than 30 failed sign-ins came from 198.51.100.23. Further attempts from it are not logged individually for 10 minutes."
}
]
}
}
| Field | Type | Meaning |
|---|---|---|
data.totals.events |
integer |
Events in the window |
data.totals.high_or_above |
integer |
Of which high or critical |
data.totals.failed_sign_ins |
integer |
Failed sign-ins (action failed among the sign-in events) |
data.totals.active_users |
integer |
Distinct signed-in people who did something |
data.per_day |
array |
One entry per day of the window, oldest first, days with nothing included as 0. date is the site’s calendar date |
data.per_day[].high |
integer |
Of that day’s events, those high or above |
data.by_severity |
array |
Every severity, always all five, in order |
data.top_users |
array |
The five most active people. name is the display name, or the recorded login when the account is gone |
data.top_ips |
array |
The five busiest client addresses |
data.recent_high |
array |
The latest eight high or critical events, shaped as in List Events. The severity filter does not apply to it |
Errors
| Status | Code | When |
|---|---|---|
400 |
rest_invalid_param |
days is not a number from 1 to 365. |
Plus the errors every endpoint can return.
Examples
curl -s "https://your-site.example/wp-json/plugixa-activity-log/v1/stats?days=7&group=authentication" \
-u "admin:$WP_APP_PASSWORD"
<?php
$query = http_build_query(['days' => 7, 'group' => 'authentication']);
$ch = curl_init('https://your-site.example/wp-json/plugixa-activity-log/v1/stats?' . $query);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const auth = Buffer.from(`admin:${process.env.WP_APP_PASSWORD}`).toString('base64');
const query = new URLSearchParams({ days: '7', group: 'authentication' });
const response = await fetch(`https://your-site.example/wp-json/plugixa-activity-log/v1/stats?${query}`, {
headers: {
'Authorization': `Basic ${auth}`,
},
});
const { data } = await response.json();
Quick Links
Share