Skip to content

Performance Improvements with wp_dequeue_ for Conditionally Non-UsersWP Pages #672

Description

@sean-mystyle

First off, this would be a great potential feature to add in Settings for the plugin, too, something like a checkbox that says "Do not enqueue assets (scripts or styles) on non-usersWP related pages." like some plugins have, to reinforce the "lightweight" aspect of UsersWP that makes it great. In the meantime, it can be done manually to some extent.

The purpose is to remove any render blocking resources to increase page speed scores, without installing another plugin to do so.
IE most all of these:

I'm currently seeing a loss of like .5 seconds to 1+ second on UsersWP assets loading on page, which I'd like to take out when they're not necessary. Google's mark for a "good" page experience is now 2.5 seconds, which leaves little room for unnecessary asset load times. As such I'd like to filter out the plugin on pages that it's not needed for by dequeuing the styles and scripts we don't need, so that another optimization plugin doesn't need to be added to the stack.

Do you have any suggestion on how to do this, if you've done it before yourself, or perhaps a function you're already using to do the same type of check, something like a is_users_wp() to check if it's a page usersWP runs on? With that we can implement something pretty simple like

wp_dequeue_style( 'ayecode-ui' );

...and so on.

Of course, this is assuming that we do not use the lightbox popup login features or anything like that where the plugin assets would be required on every page.

Thanks a lot for any suggestions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions