Fixing render blocking JS gives error
-
Hey
I’m using this plugin for a countdown on a few pages of my site but I’m getting an error. I’ve installed a function to prevent render blocking on my site and move all scripts to footer. I’ve used this function on a lot of sites, but on this site and using your plugin, an error is throw.
Fatal error: Cannot redeclare ub_getNamesOfPresentBlocks() (previously declared in /app/web/wp-content/plugins/ultimate-blocks/src/init.php:61) in /app/web/wp-content/plugins/ultimate-blocks/src/init.php on line 61
Any ideas why this would be and what I could do to solve?
The function I am using to prevent render blocking is pretty standard:
if ( ! is_admin() ) { function defer_parsing_of_js ( $url ) { if ( FALSE === strpos( $url, '.js' ) ) return $url; if ( strpos( $url, 'jquery-3.4.1.min.js' ) ) return $url; return "$url' defer"; } add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 ); }
The error is shown on pages that are not even using UB blocks.
Thanks!
- The topic ‘Fixing render blocking JS gives error’ is closed to new replies.