• Resolved atvrequis

    (@atvrequis)


    Hi Gabriel,

    Hope you are doing well. I am looking to unload some code from my website that is only needed when a user is logged as it’s slowing down my front page and it’s not needed until they are logged in.

    I can’t quite see where i would do this in Assetcleanup.

    Could you point me in the right direction ?

    Kind regards,

    Alef

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

    (@gabelivan)

    @atvrequis you can unload CSS/JS on specific pages if the user is not logged in. You can even unload hardcoded assets and whole plugins, if you’re using the Pro version. What kind of code do you want to unload? If it’s just a PHP snippet that you have somewhere inside a plugin or the functions.php file, there’s no such feature in Asset CleanUp.

    Thread Starter atvrequis

    (@atvrequis)

    Yeah I thought it could, I guess I just can’t find it or don’t know where to look.

    For example, some css or js code.

    View post on imgur.com

    How would I unload this so it only loads for logged in users ?

    Thanks!

    Thread Starter atvrequis

    (@atvrequis)

    I think I found it, unload that specific code and then check the “but do load when user is logged in” exception.

    Plugin Author Gabe Livan

    (@gabelivan)

    That is correct. You can unload it site-wide, and make an exception by choosing to load it when the user is logged-in. The function that is missing is unloading an asset if the user is logged-in. Sometimes, there is specific code (e.g. analytics one) that should only be loaded by guests. I am considering implementing something like this.

    Is the option you found enough for what you need?

    Thread Starter atvrequis

    (@atvrequis)

    Yup, this should do it for me. Thanks Gabe!

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.