• Resolved T4ng

    (@schwipps)


    Hi,
    Just gave a shot at Asset Cleanup. It does what I expect ??

    I especially use it to get rid of Elementor eIcons, Fontawesome scripts I never use in front.
    However, a tiny drawback is that as Elementor status bar icon is a fontawesome element, it’s missing as well.
    Therefore, I was wondering if there was a way to disable Asset Cleanup effects when logged in as website adminstrator, so that frontend optimizations doesn’t affect the website administration (where performance shouldn’t bean issue!).

    No drama here, but if there’s a way to keen things neat.. ??

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Gabe Livan

    (@gabelivan)

    @schwipps happy to hear that you like the plugin! More exciting features will come up! When you unload an asset, it will take effect on both logged-in and guest users. That is to make it easier for you as well (the logged-in admin) to see that something was changed or it’s broken and fix it. It’s not fun to have it work for you and not for your visitors which is the most important thing. However, I understand that you don’t like the changes that are made if you’re logged in and something can be worked out.

    Would you like Asset CleanUp changes to not take effect for unloading only or for all features? I could implement an option that will allow you to use a snippet in functions.php to keep the plugin as “inactive” when you’re logged in.

    You can currently append /?wpacu_no_load to any page and Asset CleanUp will be as inactive, but not practical in this case as you have to keep appending to the URL every time you’re accessing a front-end page while you’re logged in.

    Thread Starter T4ng

    (@schwipps)

    @gabelivan Thanks for your quick answer.

    Thinking again, you’re right, it’s important to be able to check things when logged in… before going live. In my case, we have different levels of cache that make pretty impossible to check that your plugin doesn’t break anything without being logged, or using a test environment.

    Therefore, thinking further ?? A good process could be that I do these tests under “test mode”, where I could live loosing some admin functionalities, the ones that bloat the frontend.

    Finally, once I’m done, I could have the Asset Cleanup optimizations disabled for WordPress admin users (not all logged in users, could be members, or Ultimate Members profiles, …).
    A slower but clean admin env is much better than an admin env missing functionnalities or interface elements.

    I hope you get my point.

    Plugin Author Gabe Livan

    (@gabelivan)

    @schwipps Just to let you know, I haven’t forgotten about your requests and I kept thinking of an effective solution that will not confuse users and in these cases (which are rare), the CSS/JS can be loaded if the admin user is logged-in on the front-end view (as Asset CleanUp never unloads assets within the Dashboard.

    A filter can be added (via a code snippet) where you can specify which handles you want to keep loaded for you. You just have to place them in the code and add the snippet in functions.php from your theme (or a different location such as a custom plugin, as you prefer). I can prepare this and also mention it in the documentation so it would be very easy to use.

    Another option would be to have an area in the admin panel where you can add the handles (e.g. somewhere in “Settings”) that will be ignored from unloading for admins.

    Plugin Author Gabe Livan

    (@gabelivan)

    @schwipps Update: There’s an option (starting from version 1.3.5.3) that allows you to skip unloading the targeted CSS/JS file if the user is logged in. So, if you unload Elementor’s icons, but want to keep them loaded, you can use the checkbox “Load it if the user is logged-in” (from “Make an exception if unloaded and always:” area) which shows up if any unload rule is active.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Disable Asset Cleanup effects when logged as admin user’ is closed to new replies.