=== MainWP Team Control ===
Plugin Name: MainWP Team Control
Plugin URI: https://mainwp.com
Description: MainWP Team Control extension allows you to create a custom roles for your dashboard site users and limiting their access to MainWP features. Requires MainWP Dashboard plugin.
Version: 5.2
Author: MainWP
Author URI: https://mainwp.com

== 5.2 Upgrade and Recovery ==

Back up the complete Dashboard database before updating. Migrated Team Control roles keep their saved MainWP permissions but lose the WordPress administrator capabilities they carried in 5.1. Their WordPress capabilities become read and level_10, which keeps permitted MainWP pages available.

A user assigned several active Team Control roles receives the union of their saved MainWP permissions, including sites, clients and tags. Earlier versions could use only the first matching role. Review users with multiple roles because their effective access can expand. Held and disabled roles grant no MainWP permissions; a held role can still retain its old WordPress capabilities when the upgrade could not safely rewrite it. The Roles page identifies this condition.

Eligible administrators with no Team Control role become owners when no owner registry exists. On multisite, they must also be super administrators. If a direct capability cannot be saved, seeding leaves no registry and the upgrade waits without changing legacy roles. Resolve the storage failure and reload wp-admin to retry. If no administrator qualifies, remove the Team Control role from an administrator account and reload.

An existing owner registry is never automatically replaced. If its owners are demoted, deleted, lose their direct owner capability, or its integrity check fails after WordPress salts change, use local WP-CLI as an administrator to add an eligible administrator as an owner:

    wp mainwp team-control-owner prepare --action=add --user_id=<user ID> --user=<administrator login>
    wp mainwp team-control-owner apply --confirmation=<token returned by prepare> --user=<administrator login>

The confirmation expires after ten minutes. The target must have manage_options and activate_plugins and hold no Team Control role; on multisite the target must be a super administrator. Reload wp-admin after recovery so a waiting migration can finish. Multisite supports one MainWP Dashboard per network; the owner registry is network-wide while role tables and direct capabilities belong to the Dashboard site.

Team Control converts its own tables to InnoDB, but does not convert WordPress core tables. If the core options or usermeta tables use a nontransactional engine, their writes cannot be rolled back by the transaction. A corrective write can also fail, so a failed operation can require owner intervention and reconciliation. Check the reported role and membership state before retrying. Downgrading the plugin does not restore removed WordPress capabilities or undo data migrations; recover from the complete database backup when a full rollback is required.

== Changelog ==

= 5.2 - 10-22-2026 =

* Important: Existing roles retain their MainWP permissions but no longer grant WordPress administrator access.
* Important: Managing team roles and users now requires an authorized Dashboard administrator (“Team Control owner”). Eligible administrators without a Team Control role are authorized automatically during the initial upgrade.
* Important: Permissions from multiple active roles are now combined. Review existing assignments, as access may expand.
* Important: Roles that cannot be migrated safely are placed on hold and grant no MainWP access until resolved.
* Added: MainWP abilities and MCP support for managing team roles, users and notes.
* Added: Permission controls for supported MainWP abilities, including Built-In Backups.
* Fixed: Issues with saving user notes and updating role permissions.

= 5.1 - 5-21-2026 =

* Added: New API Backups permissions for more granular control over backup management actions.
* Added: REST API permission controls for team roles, including API keys and application passwords.
* Added: Empty-page placeholder UI elements for a more consistent experience when no data is available.
* Added: Multi-role filtering and bulk role-change options in the "Users" tab for easier user management.
* Added: Role user counts with quick links to filter users by selected role.
* Updated: Users table now renders initial data server-side to improve loading reliability.
* Updated: Enabled DataTables state saving for the roles table to preserve table preferences.
* Updated: Improved permissions, edit role modals, and action button styling for better usability and visual consistency.
* Updated: Strengthened AJAX input handling and new-role capability loading for improved reliability.
* Updated: Refined layouts, markup, and accessibility details across the interface for a cleaner user experience.
* Updated: Improved the checkbox layout in the role editor modal for better visual consistency.
* Updated: Disabled automatic autofocus when opening the "Edit Role" modal to prevent unexpected scrolling.
* Updated: Dashboard permissions now hide backup-related options when the legacy backup feature is disabled, keeping role settings cleaner and more relevant.

= 5.0.3 - 9-23-2025 =

* Updated: Support for the Cost Tracker module to enhance permission management and user access controls.
* Updated: Support for the Insights module to improve role-based access and data visibility controls.
* Updated: Revised various labels and terminology throughout the plugin to improve clarity and consistency.

= 5.0.2 - 3-7-2025 =

* Updated: Moved the Create New Role button from table footer to the actions bar element

= 5.0.1 - 5-29-2024 =

* Updated: Compatibility with the latest DataTables library version

= 5.0 - 2-27-2024 =

* Updated: MainWP 5.0 compatibility

= 4.0.4 - 8-25-2023 =

* Updated: Role permissions settings

= 4.0.3 - 9-20-2022 =

* Added: Accordion functionality to the sidebar elements
* Added: Responsive mode to the users table
* Updated: Moved the Create New User button to the sidebar element
* Updated: Removed the `right floated` CSS class from the Create Custom Role button
* Updated: Preventative changes to avoid potential conflicts

= 4.0.2 - 12-13-2021 =

* Fixed: JS error
* Updated: PHP 8 compatiblity

= 4.0.1.1 - 9-10-2020 =

* Updated: MainWP Dashboard 4.1 compatiblity

= 4.0.1 - 2-28-2020 =

* Fixed: multiple cosmetic issues
* Added: ability to select All/None option sets
* Added: sites filter for the allowed sites selection

= 4.0 - 8-28-2019 =

* Updated: extension UI/UX redesign
* Updated: support for the MainWP 4.0

= 1.3 - 10-12-2018 =

* Fixed: PHP error caused by missing function

= 1.2 - 8-24-2018 =

* Added: Update Translations permission

= 1.1 - 2-26-2018 =

* Fixed: multiple permissions issues
* Added: ability to delete custom roles
* Updated: plugin info

= 1.0 - 2-17-2015 =

* Fixed: A bug with permission to access a group
* Added: An auto update warning if the extension is not activated
* Added: Support for the new API management
* Added: Support for WP-CLI
* Updated: "Check for updates now" link is not visible if extension is not activated
* Updated: Refactored code to meet WordPress coding standards
* Updated: Extension layout
* Removed: Demo user roles

= 0.0.4 - 7-10-2015 =

* Fixed: Bug with site selection by group
* Added: Custom language translation domain
* Updated: CSS style
* Updated: Extension layout
* Removed: Unused images
* Removed: Comments in JS file

= 0.0.3 =

* Updated: Quick start guide layout

= 0.0.2 =

* Fixed: Broken links
* Added: Missing help documents

= 0.0.1 =

* First version
