=== Rogue Admin Detector ===
Contributors: UsmanR
Tags: security, administrator, backdoor, users, audit
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Finds administrator accounts hidden from the Users screen by reading the database directly, and emails you when a new admin appears.

== Description ==
Some WordPress malware creates an administrator account and then hides it from the Users list or fakes the user count, so the dashboard looks normal. Rogue Admin Detector looks at the database itself and compares it with what WordPress reports.

**What it does**

* Lists accounts that have administrator rights in the database (up to 500 accounts, ordered by user ID).
* Compares that with the Users screen and the WordPress user counts, and flags any account WordPress does not show ("Hidden from WordPress").
* Lets you mark your own admins as trusted so unreviewed ones stand out.
* Shows plain-language warning signals such as a suspicious username, a disposable email domain, or a brand-new account.
* Emails you when a new administrator appears, and re-checks on a schedule so accounts added straight into the database are caught too.
* Adds a Site Health test and a WP-CLI command that does not change any users: `wp rogue-admin scan`.

**What it does not do**

It only reads and reports. It never deletes or changes users. It makes no external requests, has no tracking, and shows no ads. A threat that also tampers with the database layer (for example a db.php drop-in) may still hide accounts, so treat the result as one useful check, not a guarantee.

== Installation ==
1. Upload the plugin folder to `/wp-content/plugins/`, or install it from the Plugins screen.
2. Activate it.
3. Open Tools > Admin Audit and review your administrators.
4. Optional: set the alert email on the Settings tab.

== Frequently Asked Questions ==
= Does it delete suspicious users? =
No. Version 1.0 only reports. Open the user in the normal Users screen, or follow the steps on the Audit page.
= Does it send data anywhere? =
No. Everything stays on your site. The only message sent is the alert email you enable.
= Why was I not alerted at once when an account was added in phpMyAdmin? =
Direct database inserts do not trigger WordPress events. The scheduled check finds them at its next run (hourly by default), or click Scan now.
= Does it work on multisite? =
Yes, when activated on an individual site. Network-wide reporting is not included.
= The page says everything agrees. Is my site clean? =
It means the database and WordPress agree about administrators. It is not a malware scan.
= Which accounts are detected? =
Detection looks for the administrator role (and flags a suspicious user_level). Accounts granted individual capabilities without the role are not detected in v1.0.

= Is there a limit on how many administrators it checks? =
Yes. The audit lists up to 500 administrator accounts, ordered by user ID. Sites with more than 500 administrators are marked as capped and the newest accounts may not be listed.

== Screenshots ==
1. Audit screen with status banner and administrator table.
2. A hidden administrator flagged with warning signals.
3. Settings tab.
4. Site Health test result.

== Changelog ==
= 1.0.0 =
* Initial release.

== Upgrade Notice ==
= 1.0.0 =
First release.
