=== Custom Role & User Manager ===
Contributors: maunaleoventures
Tags: roles, role manager, user roles, capabilities, user management
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.31.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Allows Administrators and designated roles to manage custom roles, descriptions, and user memberships.

== Description ==

Custom Role & User Manager allows WordPress administrators and designated roles to create, delete, enable/disable custom roles, edit role descriptions inline, and manage user role assignments with an intuitive, side-by-side AJAX interface.

= Key Features =

* **Side-by-Side Management**: Easily view, select, and assign roles to active members.
* **Role Creation & Control**: Create custom roles with descriptions or temporarily disable roles without losing user assignments.
* **Pending Users Management**: Review and assign roles to newly registered or unassigned members from a dedicated queue.
* **Access Control Setup**: Specify exactly which user roles are permitted to access and manage the plugin. The Administrator role is always allowed and protected.
* **Lockout Protection**: Administrators and designated plugin managers are protected from accidental disablement or deletion.
* **Document Vault Integration**: Detects Role-Based Document Vault systems to prevent conflicting role creations.

== Installation ==

1. Upload the `custom-role-manager` directory to the `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Access the plugin under the **Users -> Role Manager** admin menu.

== Frequently Asked Questions ==

= Who can access the Role Manager? =
Administrators always have access. You can grant access to additional roles (such as Editors or Managers) from the **Settings** tab.

= What happens if a user's role is not allowed? =
If a user does not hold the Administrator role or an allowed role, the plugin is completely invisible and inaccessible in `wp-admin`.

= Can Administrators be disabled or deleted? =
No. Administrators and users holding roles configured with plugin access are permanently protected from deletion or disablement within this plugin.

== Changelog ==

= 1.31.0 =
* Fixed input sanitization on array superglobals (`$_POST['user_ids']`, `$_POST['allowed_roles']`).
* Encapsulated multisite uninstall routine in `custom_role_manager_uninstall()` to avoid global variable leaks.
* Added nonce verification annotations on read-only navigation query arguments.

= 1.30.0 =
* Resolved all WordPress.org Plugin Check (PCP) and WordPress Coding Standards (WPCS) requirements.
* Updated `Tested up to` header to WordPress 7.1.
* Prefixed invoked hooks (`custom_role_manager_*`) and global uninstall functions.
* Added `wp_unslash()` to all superglobal inputs prior to sanitization.
* Localized all JavaScript UI strings via `wp_localize_script()`.
* Transitioned uninstall cleanup to `delete_metadata()` to eliminate direct database queries and slow meta_key lookups.

= 1.29.0 =
* Updated text domain to `custom-role-manager` to comply with WordPress.org repository standards.
* Added `Text Domain` and `Domain Path` headers to the main plugin file.
* Added WordPress.org compliant `readme.txt`.

= 1.28.0 =
* Strict plugin access visibility: if a user's role is not listed in the setup allowed roles list, the plugin is completely hidden in `wp-admin`.
* Administrator role is always allowed and cannot be altered.

= 1.27.0 =
* Added setup configuration setting in Settings tab to select which WordPress roles are permitted access.
* Protected all users holding the Administrator role or setup-allowed access roles from deletion or disablement.
* Added explanatory modal dialog detailing why protected accounts cannot be disabled or deleted.

