Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Rajat Varlani

    (@the_champ)

    Hi,

    Sure. For now, you can add the following code in the functions.php file of your active theme to unload the Javascript file.

    /**
    * Initialization
    */
    function heateor_sss_custom_init() {
    add_action( 'wp_enqueue_scripts', 'heateor_dequeue_js_css' );
    }
    add_action( 'init', 'heateor_sss_custom_init' );

    /**
    * Dequeue the Javascript file of Sassy Social Share
    */
    function heateor_dequeue_js_css() {
    wp_dequeue_script( 'heateor_sss_sharing_js' );
    }
    Thread Starter savingyourtail

    (@savingyourtail)

    Hi, I tried this code, but it appears to have broken some of the sassy share features, for example the copy link button and the “more” share options button, so I had to remove it. (Though strangely, other share icons still worked). I guess this means there are some code elements within sassy-social-share-public.js that are -not- unused? Is it possible to strip out only these unused javascript within the .js file?

    Plugin Contributor Rajat Varlani

    (@the_champ)

    Yes, these share buttons depend on the JS file. It’s not possible to strip the unused code from the JS file. You should be ignoring this warning then.

    Thread Starter savingyourtail

    (@savingyourtail)

    Is it possible for the developer to modify the plugin in a way that deactivates unused code in a future update? This is the only plugin on my site, and I have many, that has unused code showing up in pagespeed insights without a way to disable those elements. And I have some really big plugins that I’m only using a few features of, so I think this is a common practice in other plugins that helps ensure optimal site performance. Thanks

    Plugin Contributor Rajat Varlani

    (@the_champ)

    We will take care of it in the upcoming updates.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Unused JS impacting site performance’ is closed to new replies.