Developers · What Sign-In Alerts do
Developers
Sign-In Alerts
How the Edge Observer recognizes a sign-in, what reaches Stattery, and the plugin endpoint that looks up an account, and the Lock screen in WordPress.
The Fingerprint
A response that sets WordPress’s wordpress_logged_in_* cookie is a sign-in that worked. The cookie’s value is username|expiration|token|hmac. Inside the Edge Observer, on Cloudflare, it becomes two hashes, and only those go with the request’s report:
uh: the first 32 hex characters of SHA-256 ofstattery-acct1|<site>|<username, lower case>. The site is the host name withoutwww..sv: SHA-256 (hex) of the session token. WordPress stores each session under exactly this key in thesession_tokensuser meta, so it names one session.
Sign-outs (the cookie cleared), expired cookies and ordinary pages send nothing. The username, token and cookie never leave the Edge Observer.
const uh = sha256hex(`stattery-acct1|${site}|${username.toLowerCase()}`).slice(0, 32);
const sv = sha256hex(token);What It Looks At
Each sign-in is weighed on the site’s own Stattery hub against signs that it was not the account’s owner. How much each sign counts, and where an alert becomes urgent, is not published.
- A data center or hosting network. A VPN or relay people use (iCloud Private Relay, Cloudflare WARP, consumer VPNs, company security gateways) counts for much less.
- A country outside the ones the site serves (Settings, Bots, Countries, Ban break-ins from abroad), Tor, or a country nobody has visited the site from lately.
- A country or network this account has never signed in from.
- A network and country this account has used before, or marked “This was them”, counts in its favor.
- The session going straight for admin pages it can’t open.
Ordinary sign-ins teach the account’s usual countries and networks. Alerts are kept 400 days.
The Plugin Endpoint
POST /wp-json/stattery/v1/account on the site, plugin 0.9.21 and later (0.9.22 for the account in full and what it did). Stattery signs it like the customer lookup: header x-stattery-ts (milliseconds) and x-stattery-hmac, the hex HMAC-SHA256 of ts + "." + body with the site’s lookup key. Requests older than 5 minutes or over 2,000 bytes are refused.
{ "op": "find", "uh": "32 hex", "sv": "64 hex", "site": "example.com", "since": 1795056386000 }- The account is found by
svfirst (the session, while it lasts), then by the_stattery_uhuser meta the plugin stores at each sign-in, then by hashing every username. findanswers{ ok, user: { id, login, email, name, role, roles, admin, registered, edit, did } }. Nothing changes. Since 0.9.22 the login and email are in full (0.9.21 hid part of them).adminis true for accounts that can manage options, other people’s posts, WooCommerce or users.registeredis milliseconds.didcovers the time from the optional body fieldsince(milliseconds; the sign-in) on:orders,spent,order(up to 5),posts,post(up to 5),comments,profile,sessions,lastActive. Stattery callsfindafter an alerting sign-in, before anyone is told, so the email names the account. A sign-in right after a non-admin account’s creation is that account’s own sign-up: the alert is closed assignupand nobody is told.- Since 0.9.34 this endpoint no longer accepts
lock(it answers 400). Locking happens in WordPress: Stattery’s Lock button opens/wp-admin/options-general.php?page=stattery-lock-user&user=<user ID>, where an admin who can edit users and manage options confirms it. That ends all the account’s sessions, sets a random 32-character password and sends WordPress’s own reset email. An admin can’t lock their own account there.
Report As Wrong. Every sign-in alert card, and its notice in the bell, has Report As Wrong. It sends the alert to Stattery staff with an optional note and can dismiss the alert while they look. Their answer comes back as a notice in the bell.
The plugin also records the visitor’s real address on each new session (behind Cloudflare, WordPress otherwise records Cloudflare’s).
Refuse Data Center Sign-Ins
Off by default. When on, the Edge Observer gets the network lists with its ban list and answers 403 to a sign-in POST from a data center outside the site’s countries (anywhere, when none are named), before WordPress sees it: wp-login.php with no action or action=login, and any form post carrying woocommerce-login-nonce. Password reset requests and other forms go through. Each refusal is counted in the Edge Observer’s ledger as a login refusal.