GithubHelp home page GithubHelp logo

wearerequired / admin-menu-manager Goto Github PK

View Code? Open in Web Editor NEW
61.0 15.0 6.0 881 KB

Manage the WordPress admin menu using a simple drag & drop interface.

Home Page: https://wordpress.org/plugins/admin-menu-manager/

License: GNU General Public License v2.0

PHP 34.08% JavaScript 54.69% Shell 2.82% CSS 3.81% HTML 4.60%
wordpress-admin wp-admin wordpress-plugin

admin-menu-manager's Introduction

Admin Menu Manager

WordPress plugin to manage the WordPress admin menu using a simple drag & drop interface.

admin-menu-manager's People

Contributors

dependabot[bot] avatar grappler avatar neverything avatar swissspidy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

admin-menu-manager's Issues

Use Sass

This is self-descriptive, isn't it? :)

Backbone Rewrite

Just like with the User Feedback Plugin, the Admin Menu Manager is getting bigger and bigger. That's why a more modular rewrite using Backbone.js makes sense to me.

We could separate the logic, use event triggers, and much more.

Preserve original menu icon

Scenario 1:

  1. Move Jetpack to the Dashboard item so it becomes a sub menu item.
  2. Move the item back to its original menu.
  3. The original Jetpack Icon is lost until you refresh the page.

Scenario 2:

  1. Move the Add New item from the Pages item to the top level.
  2. The item gets an unfitting gear icon instead of inheriting the icon from Pages

Maybe this can be solved by adding a data attribute with the original values on init. It needs to support custom SVG icons like from Jetpack and WordPress SEO though. However, this information should be available in the array (Index 6 of top level items)

Unit tests

This would help a lot. Perhaps only PHPUnit tests in a first round, afterwards QUnit tests.

Maybe we can borrow some code to setup this from the grunt-wp-plugin repo?

Support collapsed admin menu

  • Don't show label if menu is collapsed
  • Change icon when editing the menu to indicate the current action (inactive / editing)
  • Maintain margin when menu is collapsed

Import / Export Functionality

Reported by @fgilio on the WordPress.org support forums:

One useful feature I imagine is the ability to export/import menu profiles. And maybe one option to export it directly to php, very dev friendly.

Not sure how difficult it would be to implement such a feature.

For example, when you have plugin X on site A, but not on site B, what happens when you import the menu settings from one site to the other? It would probably be added to the site (after #3), but resulting in a 404...

A simple JSON import / export would probably be needed for #25.

Use the REST API

The new plugin requires WordPress 4.4 and PHP 5.4, so why not use the REST API for saving and retrieving the admin menu? I think that would make for a very interesting project which WordPress core could theoretically also benefit from.

Make plugin more visible for new users

We got some great feedback by Stefanos Kofopoulos on how to improve the UX for new users.

This includes things like improved formatting/styles, a settings link in the plugin list table (even though there are no settings right now), or some kind of animation to show the edit button.

This got me thinking if we should perhaps use a feature pointer for version 2.0 to show the edit button and new features.

Two current media items when moving sub item

When moving a sub menu item to the top level and navigating to that page, it appears that both elements in the nav menu get the "current" class, the original parent and the new item.

Possibly related: #10

Support WP_SCRIPT_DEBUG

We need a non-minified version of the JS in the build folder as well, so we can easily switch versions when WP_SCRIPT_DEBUG is enabled.

Global default menu

As per this request:

Ideally I would like to see the option to apply across to all users, like a default menu and then the user can overwrite the menu organization how they want, but that would just apply to them and no one else.

See also #25 (comment)

Allow changing the menu labels

Ideally each menu label would have a contentEditable attribute so the user can change the menu label inline.

Difficulties:

  • No directly obvious way to translate menu items. What about users with a different language?
  • Don't change existing items so translations still work.

Closely related to #1 UI-wise.

Overrides remove_menu_page

With 2.0.0.-alpha: In my functions.php, I check if a user is an admin, and if not, then I hide all Admin Panel items using remove_menu_page. However, when AMM is activated, certain items reappear: Home, All Posts, All Comments, Available Tools. This is consistent and repeatable. When AMM plugin is deactivated, the items are again hidden. Here is my code, pop it into your functions.php and you'll see what I mean. With that code in your functions.php:

  1. deactivate AMM plugin and login as a non-admin user, navigate to wp-admin and notice the panel is empty.
  2. activate AMM plugin and refresh, notice the admin panel is no longer empty.
add_action('admin_menu', 'remove_admin_sidebar_from_endusers'); 
function remove_admin_sidebar_from_endusers ()  { 
    get_currentuserinfo();
    global $user_level;
    if ( $user_level <= 8 ) {
        remove_menu_page( 'index.php' );                  //Dashboard
        remove_menu_page( 'profile.php' );                //Profile     
        remove_menu_page( 'jetpack' );                    //Jetpack* 
        remove_menu_page( 'edit.php' );                   //Posts
        remove_menu_page( 'upload.php' );                 //Media
        remove_menu_page( 'edit.php?post_type=page' );    //Pages
        remove_menu_page( 'edit-comments.php' );          //Comments
        remove_menu_page( 'themes.php' );                 //Appearance
        remove_menu_page( 'plugins.php' );                //Plugins
        remove_menu_page( 'users.php' );                  //Users
        remove_menu_page( 'tools.php' );                  //Tools
        remove_menu_page( 'options-general.php' );        //Settings
        //echo "<script type='text/javascript' >document.body.className+=' folded';</script>";  //collapse by default
        remove_meta_box('dashboard_right_now', 'dashboard', 'core');
        remove_meta_box('dashboard_activity', 'dashboard', 'core');
        remove_meta_box('dashboard_recent_comments', 'dashboard', 'core');
        remove_meta_box('dashboard_incoming_links', 'dashboard', 'core');
        remove_meta_box('dashboard_plugins', 'dashboard', 'core');
        remove_meta_box('dashboard_quick_press', 'dashboard', 'core');
        remove_meta_box('dashboard_recent_drafts', 'dashboard', 'core');
        remove_meta_box('dashboard_primary', 'dashboard', 'core');
        remove_meta_box('dashboard_secondary', 'dashboard', 'core');        
    } 
} 

Support Admin Color Schemes

Currently some color values are hardcoded and don't work well when you change the color scheme. Also, the borders of the separators aren't visible on the Jetpack settings page.

Let's fix this!

Center edit button

Currently the edit button isn't exactly horizontally centered. Having it in the middle would be nice.

Per-user menu customising

It would be great if each user could set their preferred order, rather than it being done by the administrator which affects all users.

For example, I have just built a site for a client with ten custom post types and an editorial team of eight users. A couple of the editors mainly work on 2-3 post types, while others work more often on others, so it would be very useful if each user could move their frequently used post types up to the top of the menu.

I realise this is a fundamental change to how the plugin works (storing the menu order as usermeta rather than in the options table) and it would mean opening up the customisation to lower user levels.

What do you think?

Prepare for Beta

Put the last finishing touches on the plugin and fix the most obvious bugs. Some I've noticed two weeks ago:

  • Menu items sometimes don't stay at their position and get added to the end
  • Custom menu items sometimes disappear
  • Slugs/Links sometimes change (e.g. with the Email Subscribers plugin)
  • When moving a top-level menu item, the first sub level item might be moved instead

After that, create a 2.0.0 Beta 1 release here on GitHub an perhaps even upload it to the WordPress.org plugin directory (but keep the stable tag at 1.0.1).

Composer error

Hey! Been watching this plugin for a while and I'm pretty excited for it! When I saw there was an alpha of 2.0 I was pretty interested in testing it out.

I grabbed it, put it in the plugins, and ran composer install --no-dev. It mostly worked, but I got the following error:

Loading composer repositories with package information
Updating dependencies
  - Installing wearerequired/wp-requirements-check (dev-master 0d9f602)
    Cloning 0d9f602ed83def11f97c07ee76ad204cc1ba247f from cache

Writing lock file
Generating autoload files
> "vendor/bin/phpcs" --config-set installed_paths vendor/wp-coding-standards/wpcs
sh: vendor/bin/phpcs: No such file or directory
Script "vendor/bin/phpcs" --config-set installed_paths vendor/wp-coding-standards/wpcs handling the post-update-cmd event returned with error code 127

Filter to Turn Off Editing

A filter so that users have a easy way to Turn Off Editing functionality, thus preventing the enqueuing of scrips, styles and a little markup. All in a couple lines of code in functions.php

Useful when you finished editing the menu and don't want to load all that every time.

Allow changing the menu icons

When a submenu item is moved to the top level, it automatically gets a dashicons-admin-generic icon. The user should be able to change this, ideally for every menu item, not only new ones.

Idea: A click on the icon shows a little popup next to it with a couple of icons to choose from. Selecting an icon updates the menu item and the entry in the JS array. In the PHP part we only have to detect custom icons and overwrite the existing values.

New items disappear

using 2.0.0-alpha:
Steps:

  1. Create a new item, change its name, click checkbox icon to save it. Then create another new item and give it a unique name. Two new items. Click check icon to close Edit mode.
  2. click Edit Items, then click one of the new items (the Edit box pops up)
  3. Don't make changes, but click on another item in the menu (any, new or existing item). Then click on another (any). Now there should be three Edit pop-ups open (which seems to be an already-reported open bug)
  4. Click X to cancel.
  5. All New items are gone.

Line separators

Interesting idea from the support forums:

Rather than just a blank row, I would like the option of having a line separator.

Not sure if that's possible.

Can't get sub menus back to original position

I dragged the "Add New" item from the "Pages" menu into the root of the admin menu. After that the "Pages" menu doesn't have any submenu and therefore I can't set the "Add New" menu item not back to the "Pages" menu as a sub item.

New demo video

I think after version 2.0.0 we should make a new demo video because of the new UI. If we put it on YouTube, we can directly include it in the readme.txt on WordPress.org.

Add "Reset" functionality

The user should be able to reset the menu and start from scratch without uninstalling the plugin.

Allow adding custom menu items

There could be an "Add" button (with a small plus icon? :)) that lets users add a custom menu item with label, icon and URL.

Obviously, adding separators should be possible too.

WP_Requirements_Check

Directly After Activation I Found this error
Fatal error: Class 'WP_Requirements_Check' not found in /var/www/html/proj_name/wp-content/plugins/admin-menu-manager-master/admin-menu-manager.php on line 38

Permission error after moving sub menu item

Scenario:

  1. Install a plugin like Google Analytics by Yoast or Jetpack
  2. Move a random sub item of that plugin to the top level
  3. Visit that page
  4. Permission error occurs. ๐Ÿ˜ข

Conflict with Slate Admin Theme

According to a report on the support forums there are some incompatibilities with the Slate Admin Theme.

I don't really want to add exceptions for specific plugins with such a small user base, but maybe we can get it to work without much effort. Perhaps it's just a small JS/CSS issue.

Problem 1:

After saving and clicking done (the tick mark), the admin menu remains in edit mode. I cleared my cache and refreshed and the admin menu went back to being usable.

Problem 2:

When Slate is active, Admin Menu Manager conflicts so that the last (bottom) item in the admin menu sidebar is hidden.

Without Admin Menu Manager:

before

After installing Admin Menu Manager (V1):

after

Allow removal of menu items

It would be great if items could be removed from the menu completely. You would obviously need a way to be able to restore them, so a possible UI could be a a box that appears below the 'Edit Menu' button while you're in edit mode where you can drop unneeded menu items. They will then remain there and can be dragged back into place in the future.

I'm not sure how possible that will be, but it would be a great add-on to what is already an awesome plugin.

Fatal error: Class 'WP_Requirements_Check' not found

When I try to active plugin version 2.0 of the plugin on my Wordpress 4.8 installation I receive the following error:

Fatal error: Class 'WP_Requirements_Check' not found in /wp-content/plugins/admin-menu-manager-master/admin-menu-manager.php on line 38

How to fix this so I can use version 2.0 of the plugin?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.