This feature is available in the Pro version starting from v1.2.6.2 (it’s relevant only for those that want to unload any plugins within specific pages from the Dashboard).

Feature Overview

This option is located in “Plugins Manager” — “IN THE DASHBOARD /wp-admin/” tab (if the unloading plugins in the Dashboard is an enabled option) and is designed to help admins restore the WordPress Dashboard sidebar to its original state. This is particularly useful if unloading certain plugins causes essential links or menu items to disappear from the sidebar. By dynamically restoring the sidebar, admins can ensure a seamless experience while managing their WordPress Dashboard.


How the Feature Works:

When plugins within /wp-admin/ are unloaded using Asset CleanUp Pro, some sidebar menu links in the WordPress Dashboard might become unavailable. This feature resolves this issue by fetching the original sidebar HTML from the server (the way it loads as if all the plugins are loaded) and replacing the current sidebar. This ensures that any missing links are restored.

The restore process takes place automatically in the background while the admin is browsing the Dashboard’s pages. If at least one plugin is unloaded on a visited admin page, this option will trigger the sidebar to restore dynamically as soon as the page loads, ensuring that missing links are restored seamlessly without requiring any user intervention.


Key Benefits:

  • Seamless Recovery: Quickly recover missing links in the WordPress Dashboard sidebar without disrupting your workflow.
  • Dynamic Update: The sidebar is updated using JavaScript, so the page will load fast as it meant to, since you unloaded plugins to make it load faster.
  • Enhanced Control: Allows users to experiment with plugin unloading while maintaining easy access to Dashboard links.

How to use this feature?

  1. Unload plugins within /wp-admin/:
    • Navigate to the Asset CleanUp Pro’s “Plugins Manager”“IN THE DASHBOARD /wp-admin/” and unload plugins as needed
    • If certain sidebar links are missing after unloading a plugin, proceed to the next step.
  2. Activating the restore Dashboard’s sidebar Feature:
    • If “Enable all the rules below” is set, you will notice the following checkbox area: “Restore the left sidebar area as it was, if plugins are unloaded on admin pages”.
    • Check the box to enable the feature.
    • Once activated, a few radio options will appear below the checkbox, allowing you to choose how the sidebar should be loaded:
      • No overlay: The sidebar will be replaced without any visual indication.
      • Show overlay: An overlay will be displayed over the sidebar, suggesting a change is happening. During this time, links in the sidebar are inaccessible until the restoration is complete.
      • Show overlay & loading spinner: In addition to the overlay, a loading spinner will appear in the centre of the sidebar to indicate progress.
  3. Restoring the Sidebar:
    • The restore process takes place automatically in the background when you navigate to a new admin page that has at least one plugin unloaded.
    • The sidebar will be fetched from the server, and its HTML will replace the current sidebar, restoring all missing links. The whole process usually takes a few seconds (the same page reloads in the background without any plugin unload rule triggering and once its HTML source is ready, the sidebar replacement is triggered instantly)
  4. Verify Changes:
    • Once the sidebar restoration is complete, check for the restored links.
    • All the links, including the submenus should load fine for all plugins.

Technical Details:

  • Implementation:
    • The feature uses JavaScript (more precisely the well-known jQuery library that is loading in WordPress by default) to fetch the sidebar HTML, as it would appear without any plugins unloaded.
    • The original sidebar content is extracted (from the element with the ID “adminmenu”) and dynamically replaced in the DOM.
    • To make sure the sidebar submenus are shown on hover, extra code is trigger to reinstantiate the functionality of the sidebar. The native WordPress JavaScript file /wp-admin/js/common.min.js is reloaded.
  • Performance Impact:
    • The sidebar restore operation is optimised to ensure the admin gets an optimum visit experience (e.g. the page loads as fast as before).
    • ⚠️ One disadvantage of using this option (it will likely not affect most of the admins) is that the visited page has to load twice: the initial page load, and the one in the background from which the sidebar content is extracted). For instance, it might be an issue if there are lots of admins managing things on all sort of pages and the Dashboard is know to be slow due to lots of plugins installed.

Best Practices and Recommendations:

  • Use this feature at the same time when experimenting with plugin unloading in the WordPress Dashboard.
  • If you encounter repeated issues, consider reviewing the plugins marked for unloading to ensure compatibility with your Dashboard workflow.

Conclusion:

This Asset CleanUp Pro feature enhances the user experience by addressing potential sidebar link issues caused by plugin unloading. Offering a quick and efficient way to restore the sidebar ensures uninterrupted access to all essential Dashboard functionalities.

Was this post helpful?