Feat/admin menus addon#210
Conversation
- Add addon bootstrap, activator, and app layer for admin menu editing - Load per-role menu rules and integrate with Members addon system Made-with: Cursor
- Register members-admin-menus in addon catalog with title and excerpt - Register members-admin-menus script handle with dependencies and filemtime - Fall back to General settings view when the requested view slug is missing Made-with: Cursor
- Add sidebar editor layout, drag handles, and form styling in admin.css - Add admin-menus.js for the visual menu editor UI and interactions Made-with: Cursor
- Refresh minified output for settings page script (no source change) Made-with: Cursor
- Add support for custom image icons in the admin menu editor, including auto-detection of icon types (image, SVG, FontAwesome). - Implement image preview functionality for selected icons. - Update styles for custom icons to ensure proper display in the admin sidebar. - Improve color override functionality for menu items.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new 'Admin Menus' add-on for the Members plugin, providing a visual interface to hide, reorder, rename, and customize admin menu items per role. My review identified several areas for improvement: the menu URL override logic needs to account for submenu keying, the promotion of submenu items requires a more robust callback handling, the export function should check if headers are sent, the JavaScript save function needs a failure handler, and Font Awesome versioning should be consistent and defined via constants.
There was a problem hiding this comment.
Code Review
This pull request introduces a new 'Admin Menus' add-on for the Members plugin, providing a visual interface to hide, reorder, rename, and customize admin menu items per role. My review highlights several critical issues: overwriting menu slugs can break WordPress core functionality, promoting menu items without a callback will cause broken links, and the redirect logic for hidden pages could lead to infinite loops. Additionally, I have suggested using consistent capability checks, optimizing user search queries to avoid performance issues, and implementing static caching for user configuration lookups to improve efficiency.
…lity and improved submenu management
…ing settings in admin menus
…r saving settings
…proved item visibility
…cy in admin menus
…ror handling in admin menus
…on and enhance role color mapping logic
…consistent width for sortable helpers and improve submenu order token handling
…efs for improved user experience
…ions and update documentation for clarity
…ption handling in admin menus
… popover layout in admin menus
…er and adjust CSS for improved styling
…n menus with new expandable sections and improved summaries
… to ensure default value is applied correctly
…role capability matrix for better accuracy
…background color handling in menu overrides
Improve UI and add some other features
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new 'Admin Menus' add-on for the Members plugin, allowing administrators to customize the WordPress admin menu per role or user, including hiding, reordering, and renaming items. The review identified potential security improvements regarding the regex for base64 data URIs and recommended using sanitize_key() instead of sanitize_text_field() when verifying nonces for better security practices.
…itization in admin AJAX functions
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new 'Admin Menus' add-on for the Members plugin, providing a visual interface to customize, reorder, and hide admin menu items per role or user. It also includes a migration to sync post-tag capabilities for roles that can manage categories. A security concern was raised regarding the custom menu redirect logic, which currently permits external redirects. I have kept the security review comment as it identifies a potential open redirect vulnerability that requires attention.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new 'Admin Menus' add-on for the Members plugin, allowing administrators to customize the WordPress admin menu by role or user, including hiding, reordering, and renaming items. My review identified a potential logic mismatch regarding how hidden items are merged across roles (Union vs. Intersection), a security concern regarding the lack of server-side protection for critical settings pages to prevent administrative lockout, and a performance improvement opportunity by optimizing user data retrieval in the AJAX user search function.
…thorized hiding and capability gating of critical admin menus
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new 'Admin Menus' add-on, providing a visual interface to manage WordPress admin menus, including hiding, reordering, and customizing items per role or user. It also includes updates to the 'Category and Tag Caps' add-on to improve capability synchronization for roles that manage categories, along with minor UI and script adjustments across the plugin. I have no feedback to provide as there were no review comments.
|
Hi @cartpauj this one is done and ready to review based on latest https://screenrec.com/share/Kfmw8jDAPM Please let me know if we need to update or change anything. I will work on doc on website once it approved |
|
Kindly reminder @cartpauj |
Admin Menus (Members add-on)
The Admin Menus add-on extends the Members plugin so site administrators can customize the WordPress admin sidebar per role and user: reorder items, hide screens, override labels/icons/URLs/colors, add custom links, and gate menu visibility by capability.
Settings are stored in the WordPress option
members_admin_menus_settings(OPTION_KEYin code).Where to configure
admin.php?page=members-admin-menus)The UI loads a snapshot of the current admin menu tree (captured on first load) and uses AJAX for save, reset, export, import, and user search.
Who is affected
members/addons/admin_menus/is_user_exempt.How configuration is resolved
settings['custom_items']) and global capability map (settings['capabilities']) are included from stored settings.settings['users'][ user_id ]), if present, replace whole blocks for:hidden,order,submenu_order,overrides,custom_items, andcapabilities.Feature areas
Menu order
menu_orderfilter (priority 999) and a physical reorder of the global$menuarray.sep-*tokens in the order list; these become realwp-menu-separatorentries.submenu_order.Visibility: hide by role / user
remove_menu_page/remove_submenu_page.parent_slug::child_slug.admin_init(unless exempt): users are redirected (default: dashboard; filtermembers/addons/admin_menus/redirect_url).members-settingsorpage=members) cannot be hidden, to avoid locking the site out of Members configuration.Capability-based visibility
settings['capabilities']map (or the whole map replaced by a per-user block); it does not merge per-role capability maps fromsettings['roles']in PHP—those may still exist in stored data for the editor UI.Overrides (labels, icons, URLs, badges, colors)
parent::child.admin_head).parentset to__promote__can be promoted to a top-level menu page.parentoverride.Custom menu items
pagehook and redirect to the configured URL via a small callback (no blank admin page).Import / export
members_admin_menus), with sanitization on import (seefunctions-admin.php).Safety notes
edit.php) also ties into blocking related edit screens for default post types where applicable.In progress
Planned UX and reliability improvements for the Admin Menus editor:
beforeunloadpromptwindow.prompt('Parent slug')— users must type raw slugs (e.g.edit.php)alert()for success/errorssaveSettings()lacks a.fail()handler