Login Failure Forensics
WordPress plugin that logs failed login attempts for support diagnostics
by Marija Lekić · github.com/lolifoks/login-failure-forensics
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/lolifoks/login-failure-forensics/archive/refs/heads/main.zipReadme
Login Failure Forensics
A small WordPress plugin that captures failed login attempts with the reason, username, IP address, user agent, and timestamp. Adds an admin page under Login Failures in wp-admin so support staff can see the actual pattern instead of guessing.
Why
"Why can't I log in" is one of the most common WordPress support tickets, and the default WordPress log gives you almost nothing to work with. Was it a wrong password? A username that doesn't exist? An empty submission from a broken login form? A brute-force bot? Without data, every ticket is guesswork.
This plugin captures every failed login attempt with enough context to diagnose the real cause at a glance:
Wrong passwordfor a real user → probably a forgotten password ticketUser does not existacross many random usernames → almost certainly a bot sweep- Empty username or password repeatedly → a broken form or a misconfigured client
- A custom reason from a security plugin → tells you which plugin is doing the blocking
Features (v0.3.0)
- Captures every failed login attempt
- Records the specific WordPress error code as a human-readable reason
- Captures username, IP address, user agent, and timestamp
- Admin page under
Login Failuresin the sidebar (admin-only) - Paginated table showing full history, 25 attempts per page
- Automatic schema migration between plugin versions
Requirements
- WordPress 6.0+
- PHP 7.4+
Installation
- Copy the plugin folder to
wp-content/plugins/. - Activate from the Plugins screen.
- Navigate to
Login Failuresin the admin sidebar.
What it captures
| Column | Details |
|---|---|
| Attempted username | Whatever was typed in the username field |
| Failure reason | The WordPress error code (incorrect_password, invalid_username, empty_username, etc.) mapped to a human label; unknown codes shown as-is |
| IP address | From REMOTE_ADDR (v1); proxy-aware IP detection planned for a future version |
| User agent | Truncated to 500 characters |
| Timestamp | In the site's timezone |
Security notes
- All admin output escaped with
esc_html - All input read from
$_SERVERsanitized withsanitize_text_fieldandwp_unslash - All database queries with variables use
$wpdb->preparewith typed placeholders - Admin page requires the
manage_optionscapability at both menu registration and render time
Roadmap
- IP-based grouping ("show me the 5 IPs with the most failures this week")
- Filtering by reason, username, or date range
- Optional auto-purge of records older than N days
- Export to CSV
License
GPL-2.0-or-later