WP Manifestindependent plugin directory
manifest / users / delete-inactive-users

Delete Inactive Users WP Registry grade C-. High-severity findings · 1 findingWP RegistryHigh-severity findings · 1 findingOpen the reportC-

Deletes users based on role and inactivity date.

★ 8stars
28release downloads
1.0.1latest · 1 year ago

Install

Download delete-inactive-users.zip From the 1.0.1 release on GitHub, Feb 4, 2025

Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/webdevstudios/delete-inactive-users/releases/download/1.0.1/delete-inactive-users.zip
Updates itself. It ships its own updater (Plugin Update Checker), so new versions appear under Dashboard → Updates.

The Delete Inactive Users WordPress plugin is a robust tool designed to help administrators efficiently manage user accounts by deleting inactive users based on their role and last login date.

Ideal for optimizing database performance and maintaining user data hygiene, this plugin allows you to configure custom settings and batch process large datasets.

Features

  • Customizable Role Selection: Choose specific user roles to target for deletion.
  • Date-Based Inactivity: Delete users who have not logged in since a specified date.
  • Batch Processing: Handles large datasets efficiently by processing users in batches.
  • Progress Feedback: Real-time progress bar and status messages during the deletion process.
  • Safe Operations: Includes nonce verification and safeguards to ensure only authorized actions are performed.

Installation

  1. Download the plugin from the GitHub repository.

  2. Upload the plugin files to the /wp-content/plugins/delete-inactive-users/ directory or install via the WordPress admin panel.

  3. Activate the plugin through the 'Plugins' screen in WordPress.

  4. Navigate to Tools > Delete Users in the WordPress admin panel to configure and use the plugin.

    Usage

  5. Access the Settings Page

    • Go to Tools > Delete Users in the WordPress admin menu.
  6. Select User Role

    • Choose the user role you want to target for deletion from the dropdown.
  7. Set Cutoff Date

    • Use the date picker to specify the last login cutoff date. Users who have not logged in since this date will be targeted.
  8. Start Deletion

    • Click the "Start Deletion" button. A progress bar and status messages will provide real-time updates.
  9. Completion Notification

    • Once the process is complete, a success message will be displayed.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request.

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature/feature-name).
  3. Commit your changes (git commit -m 'Add feature').
  4. Push to the branch (git push origin feature-name).
  5. Open a pull request.

License

This plugin is licensed under the GPL-2.0+ License. See the LICENSE file for details.

Support

For support or inquiries, please open an issue on the GitHub repository.

Releases

2 releases. Each count is every asset in that release; expand a row for the breakdown.

Tag
Published
Assets
Downloads
1.0.1 latest
Feb 4, 2025 1 year ago
delete-inactive-users.zip
25
Dec 29, 2024 1 year ago
delete-inactive-users.zip
3
C- grade

Security

Delete Inactive Users 1.0.1 · audited by WP Registry

High-severity findings.

1 high
Audited release
1.0.1
Findings
1
Worst severity
high
Content hash
cceca88e7d5a6d274f201aa9…

Findings

  • high Missing capability on AJAX mass user deletion (any role, including administrators)

    missing_capability

    diu_prepare_deletion and diu_process_batch are hooked only to wp_ajax_* (any logged-in user). Each callback begins with check_ajax_referer('diu_delete_users','nonce') and then performs privileged work with no current_user_can('manage_options') or current_user_can('delete_users'). Nonce verification is CSRF protection for a named action, not authorization: wp_create_nonce('diu_delete_users') is valid for whatever uid is in the session, including Subscriber/customer. prepare_deletion takes $_POST['user_role'] (sanitize_text_field only — not intersected with get_editable_roles(), not blocked for administrator/shop_manager) and queues matching IDs in the site-wide transient diu_user_ids_to_delete. The query ORs last_login NOT EXISTS with last_login < cutoff; last_login is written only by this plugin on wp_login as a unix timestamp while the query compares DATETIME, so NOT EXISTS matches every user of that role who has not re-logged-in since activation — i.e. an attacker can wipe an entire role, not merely 'inactive' accounts. process_batch then wp_delete_user()s 50 IDs per request with no reassignment, no skip of ID 1, and no skip of the current user. Observable: administrators vanish from wp_users and their posts are deleted, leaving the site with no remaining admin. The manage_options gate on add_submenu_page does not apply to admin-ajax.php.

    delete-inactive-users.php:190-265

    Recommendation

    At the top of both AJAX callbacks, require current_user_can('delete_users') (and manage_options if this should stay a Tools admin utility) in addition to the existing nonce check. Refuse user_role values that are not in get_editable_roles(), and never delete administrators, user ID 1, or get_current_user_id(). Key the transient per user (or use a user meta / private option) so one session cannot drain another. Align last_login storage with the DATETIME comparison (store current_time('mysql') or compare as NUMERIC timestamp) so the inactivity filter actually applies.

WP Registry hashes the installable build and reports on that exact bytes-for-bytes copy. Embargoed findings are withheld until they are disclosed, so a clean verdict means nothing public is outstanding. WP Manifest does not audit code itself.