code I can see in the header:
var element = document.createElement(“script”); element.appendChild( document.createTextNode( “var wc_add_to_cart_params = {\”ajax_url\”:\”\\/wp-admin\\/admin-ajax.php\”,\”ajax_loader_url\”:\”\\/\\/www.beanofatree.com.au\\/wp-content\\/plugins\\/woocommerce\\/assets\\/images\\/[email protected]\”,\”i18n_view_cart\”:\”View Cart\”,\”cart_url\”:\”http:\\/\\/www.beanofatree.com.au\\/cart\\/\”,\”is_cart\”:\”\”,\”cart_redirect_after_add\”:\”no\”};” ) );document.body.appendChild(element); var element = document.createElement(“script”); element.appendChild( document.createTextNode( “var woocommerce_params = {\”ajax_url\”:\”\\/wp-admin\\/admin-ajax.php\”,\”ajax_loader_url\”:\”\\/\\/www.beanofatree.com.au\\/wp-content\\/plugins\\/woocommerce\\/assets\\/images\\/[email protected]\”};” ) );document.body.appendChild(element); var element = document.createElement(“script”); element.appendChild( document.createTextNode( “var wc_cart_fragments_params = {\”ajax_url\”:\”\\/wp-admin\\/admin-ajax.php\”,\”fragment_name\”:\”wc_fragments\”};” ) );document.body.appendChild(element); var element = document.createElement(“script”); element.appendChild( document.createTextNode( “var ajaxURL = {\”ajaxurl\”:\”http:\\/\\/www.beanofatree.com.au\\/wp-admin\\/admin-ajax.php\”};” ) );document.body.appendChild(element); var elementjquery = document.createElement(“script”);function helperjquery(){ var elementwc_add_to_cart = document.createElement(“script”); elementwc_add_to_cart.src = “//www.beanofatree.com.au/wp-content/plugins/woocommerce/assets/js/frontend/add-to-cart.min.js?ver=2.2.4”; document.body.appendChild(elementwc_add_to_cart); var elementjquery_blockui = document.createElement(“script”); elementjquery_blockui.src = “//www.beanofatree.com.au/wp-content/plugins/woocommerce/assets/js/jquery-blockui/jquery.blockUI.min.js?ver=2.60”; document.body.appendChild(elementjquery_blockui); var elementjquery_cookie = document.createElement(“script”); elementjquery_cookie.src = “//www.beanofatree.com.au/wp-content/plugins/woocommerce/assets/js/jquery-cookie/jquery.cookie.min.js?ver=1.3.1”; document.body.appendChild(elementjquery_cookie); var elementflatsome_theme_js_minified = document.createElement(“script”); elementflatsome_theme_js_minified.src = “https://www.beanofatree.com.au/wp-content/themes/flatsome/js/flatsome.min.js?v=2.0&ver=2.1.1”; document.body.appendChild(elementflatsome_theme_js_minified); } elementjquery.onreadystatechange = function () { if (this.readyState == ‘complete’) helperjquery(); } elementjquery.onload = helperjquery;elementjquery.src = “https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js?ver=2.1.1”; document.body.appendChild(elementjquery); var elementadmin_bar = document.createElement(“script”); elementadmin_bar.src = “https://www.beanofatree.com.au/wp-includes/js/admin-bar.min.js?ver=4.0”; document.body.appendChild(elementadmin_bar); }// Check for browser support of event handling capability if (window.addEventListener) window.addEventListener(“load”, downloadJSAtOnload, false); else if (window.attachEvent) window.attachEvent(“onload”, downloadJSAtOnload); else window.onload = downloadJSAtOnload;
]]>Hi,
I activated wp defer loading, hoping to improve the page load times of my site (michaeltaboada.me). However, that removed all the links for logging in with a social media service from the oneall.com social signin plugin. I’m not sure which plugin’s fault this is, but perhaps there could be a way to stop some js from being deferred?
Thanks,
-Michael.
Hi, first of all thanks for this plugin and for your efforts!
Then, pagespeed still detects the following as errors. Any advice on how to fix these? Thanks
140.1KiB of JavaScript is parsed during initial page load. Defer parsing JavaScript to reduce blocking of page rendering.
https://virtualtournapoli.com/…/jquery.js (86.2KiB)
https://virtualtournapoli.com/…/main.js (45.2KiB)
https://virtualtournapoli.com/…/jquery-migrate.min.js (5.5KiB)
https://virtualtournapoli.com/…/q2w3-fixed-widget.min.js (2.1KiB)
https://virtualtournapoli.com/ (835B of inline JavaScript)
https://virtualtournapoli.com/google_analytics_auto.js (253B)
Firstly, I love your plugin. It makes an incredible difference to my site load speeds. I hope you can help me with a couple of problems that I am encountering, that I have definitely isolated to your plugin.
The two themes that are affected, are the ThemeForest Avada and Enfold themes. Both themes use a sticky menu and a modal search pop-up (this appears to be a consistent factor). Both of these pieces of functionality break when WP Defer Loading is activated, and the following errors are displayed through Chrome:
Avada: Uncaught SyntaxError: Unexpected token .
Enfold: Uncaught SyntaxError: Unexpected token ILLEGAL
It goes without saying that this functionality works with no error when WP Defer Loading is deactivated.
]]>I’ve been testing your plugin for my site and it is working almost fine exept when I try to load the editor in the frontend using wp_editor() function in a page template. Is there any way I can disable your plugin for this page template?
]]>I’m using the rev_slider plugin and when enabling the WP_defer_loading plugin my rev slider isn’t loading on the frontpage. The place where the revolution slider is supposed to be displayed is blank with the plugin activated.
]]>when i activate the plugin, it show me this on the header of my site.
var element = document.createElement(“script”); element.appendChild( document.createTextNode( “var display = {\”max_specific\”:\”0\”,\”display_view\”:\”1col\”,\”number\”:\”84\”,\”items\”:\”5\”,\”startPage\”:\”1\”,\”maxPages\”:\”17\”,\”nextLink\”:\”http:\\/\\/rawforbeauty.me\\/page\\/2\\/\”};” ) );document.body.appendChild(element); var elementjquery = document.createElement(“script”); function helperjquery(){ var elementjquery_migrate = document.createElement(“script”); elementjquery_migrate.src = “https://rawforbeauty.me/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1”; document.body.appendChild(elementjquery_migrate); var elementmodernizr = document.createElement(“script”); elementmodernizr.src = “https://rawforbeauty.me/wp-content/themes/themuse-parent/js/libs/modernizr.min.js?ver=3.8”; document.body.appendChild(elementmodernizr); var elementrespond = document.createElement(“script”); elementrespond.src = “https://rawforbeauty.me/wp-content/themes/themuse-parent/js/libs/respond.min.js?ver=3.8”; document.body.appendChild(elementrespond); var elementgeneral = document.createElement(“script”); elementgeneral.src = “https://rawforbeauty.me/wp-content/themes/themuse-parent/js/general.js?ver=3.8”; document.body.appendChild(elementgeneral); var elementcarouFredSel = document.createElement(“script”); elementcarouFredSel.src = “https://rawforbeauty.me/wp-content/themes/themuse-parent/js/jquery.carouFredSel.min.js?ver=3.8”; document.body.appendChild(elementcarouFredSel); var elementtouchSwipe = document.createElement(“script”); elementtouchSwipe.src = “https://rawforbeauty.me/wp-content/themes/themuse-parent/js/jquery.touchSwipe.min.js?ver=3.8”; document.body.appendChild(elementtouchSwipe); var elementcusel_min = document.createElement(“script”); elementcusel_min.src = “https://rawforbeauty.me/wp-content/themes/themuse-parent/js/cusel-min.js?ver=3.8”; document.body.appendChild(elementcusel_min); var elementaudioplayer.min = document.createElement(“script”); elementaudioplayer.min.src = “https://rawforbeauty.me/wp-content/themes/themuse-parent/js/audioplayer.min.js?ver=3.8”; document.body.appendChild(elementaudioplayer.min); var elementjquery.masonry = document.createElement(“script”); elementjquery.masonry.src = “https://rawforbeauty.me/wp-content/themes/themuse-parent/js/jquery.masonry.min.js?ver=3.8”; document.body.appendChild(elementjquery.masonry); var elementcustomInput = document.createElement(“script”); elementcustomInput.src = “https://rawforbeauty.me/wp-content/themes/themuse-parent/js/jquery.customInput.js?ver=3.8”; document.body.appendChild(elementcustomInput); var elementprettyPhoto = document.createElement(“script”); elementprettyPhoto.src = “https://rawforbeauty.me/wp-content/themes/themuse-parent/framework/static/javascript/jquery.prettyPhoto.js?ver=3.1.4”; document.body.appendChild(elementprettyPhoto); } elementjquery.onreadystatechange = function () { if (this.readyState == ‘complete’) helperjquery(); } elementjquery.onload = helperjquery; elementjquery.src = “https://rawforbeauty.me/wp-includes/js/jquery/jquery.js?ver=1.10.2”; document.body.appendChild(elementjquery); var elementfacebook_jssdk = document.createElement(“script”); elementfacebook_jssdk.src = “”; document.body.appendChild(elementfacebook_jssdk); } // Check for browser support of event handling capability if (window.addEventListener) window.addEventListener(“load”, downloadJSAtOnload, false); else if (window.attachEvent) window.attachEvent(“onload”, downloadJSAtOnload); else window.onload = downloadJSAtOnload;
the plugin helps to defer parsing of javascript when i check it on https://gtmetrix.com/. however it is showing weird codes on the header.
any idea how to fix these? t
thanks
Hi there:
First, let me say thank you for developing this plugin. This issue is one that has been bothering me greatly. So I installed the plugin via wp-admin, and these are my observations:
1. Good: my scores on both desktop and mobile on Google rose a few points (about 5 points in each case).
2. Not Good: Google still finds this a major issue “Eliminate render-blocking JavaScript and CSS in above-the-fold content”. (See scrennshot below) –
https://www.dropbox.com/s/pskhgscmtp60t35/Site_Performance4.JPG
3. Not Good: There is some strange code on the header of the site (please see screenshot below).
https://www.dropbox.com/s/8u8m24g2k6rupfk/Site_Performance5.JPG
My site is https://www.churchpatrol.com/
If you are able to fix it and get to work as advertize, this would be a lifesaver!
Thanks;
Serge
On attempting to active this plugin…
Plugin could not be activated because it triggered a fatal error.
Parse error: syntax error, unexpected $end in <my-path>/wp-content/plugins/wp-defer-loading/wp-defer-loading.php on line 252
]]>Something wrong with the header?
after installing and activating, i got an error message something like that “plugin has no valid header” and shows on at the top of the wordpress blog
‘ar elementjquery = document.createElement(“script”);function helperjquery(){ var elementjquery_migrate = document.createElement(“script”); elementjquery_migrate.src =…’
will there be an update?
]]>