=== Themis Admin Menu Sort ===
Contributors: markusstiewe
Tags: admin menu, menu sort, drag and drop, backend, navigation
Donate link: https://woocon.de/
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 2.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sort the WordPress backend menu via drag and drop, create groups, and hide unused items.

== Description ==

Themis Admin Menu Sort enables complete organization of the WordPress backend menu: sort top-level and submenu items via drag and drop, create freely definable groups with separators, hide individual entries, and rely on a fixed "Show All" toggle as a safety anchor.

**Main features:**

* Drag-and-drop sorting of all top-level menu entries and submenu items
* Freely definable groups (e.g. "Daily Tasks", "Settings") with named separators in the menu
* Show/hide menu items and submenu items
* Fixed "Show All / Hide" toggle always displayed as the first menu item (not movable, as a safety measure)
* Settings apply globally (not per user)
* Reset to WordPress defaults at the click of a button
* Integrated WLP license protection

**Typical use cases:**

* Move frequently used menu items to the top (e.g. WooCommerce, Orders)
* Move rarely needed system items further down
* Establish a consistent menu structure for all editors on a team

== Installation ==

1. Upload the `themis-admin-menu-sort` plugin directory to `/wp-content/plugins/`.
2. Activate the plugin via the "Plugins" menu.
3. Under "Settings → Admin Menu Sort", adjust the order via drag and drop.
4. Save – the new order takes effect immediately.
5. Optional: enter your license key under Settings → License.

== Frequently Asked Questions ==

= Does the sort order apply to all users? =
No, the sort order is saved per user account. Each user can define their own order.

= Does the plugin work with all WordPress themes? =
Yes, the plugin only affects the backend menu and is independent of the theme in use.

= Are menu entries from third-party plugins supported? =
Yes, all registered menu entries – regardless of vendor – appear in the sort list.

= How do I restore the original order? =
The "Restore Default Order" button on the settings page resets the sort order back to the original WordPress order.

== Screenshots ==

1. Settings page with drag-and-drop sort list
2. WordPress backend menu after custom sorting

== Changelog ==

= 2.0.1 =
* The settings page and its actions (save/reset) now use a dedicated `ams_manage` capability instead of the shared `manage_options`, so a role/menu-management plugin could grant a non-admin role access to Admin Menu Sort specifically without also unlocking Settings, Tools, or other manage_options-gated areas. Existing Administrator access is preserved automatically via a one-time migration.
* Bugfix: bundled WLP license client — once a trial expired (or a license became invalid) without a key entered, the plugin's own admin menu disappeared entirely and the only way back to the license field was a dismissible admin notice link; a real, always-visible admin menu item ("… — Lizenz benötigt") now appears automatically whenever the plugin is blocked, so the license key stays reachable by simply browsing the admin menu. Also fixed: the notice's direct link to the (hidden, non-blocked-state) license page could itself land on "Sorry, you are not allowed to access this page." on some WordPress versions — it's now registered as a real top-level page that's immediately hidden again, instead of a page with an empty parent slug.
* Bugfix: plugin header "Plugin Name" corrected from "The Themis Admin Menu Sort" to "Themis Admin Menu Sort" — matches readme.txt (Plugin Check flagged the mismatch)
* Bugfix: a stray "A " had crept back into the plugin header ("A Themis Admin Menu Sort") after the fix above, reintroducing the exact same name-mismatch problem against readme.txt — removed again.
* Bugfix: removed a UTF-8 byte-order-mark (BOM) at the start of admin/views/page-settings.php that could corrupt output/headers
* Bugfix: bundled WLP license client now uses the plugin's own text domain (themis-admin-menu-sort) instead of the hardcoded wlp-license-manager domain, resolving 29 Plugin Check TextDomainMismatch errors
* Bugfix: bundled WLP license client no longer enqueues admin/js/wlp-admin.js a second time under its own script handle — on sites also running the WLP License Manager server plugin (e.g. woocon.de), this caused every delegated click handler in that file to register twice, silently toggling UI state on and back off on click
* Code quality: WLP client — color value output is now escaped directly at the echo statement, the heredoc block in the license form was replaced with string concatenation (WordPress Plugin Check compliant), missing translators comments for placeholders were added
* Plugin header: added License field (GPLv2 or later)
* WLP client updated: support for a dismissible self-promotion banner (configurable per product in the WLP admin, reappears after x days)
* New: submenu items sortable via drag and drop
* New: freely definable groups with named separators in the live menu
* New: menu items and submenu items can be hidden individually
* New: fixed "Show All / Hide" toggle as the first menu item (safety anchor, not movable)
* Complete overhaul of the settings page and data storage

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 2.0.1 =
* WLP client updated: support for a dismissible self-promotion banner (configurable per product in the WLP admin, reappears after x days)
Complete overhaul. Existing order settings are migrated automatically.
