Admin Menu Tree Page View 2.8 Refactoring Update

Ciprian on Tuesday, March 21, 2023 in WordPress

NEW! Learn JavaScript by example. Code snippets, how-to's and tutorials. Try now!

Table of Contents

This has been a long time coming, and it’s finally live now. For this refactoring update, I have employed around 50 testers with various websites and content. Each tester had one or more websites. This gave me a lot of visibility into the user intent and specific scenarios and use cases.

Originally, the Admin Menu Tree Page View plugin was built for WordPress 4.9 and lower. It added a tree-like page hierarchy directly under the Pages top level menu item in the WordPress Dashboard. This was done by “hijacking” the menu, and inserting the tree right before the closing </li> element.

This had, obviously, some cons, and the plugin had some conflicts with other Dashboard UI plugins (not that many, to be honest, but enough to break the user experience). Another con was the actual load time for websites with tons of pages and parent/child relationships. Trying to move this functionality to an AJAX call, had the unpleasant effect of making the Dashboard jumpy and jittery, as the pages were populated.

More Custom Post Types!

Another request from lots of users was to add more custom post types, and this was simply impossible for large websites, as the Dashboard menu became way too long to be manageable, and the WordPress back-end became slow to unresponsive, the more content a website had.

The solution here was to move the pages to a top level menu page. This increased the “one click away” feature to “two clicks away”, which is not a bad trade-off in my opinion, especially when all public post types are now available in a hierarchical tree layout. Having a separate page now removed the need for collapsing the child <ul> elements, as the purpose of this plugin is to quickly see all your pages in a “bird’s eye view” manner.

New Features

New Top Level Menu Item

All public post types are now available on a separate page, by selecting a post type from a dropdown menu.

Better Performance

The Dashboard menu is untouched, and no hacky HTML is present. The plugin works perfectly in WordPress installations with lots of public post types in a tree hierarchy.

Removed Features & Functionality

As some of the plugin’s features became redundant, they needed to be removed. Expanding and collapsing the child <ul> elements was no longer needed, so 2 JavaScript resources have been removed, along with 200 lines of CSS and 3 external images (specifically from The cookies script used to remember expanded/collapsed items was also removed.

There are several plugins that offer a similar functionality, but they all have some shortcomings. Some are too heavy, code-wise, some are too heavy, feature-wise and some simply paid (nothing wrong with that).

What’s Next?

This is next on my list:

  • Add caching for post types
  • Remove jQuery dependency
  • Remove jQueryUI dependency
  • Improve dragging and dropping to work inside child elements
  • Reconsider expand/collapse functionality in a better, non-intrusive way
  • Add a “Trash” link to the post type pop-up

Related posts

7 comments on “Admin Menu Tree Page View 2.8 Refactoring Update

  1. Nice update, but the plugin is now pretty useless to me. It’s just another Pages and Articles view in one place.
    Couldn’t you at least include a preference to get the old tree-like page view back?

    Thank you for this great tool.

    1. I could have, but I wouldn’t have been able to keep improving the plugin. The old implementation was a workaround to inject the pages under each WordPress menu item.

      Even if they are in one place now, it’s still better than the native Pages screen, as all the post types are readily available (by choosing an option in the dropdown) and there’s more room to see pages, edit, delete, and move around.

      What was your favourite feature of the old plugin?

      1. While I appreciate you for putting so much effort into a free plugin, I gotta say that I don’t understand, what you are trying to do with this plugin.
        The only functionality that I got from the old Plugin was the hover-menu. That was a very, very good and useful thing.
        This new “overview-page” might be useful to some people but it has nothing to do with the original plugin and is of no use to me.
        I guess I will just try not to update it on the sites that I haven’t yet.

  2. My favorite feature of the old plugin was being able to select a page to edit by just hovering over pages in the admin menu and linking directly into the desired page. That was my only use for the plugin. I have this plugin installed on 40 sites.

    1. I understand.

      I tried loading the tree view into a really nice modal, but I lost the ability to search and to hover to Add/Edit pages.

      Maybe, at some point in the future, I will move all jQuery code to vanilla JavaScript and use event delegation, and then I will have ALL pages and custom post types available on hover.

      I don’t have a timeline for this, but it should be within a 2-month period.

Leave a Reply

Your email address will not be published. Required fields are marked *