• Resolved pautgn

    (@pautgn)


    Hi,
    It seems that the plugin loads 2 CSS files and 1 JS file on every page of the website. I suppose they are not needed always and I’d like to not load the CSS and JS, unless they are needed.
    I only have activated 2 modules “LearnDash Resume Button” and “User Switching”.

    And the CSS/JS that the plugins loads on every page:

    • wp-content/plugins/uncanny-learndash-toolkit/src/blocks/dist/blocks.style.build.css
    • wp-content/plugins/uncanny-learndash-toolkit/src/assets/frontend/dist/bundle.min.css
    • wp-content/plugins/uncanny-learndash-toolkit/src/assets/frontend/dist/bundle.min.js

    Can I know where are that css/js files needed? Maybe only inside the admin? Maybe they are not needed for that 2 modules?

    Regards.

Viewing 1 replies (of 1 total)
  • Plugin Author Uncanny Owl

    (@uncannyowl)

    Sorry to hear about the issue you’re having with the static assets.

    The file blocks.style.build.css doesn’t exist anymore in the latest version, and we’re loading the same assets for blocks and shortcodes now. This means updating to the latest version will remove that file from your site.

    Regarding the two bundle files, Uncanny Toolkit is loading the files on all pages because sometimes it’s impossible to detect whether a shortcode or block is on a page, especially when using some builders. That said, the two modules you mentioned you’re using are not styled by those files, which means that for now it’s safe to dequeue the bundles in your site. To do so, please add the following PHP snippet to the functions.php of your child theme, or to a custom plugin if you have one:

    /**
     * Uncanny Toolkit
     * Dequeue static assets
     */
    add_action( 'wp_enqueue_scripts', function() {
    	wp_dequeue_script( 'uncannyowl-learndash-toolkit-free' );
    	wp_dequeue_style( 'uncannyowl-learndash-toolkit-free' );
    }, 999 );
    

    This fix is temporary, as it will affect the styling of the Frontend Login (in case you need to use the module), which is styled by those files. For that reason, we’ll work on improving the shortcode and block detection to load the assets strictly where they’re required, and we’ll load them in the footer so it’s not a render blocking resource.

    Hope this helps!

    Thanks,
    Agus @ Uncanny Owl

Viewing 1 replies (of 1 total)
  • The topic ‘PageSpeed Insights – render blocking resources’ is closed to new replies.