- This topic has 2 replies, 3 voices, and was last updated 12 years, 11 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › Stop unnecessary js and css files from loading
I’m using eStore and eMember on my site and I’m working on the optimizing the load time and noticed that these plugins call a bunch of unnecessary files. Is there a way stop some from being loaded? For instance, if I disable the lightbox effect on images the lightbox.js file is still called.
Do all of the below files really need to be loaded on every page of the site? Aren’t some of these only needed in the admin? What about at least combining these files?
/wp-content/plugins/wp-eMember/css/eMember_style.css?…
/wp-content/plugins/wp-cart-for-digital-products/wp_eStore_style.css
/wp-content/plugins/wp-cart-for-digital-products/wp_eStore_custom_style.css
/wp-content/plugins/wp-cart-for-digital-products/lib/jquery.cookie.js?…
/wp-content/plugins/wp-cart-for-digital-products/lib/jquery.lightbox-0.5.min.js?…
/wp-content/plugins/wp-eMember/js/jquery.pagination-2.0rc.js?…
/wp-content/plugins/wp-eMember/js/jquery.confirm-1.3.js?…
/wp-content/plugins/wp-eMember/js/jquery.hint.js?…
/wp-content/plugins/wp-eMember/js/ajaxupload.js?…
/wp-content/plugins/wp-eMember/js/jquery.tools.min.js?…
/wp-content/plugins/wp-eMember/js/jquery.libs.js?…
/wp-content/plugins/wp-cart-for-digital-products/lib/eStore_read_form.js
These are not unnecessary. The files that are only needed in the admin are only loaded in the admin (there is a condition for that). When you use a caching plugin (example: W3 Total Cache) it will automatically combine all the CSS files and javascript files into one big file from this plugin and all the other plugins and load it for the entire site.
If you want to manually do what a caching plugin does then you can combine all the javascript files then load that file. Look for the following lines in the code that loads the javascript libraries:
wp_enqueue_script
If you are doing this for performance improvement then it is best to combine the script and css files then load them. Have a look at this post:
https://support.tipsandtricks-hq.com/forums/topic/speed-suggestion