You can minify html safely. For CSS and JS, you could turn on manual minify mode in W3TC and input each individual script to minify, leaving out the ones that cause errors (i.e. theme ones). Pagespeed also gives you the full URL to each one that it identifies. This is a bit of a pain, but at least you clear away the Pagespeed messages. đ
Note that Pagespeed will also complain about external ones, and I believe there’s nothing you can do about that.
Luke
Hello,
I was trying to optimize page speed, and followed all of the steps at: https://forum.tagdiv.com/how-to-make-the-site-faster/
Following these steps:
Remove render blocking css/js â using the TagDiv Speed Boosterplugin (Advanced Users)
Question:
1. Here is my result after I add the code at the end of the functions.php file:
registered scripts
common | /wp-admin/js/common.min.js
admin-bar | /wp-includes/js/admin-bar.min.js
utils | /wp-includes/js/utils.min.js
svg-painter | /wp-admin/js/svg-painter.js
wp-auth-check | /wp-includes/js/wp-auth-check.min.js
devicepx | http://s0.wp.com/wp-content/js/devicepx-jetpack.js
wpseo-admin-global-script | http://livelovefruit.com/wp-content/plugins/wordpress-seo/js/wp-seo-admin-global.min.js
td-wp-admin-general | http://livelovefruit.com/wp-content/themes/Newspaper/wp-admin/js/general.js
td-wp-admin-panel-js | http://livelovefruit.com/wp-content/themes/Newspaper/wp-admin/js/wp-admin-panel.js
thickbox | /wp-includes/js/thickbox/thickbox.js
registered styles
jetpack-subscriptions | http://livelovefruit.com/wp-content/plugins/jetpack/modules/subscriptions/subscriptions.css
admin-bar | /wp-includes/css/admin-bar.min.css
colors | 1
ie | /wp-admin/css/ie.min.css
wp-auth-check | /wp-includes/css/wp-auth-check.min.css
grunion-menu-alter | http://livelovefruit.com/wp-content/plugins/jetpack/modules/contact-form/css/menu-alter.css
google-font-ubuntu | http://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700,300italic,400italic,500italic,700italic&subset=latin,cyrillic-ext,greek-ext,greek,latin-ext,cyrillic
td-wp-admin-td-panel-2 | http://livelovefruit.com/wp-content/themes/Newspaper/wp-admin/css/wp-admin.css
wp-color-picker | /wp-admin/css/color-picker.min.css
thickbox | /wp-includes/js/thickbox/thickbox.css
wpalchemy-metabox | http://livelovefruit.com/wp-content/themes/Newspaper/wp-admin/content-metaboxes/meta.css
woocommerce_admin_menu_styles | http://livelovefruit.com/wp-content/plugins/woocommerce/assets/css/menu.css
jetpack-icons | http://livelovefruit.com/wp-content/plugins/jetpack/_inc/jetpack-icons.min.css
social-icons-widget-admin | http://livelovefruit.com/wp-content/plugins/social-media-icons-widget/css/social_icons_admin.css
woocommerce-activation | http://livelovefruit.com/wp-content/plugins/woocommerce/assets/css/activation.css
Then, when I go to look for corresponding ID’s, I only find the social-icons-widget-admin as something slowing down my site, but can’t find any of the others mentioned shown here (click link): http://livelovefruit.com/?attachment_id=7267
2. You say not to minify with W3 total cache, but on my page speed insights it says that I should minify html, minify css, and minify JavaScript. What should I do in this situation?
Thanks,
Carly
@anna1986
you may find this useful
https://forum.tagdiv.com/how-to-make-the-site-faster/
generally you don’t want to use ANY of the minify functions of W3, as it will break things.
Please see the sticky post on maximizing your site for PageSpeed. You can manually minify your CSS and JS main files. Browser cache settings can be specified in htaccess file if running Apache (I posted the how to on that in the sticky category of forum).
YOu may find it useful to test one of your post pages using GTMetrix in place of Google, as it will also give you better examples of how to optimize your page, tell you what needs to be fixed, and often give you minified versions of CSS/JS files you can grab. Free.
Hi,
Unfortunately the SpeedBooster plugin may not work with all plugins as it’s using a minified version of the theme js. Caching / minifying / performance / speed plugins usually do this which can break up the normal flow of some plugins or could generate js errors so if you want to use that plugin disable the SpeedBooster plugin.
Sorry about this!
Thanks for the message!
I’ve used it with some success. The two plugins do work together, I found, but WP Super Cache makes development quite a pain because of how aggressively it caches (at least by default) and hence needs to be cleared to see your changes.
I was using W3 Total Cache without minifying Javascript or CSS, as per the docs here, but a profiling plugin showed that it was actually consuming a good deal of CPU and contributing to load time, so it was kind of self-defeating… Currently I’m using the free Cloudflare service with all performance settings turned on (although some people report problems with minifying), and simultaneously trying out the high-rated caching that comes as an option in Wordfence Security … yet to see what effect those have together.
So, uh, yeah, a bit messy. But anyway, WP Super Cache should be okay.
Hi,
You also have some js errors in the console: http://screencast.com/t/2jdLyAH7pv
And also noticed you use cloudflare to minify js: http://screencast.com/t/i764ccK5ib
Please make sure you deactivate all plugins, empty cache, purge files and check again.
Thanks
Hi,
Please note that if you use the speed booster plugin the theme loads other minified version of site.js file which contains all the js put together.
In this case you will need to create a new site.min.js file with the smooth scrolling function disabled, please follow this topic for this: https://forum.tagdiv.com/topic/minifying-site-js-with-wp_booster-after-chances-to-td_login-js/
Hope this helsp!
Thanks
I did as you said. I still had the error because I forgot
else {
All I did was editing function php. I use default fonts on site, I did no change in theme panel. That means I use default, so no google ? It works. đ Thank you !!!
I got rid of some js codes, from g+, stat counter, etc. now I have 94/100 or 95/100.
Prioritize visible content
Your page requires additional network round trips to render the above-the-fold content. For best performance, reduce the amount of HTML needed to render above-the-fold content.
The entire HTML response was not sufficient to render the above-the-fold content. This usually indicates that additional resources, loaded after HTML parsing, were required to render above-the-fold content. Prioritize visible content that is needed for rendering above-the-fold by including it directly in the HTML response.
None of the final above-the-fold content could be rendered even with the full HTML response.
This error only. Any more idea how to fix ? I have:
– W3 TOTAL CACHE
Page cache: enable, disk enhanced.
Minify : AUTO
– HTML minify settings: all checked except Line break removal
– JS: ENABLE … ADDED 3 js scripts from site, using minify and NON BLOCKING USING ASYNC.
– CSS: no
Database cache – enabled.
Browser cache enabled.
– Async JS and CSS
Load Javascript asynchronously
Load CSS asynchronously
Minify CSS
– Speed Booster Pack
All general options
55% image compression
Load CSS asynchronously
Minify all CSS styles
NO tagDiv speed booster (INACTIVE)…
Thanks for the previous video on site. I hope my settings help others. If anyone can help with my last issue, I would be gratefull.
Google is a great search tool… as this is a common practice easily researched which has nothing to do with this theme. Learning these kinds of tricks is part of basic web development using Google fonts. đ
However, the basics are
1) search/replace all font mentions in the style.css to use the Google font you wish to use; in my case ‘Open Sans’
2) go to the Google fonts site, and find the font you want in the weights you want, in my case ‘Open Sans’ and get the code from them to place into your website
https://www.google.com/fonts#UsePlace:use/Collection:Open+Sans
in my case, normal, normal italic, bold, bold italic
3) choosing the above gives you code you’d normally place in the head of your web doc, or footer for some setups
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700' rel='stylesheet' type='text/css'>
The above is essentially what the theme loads except has various hooks and functions to let you select those in the admin panel; however you want to actually instead, take that CSS and put at bottom of your own style.css file and it can be done after minification (if you’re doing that) so you don’t minify this code.
So, basically take that URL and open in a web browser; which should download it to your hard drive;
4) then, open that and it will give you the CSS
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v10/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff) format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'), local('OpenSans-Bold'), url(http://fonts.gstatic.com/s/opensans/v10/k3k702ZOKiLJc3WVjuplzHhCUOGz7vYGh680lGh-uXM.woff) format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-weight: 400;
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://fonts.gstatic.com/s/opensans/v10/xjAJXh38I15wypJXxuGMBobN6UDyHWBl620a-IRfuBk.woff) format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-weight: 700;
src: local('Open Sans Bold Italic'), local('OpenSans-BoldItalic'), url(http://fonts.gstatic.com/s/opensans/v10/PRmiXeptR36kaC0GEAetxjqR_3kx9_hJXbbyU8S6IN0.woff) format('woff');
}
PLACE the above, or comparable code for the fonts you’re using, into bottom of your CSS file. If you’re running your site as https, then change URL to https.
5) using the info from my previous post in this thread; remove the section in the functions.php file which loads the Google fonts – so the old “calls” to the Google fonts won’t “print” on your HTML pages.
6) finally, if necessary, make sure you have all the font selections in the theme panel set to “default” as choosing any Google font won’t work, obviously
And obviously you would want to ensure your caching is off, mod_Pagespeed is ‘off’ if using that, and you’d likely need to clear your cache in your web browser and hit refresh couple of times to see the site properly with the change.
Kaboom! Mischief managed.
Yes, that’s to be expected, because the default settings are not what you want. Those include minifying CSS and JS, which will not work with this theme. Please read the docs or the dozens of forum posts on the subject… The plugin and the theme are not incompatible, and if you want the speed you’re looking for, you need a caching plugin!
There are other plugins that don’t even have options for minifying, such as WP Super Cache. But they’ll have other kinks to work out…
Sorry, but you should without question use a cache. It will only mess things up for your visitors if you use the wrong settings. W3 Total Cache without minifying javascript or CSS is safe. This issue has been brought up and this solution recommended in Newspaper’s docs and the forum many times. đ It will pretty much do a page cache, expiry headers, and basic (but highly necessary) compression.
W3 Total Cache can also be combined with a service like Cloudflare, which serves your site to visitors from its servers rather than your own. It speeds up delivery of some resources and helps with your server response time. (Pagespeed reports that your server responded in a massive 3.7 seconds.) I use this setup too.
A plugin like EWWW Image Optimizer will help with your optimize images problem. Note that you’ll want to do a one-time bulk optimization of your media library, which will take a long time, but after that it should just optimize on upload.
Feel free to ask for more details on the above steps. Once you try all of them, check your scores again. They will have greatly improved.
These are the steps that require little or no technical knowledge, but uf you still need more, start reading the excellent posts by Christopher Simmons and others in the sticky Pagespeed thread.
Best of luck!
Cloudflare doesn’t affect my responsiveness at all using this theme. It might be that you’re too aggressively caching or minifying your resources — these options are available under “Performance settings” on a per-website basis.
With your Speed Booster Pack settings:
1.Loads javascript files from Google Libraries
2.Defers parsing of javascript files.
3.Removes query strings from static resources
4.Load CSS asynchronously
5.Minify all CSS styles
6.Insert all CSS styles inline to the footer
Remove junk header tags
Is there a way to stop the Google Adsense Ads loading first? When you access a page, it’s all white for a second, then the ads popup in the wrong places then the css kicks in and the whole page looks correct again.
Thank you đ
Hi,
The theme files doesn’t have included that file that gets all js and creates the site.js and site.min.js files.
If you want it you can send an e-mail at contact@tagdiv.com and make a request for it and we will send it to you. Please send an URL of this topic also.
Thanks
-
This reply was modified 11 years by
Lucian.
Hello Lucian,
thanks very much!
Does Newspaper Theme also have a tool included (say a php File) that will read in all the small .js files in the js directory and then generate the site.js file?
Or do i have to concatenate them manually or write my own script to concatenamte them into the site.js?
thanks
Hi,
All scripts file the theme use are collected into site site.js file: http://screencast.com/t/KTq8SvXI
The site.min.js file is the minifyed version of site.js file and it’s used by speed booster plugin.
You can make your changes to the site.js file then use Google Closure Compiler tool to minify the modified file of site.js file and replace with newly minified version into the site.min.js file.
Hope this helps!
Thanks
-
This reply was modified 11 years by
Lucian.
Dear Sirs,
I had to change the td_login.js. It seems that this file gets “minified/compressed” into a site.js (most likely due to the wp_booster script).
How can I generte a new site.js on my own? (I do not want to reactive the theme every time, I need to do it on the command line).
What are the steps to do on the command line ?
thanks
I try to add some cache to my site. Using QUICK CACHE or WP FASTEST CACHE i get 42/100 on mobile and 50/100 on desktop on both, and without cache plugin too on google page speed test.
adding
add_filter( âjpeg_qualityâ, create_function( â, âreturn 50;â ) );
in functions.php as recommended i get.
Parse error: syntax error, unexpected T_LNUMBER in /home/site/public_html/wp-content/themes/Newspaper/functions.php on line 1553
So I installed W3 total cache.
Following the video from anterior posts https://www.youtube.com/watch?v=u0G6pk2mX4M when i enable minify with newspaper 4.4 i get blanc page. Hard times today… with only page cache from W3 I still have 49 / 100 … pff.
I disabled W3, installed speed-booster-pack.2.6 adn disabled td-speed-booster. Like in the video, when I activate Load CSS asincronius and I load site… guess what. Problems. Is loading with tabs list or something, can’t explain, and then loads. Issue anyway… will try more settings.
There are certain settings in W3 Total Cache that are problematic and other ones that are not. Make sure you’re not minifying CSS or JS. Page cache is okay, according to an earlier comment from support. đ
Hi,
Please turn off the minify option for JS and CSS and do the test again. Also noticed that you have this errors in the console: http://screencast.com/t/ALIouf4Lsd
Thanks
Hi,
Please turn off the minify option if you use any and also the page cache if this dose not fix the search please deactivate all plugins and check again.
Let me know of the result.
Thanks
The most important plugins you need to even get this close to getting those scores..as follow
1.tagDiv speed booster
2.Speedbooster Pack Plugin (Don’t use the feature Disable all above CSS options on mobile devices) all the other features can be use but it all depends on ur site.
3.WP Super Cache Plugin this work better with the theme and don’t cause any issues with the theme code.
4. Optimize Database Plugin http://wordpress.org/plugins/rvg-optimize-database/
5.EWWW Image Optimizer Plugin
6.CloudFlare Go to “performance settings tab” and make sure you choose every thing in there…
A.CDN & Full optimizations
B.Simplified
C.Rocket LoaderThis play a very big important role in ur google pagespeed test as well make sure it’ turn on..
D.Auto Minify (JS,CSS,HTML)
E.Minimum expire TTL Make sure it’s set to 5 days not more are less..
SOLVED!
..just disabling the Minify cache was enough.
Thank you very much for your quick support.
