# Dummy Users Finder & Cleaner - WordPress Plugin

A powerful WordPress plugin to identify and remove users with dummy or fake email addresses from your WordPress website.

## Features

- **Smart Email Detection**: Identifies dummy emails using multiple detection methods:
  - Known disposable email domains (10minutemail, mailinator, etc.)
  - Common test email patterns (test@, demo@, fake@, etc.)
  - Suspicious email patterns (random strings, number-only emails, etc.)
  - Invalid email formats

- **Comprehensive Scanning**: Scans all users on your WordPress site and categorizes them.

- **Detailed Statistics**: Shows total users, dummy email count, excluded users, legitimate users, and percentage breakdown.

- **Bulk Management**: 
  - Select individual users or select all.
  - Bulk delete functionality with safety checks.
  - Prevents deletion of administrators and current user.
  - Optionally reassign posts, comments, and WooCommerce orders to another user before deletion.

- **Domain Analysis**:
  - Groups users by email domain to quickly spot suspicious providers with many registrations.
  - Lets you bulk‑delete all users from a suspicious domain in one action (with the same safety checks and reassignment options).

- **WooCommerce‑Aware Safety**:
  - Automatically excludes users who have WooCommerce orders from all deletion operations.
  - Still lets you scan and see counts without risking real customer data.

- **Export Deleted Users**:
  - Export a CSV of all deleted users (ID, email, role, reason, timestamps) for audit and backup purposes.

- **User-Friendly Interface**: Clean admin interface with detailed user information and clear warnings where needed.

## Installation

1. **Upload the Plugin**:
   - Upload the `dummy-users-finder-cleaner.php` file to your WordPress plugins directory:
     `/wp-content/plugins/dummy-users-finder-cleaner/`
   - Or create a folder named `dummy-users-finder-cleaner` in your plugins directory and place the file inside

2. **Activate the Plugin**:
   - Go to WordPress Admin → Plugins
   - Find "Dummy Users Finder & Cleaner"
   - Click "Activate"

3. **Access the Tool**:
   - Navigate to Users → Dummy Users in your WordPress admin panel

## Usage

1. **Scan for Dummy Users**:
   - Click the "Scan for Dummy Users" button
   - Wait for the scan to complete (this may take a moment for large user bases)

2. **Review Results**:
   - View statistics showing total users, dummy email count, and percentages
   - Review the detailed table of users with dummy emails
   - Each entry shows the reason why the email was flagged

3. **Delete Users**:
   - Select individual users using checkboxes
   - Or click "Select All" to select all dummy email users
   - Click "Delete Selected" to remove the selected users
   - Confirm the deletion when prompted

## Safety Features

- **Protection Against Accidental Deletion**:
  - Cannot delete the current logged-in user
  - Cannot delete administrators
  - Confirmation dialog before deletion
  - Shows count of users to be deleted

- **Detailed Information**:
  - Shows user ID, email, username, display name, role, and registration date
  - Displays reason why each email was flagged as dummy

## Detection Methods

The plugin uses multiple methods to identify dummy emails:

1. **Known Dummy Domains**: Checks against a list of 30+ known disposable email services
2. **Pattern Matching**: Detects common test patterns (test@, demo@, fake@, etc.)
3. **Suspicious Patterns**: Identifies random-looking strings, number-only emails, etc.
4. **Format Validation**: Checks for invalid email formats

## Requirements

- WordPress 5.0 or higher
- PHP 7.0 or higher
- Administrator access to WordPress

## Permissions

Only users with `manage_options` capability (typically administrators) can access and use this plugin.

## Notes

- The plugin scans all users on your site, including subscribers, customers, and other roles
- Deletion is permanent and cannot be undone
- Always backup your database before performing bulk deletions
- The plugin respects WordPress user deletion hooks, so related data will be handled according to your WordPress configuration

## Support

If you encounter any issues or have suggestions for improvement, please report them through your preferred support channel.

## License

GPL v2 or later

