• wpler

    (@wpler)


    Hi,

    please add a hook to load the resources (js, css) on used pages / postings only.

    For this exists an easy way with hooks to do this on widget / shortcodes and will help to increase the page speed optimization problem on the homepage (if the widget / shortcode will not use there) ??

    Thanks,
    Stefan

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author richplugins

    (@richplugins)

    Hi,

    Am I correct that you need to remove the plugin’s asserts (css/js) from the page of your site where the plugin is not working?

    Thanks!

    Thread Starter wpler

    (@wpler)

    Yes, correct.

    Plugin Author richplugins

    (@richplugins)

    Hi,

    Ok, we will investigate this and try to add it in the next version.

    Thanks!

    Plugin Author richplugins

    (@richplugins)

    Hi,

    @wpler the hoook added in the latest version 1.7.1, please check.

    Thanks!

    Thread Starter wpler

    (@wpler)

    Plugin Author richplugins

    (@richplugins)

    Hi,

    Actually, at the moment, we implemented the queuing of static asserts in full compliance with the official WordPress best practices notes, through wp_enqueue_scripts hook.

    Are you sure that is it possible for a widget plugins (which work in a sidebar)? Could you send any real examples in the other plugins where it had already implemented?

    Thanks!

    Thread Starter wpler

    (@wpler)

    Hi

    of course… for example looks here (for shortcodes) or here (for widgets – be aware look at the comments of the post!)

    Plugin Author richplugins

    (@richplugins)

    Hi,

    Great! Thank you for helping to improve the plugin. Seems, it’s exactly what we need. Ok, we will investigate this and will add in the next version.

    Thanks!

    Plugin Author richplugins

    (@richplugins)

    Hi,

    We have some news regarding to this topic.

    We investigated and tested the solution from the second post with ‘is_active_widget’ function and found that it works great only if you’re using a widget on the default sidebar.

    However, huge part of users use the plugin in the site builders, like Elementor or Site Origin to show the reviews on a specific page in case if the site does not use a sidebar or there’s need to show reviews in a content of the page. In this case the solution with a ‘is_active_widget’ function does not work, because there’s no active widgets and assets are not loaded.

    Also, we encountered some issues with a plugins which works with the static assets to minimize, build & mix bundles and cached. Such plugins just do not include the plugin’s assets after widget added to sidebar and there’s need to re-assembled bundles and evict a cache manually.

    Apparently, we need to more carefully address this issue. It seems that not everything is simple here and there’s no trivial solution.

    We will be grateful for any active assistance in this question!

    Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Feature Request] Please load resources on used pages’ is closed to new replies.