• Resolved mohammedmalleck

    (@mohammedmalleck)


    Hi ,

    I’m using your plugin on my site and have been monitoring its performance using Performance tab in browser. I’ve noticed that the scripts and styles associated with the plugin are significantly affecting the site’s performance.

    Could you provide guidance on how to defer all script and style files for your plugin? If there are built-in options or recommended best practices for optimizing performance, I would greatly appreciate your insights.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter mohammedmalleck

    (@mohammedmalleck)

    view image for reference https://ibb.co/M7Gvh0m

    Plugin Author digitalapps

    (@digitalapps)

    hello, thank you for your message.

    can you elaborate on the screenshot you provided?
    which stats would you like to see improved?

    loading scrips async or defer can be done, I will look into this

    Thread Starter mohammedmalleck

    (@mohammedmalleck)

    Its actually the load on main thread which I find to be heavy due to the long tasks taking place by the siwper-bunlde.min.js code
    https://ibb.co/X3HP7Zy

    Although I am working on making my site performance better using other techniques , I think having defer async or pre-load for your plugins script and style tags can be really helpful

    Plugin Author digitalapps

    (@digitalapps)

    with version 1.2.12 I added a filter that allows you to load a script with defer or async strategies

    wpswiper_frontend_js_register_args?Filter

    Thread Starter mohammedmalleck

    (@mohammedmalleck)

    Hi!
    So I am running this code , but it does not seem to work … any idea whats wrong here?(its gpt btw)

    add_filter('wpswiper_frontend_js_register_args', function($args) {
    // Check if the script is
    wpswiper-bundle-js-js
    if (isset($args['handle']) && $args['handle'] === 'wpswiper-bundle-js-js') {
    // Add 'defer' attribute to the script
    $args['defer'] = true;
    }
    return $args;
    });
    Plugin Author digitalapps

    (@digitalapps)

    the last -js is appended by wordpress so you the correct

    wpswiper-bundle-js

    BUT !!!!

    I just pushed a new update that removes the extra -js

    So to correctly target a script is to check for:

    wpswiper-bundle

    Thread Starter mohammedmalleck

    (@mohammedmalleck)

    So I tried going with wpswiper-bundle , wpswiper-bundle-js & wpswiper-bundle-js-js but none of them worked.

    Also you were talking about a new update but I cannot see a new version to update the plugin to so I think we(users) should wait for the new version to be available.

    Also just leaving the image here of the script tags

    Plugin Author digitalapps

    (@digitalapps)

    Please update to version 1.2.13 and let me know.

    Thread Starter mohammedmalleck

    (@mohammedmalleck)

    Unfortunately, it does not work on my end.
    Maybe my code is wrong or something…

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