How to eliminate render-blocking javascript and CSS in above-the-fold content in wordpress - wordpress

How toeliminate render-blocking javascript and CSS in above-the-fold content in wordpress. If any one can please help me.

Looks like there is a wordpress plugin called autoptimize that will do a lot of the work for you. I believe it also enables compression. Once you install the plugin, navigate to settings => autoptimize and check optimize CSS code as well as optimize JavaScript code.

I woudn't use a plugin.
First of all merge CSS files into one file.
Next use https://jonassebastianohlsson.com/criticalpathcssgenerator/ .
You'll get some css code - insert it inline in header.
Then you can load rest of the CSS via JS ( https://github.com/filamentgroup/loadCSS ).

Many ways. The ways to pass over 85/100 are -
You can use Pagespeed module
Use a third party service to deliver optimised frontend. Google had such service which is closed now.
Or follow traditional way of backend optimisation.
Nowadays, good websites pass through another service or another server as reverse proxy which automatically optimises the frontend. Thats it.
Traditional way :
That is one server one website and tweak on main server.
Your server's response time higher is most important. First pass it. Test on webpagetest.org.
Then give priority to visible content.
Then leverage cache.
Render blocking matter is after making them great.
Those optimisations are after you have passed server security, time to first byte, uptime etc. There is no plugin that can make 100% perfect with few clicks for all sites.
You should read (see WordPress doc) and load scripts asynchronously on footer or body via plugins like Header and Footer and ask on WordPress forum when you face difficult. Many times many technology websites discussed it in details. There are really very good old blog websites like CSS Tricks. You should find all articles on the topic and read from old to new. It is impossible to give an easy way. Loading Js is more complicated browser, device matter. Furthermore there is W3TC like cache plugin on normal websites.
Known problems of traditional way :
It is not odd to open up a security flaw with some snippets. With HTTP/2 push, many new things, recent security matters of WordPress during February forcing not to talk about odd plugin and snippets. None really can perform security audit. That is why I talked about it 2 years back about render-blocking javascript and CSS, not later . There I have shown settings of WordPress free Async js and css plugin. That WordPress plugin gives options for CSS, JS getting automatically loaded as inline or load asynchronously. You can try. Inline, Async all has own demerit.
It is technically difficult work than the plugins descriptions will say. Such plugins decrease the manual work but does not eliminate the need of hand coding, trial. It is part of page speed optimisation. You have to slowly learn yourself and plan according to budget.
Do at own risk at dev site with A+ score on SSL labs, add various security headers.
As you possibly a commercial website security is of more importance, followed by page loading speed.
As end tip, you should arrange to host on unmanaged server to optimise the backend. Your site is slower at present which is problem out of host.

Related

How to decrease LPC in WordPress site mobile

Does anyone know the reason of this element I attached the screenshot of auditing of side. I use almost every optimiser plugin but I didn't get the result
You need to first check where the problem is/ which part of your website is not properly configured on Gtmetrix.
From the generated report you'll most likely have to minify your javascript and css as well as resize photos. Use plugins like Autoptimize to minify js and css. Compress images with any of these.
Finally cache your website using WP Super Cache
Of there are more plugins you can substitute for the ones I provide, these are just free to use.

How do I optimize the speed of my Wordpress, Elementor, and WooCommerce website on Litespeed server?

I'm trying to optimize a website (gntac.com) but not sure how to proceed further. It's hosted on Litespeed server and I'm using the Litespeed Cache Plugin for Wordpress. I have enabled webp images, combined and minified javascript, minified css, and enabled quick.cloud CDN. I'm also using Modernizr for webp replacement in css but Insights doesn't seem to recognize the change.
There are also a lot of DOM elements (presumably due to Elementor). Some of the theme elements are hidden with css on mobile. I tried to use Mobile_Detect to only load those elements for desktop but the cache seems to be static and is either generated for mobile OR desktop but not both so the Mobile_Detect code is useless. None of this seems to have made any difference in Pagespeed Insights with tests still at around 11 for mobile and 42 for desktop.
Could anyone please provide some pointers on where to go from here? I know a little web development and SEO/optimization but this is beyond me at the moment.
You can try to deactivate the cache, do the Lighthouse Check again, try to get ride of the unused script and styles and activate the cache tool again.
You should combine your css to, not only js.
The Front Page is well cached, but te product are loading up to 6 secs - which is way to long. Maybe yout server is to slow and you should upgrade.
Webpage speed optimization is an art itself. On advanced levels, we look into every piece of code for optimization.
At the beginner level, I would suggest you to use Cloudflare CDN (Free Subscription) and configure Cache and Speed settings.
Second, instead of using PageSpeed Insights, use Solarwinds Pingdom to check the speed of the website.
Third, make sure that all the unnecessary plugins and themes are deleted. Clean up as much as you can. WordPress themes are the usual culprit of a slow website, use the lightest possible theme which is regularly updated and optimized.
Make sure to address Render Blocking Elements (inline critical elements or deffer) and Server Response Time (better web hosting).

Gracefully serve MP4 from Apache or Wordpress

I've looked a bit and seen a number of questions related to serving mp4, but I have not yet seen an answer to "How can I serve MP4 from Wordpress and/or Apache?" I believe it is possible as the twentyseventeen theme IIRC lets you host your own.
I am looking to host my own, if possible, after this question had an anchor linking to this blog post, and the custom generated minimized code did not work on this page on my site. Both that and the present homepage have the offered HTML solution but fail to do what is intended, namely hide related offerings like the (now retired) rel=0 parameter.
What, if any, options do I have to serve MP4 gracefully, with or without streaming, from Wordpress under Apache? I would ideally like something as graceful as under Youtube, but without related videos.
Thanks,
You definitively want to peek a look at the Plugins WordPress offers for video streaming. For example, Easy Video Player allows you to "embed both self-hosted videos or videos that are externally hosted using direct links".
It's just a one-liner. Can't get simpler than that:
[evp_embed_video url="http://example.com/wp-content/uploads/videos/myvid.mp4"]
As of functionality, it will work in Apache, since the webserver only transfers the video by HTTP and the playing occurs in the client side with HTML5. However, you must check that your hosting gives you enough bandwidth to stream content to all your visitors
By default, Wordpress provides a [video] shortcode. I'm trying to see if that will work, as a matter of using Wordpress default functionality.

A WP website we are developing is resulting too slow for first visitor.. Any ideas..?

We purchased a WP theme and did some customized changes in php and html
to bring the design where we wanted...
We are almost done with the design of the website and construction
and we are about to deliver to client
but for some reason the website is responding very slow on the first visitor..
and we cannot find the problem, what conflicts with what..
Are there any WP experts in here that could have a look and maybe identify the problem..?
Thank you in advance..
Click here to view the website
Enable gzip compression
Leverage browser caching
Optimize images
Defer parsing of JavaScript
Minify CSS, JS
Analyze your site using GTmetrix and Google PageSpeed Insight, and follow the recommendations that you get from this systems.
It's not that slow? I can get a directory listing from your wp-includes directory just fine. Joking aside, looks like there are two different versions of jquery being loaded in, that's never good for things (view source, line:435) and the homepage makes about 179 requests which is a bit bonkers.
Try a caching plugin. As others have said better configured hosting helps, especially those that use caching technologies such as varnish/redis. A CDN will help with geographic speed. Compress images with WP Smush or similar. Good luck!
There could be multiple issues behind a slow wp website:
Using multiple plugins can slow down a wp website.
A poor web server that is not able to respond quickly.
Some configuration issues.
What i can see is that your website is resource intensive, CSS and JS script files are too heavy, even heavier than all images on the home page.
Try:
Minify the css and js files.
Compress images and the size would come down to less than 1 mb (use tinypng.com)
Use Google page speed to see the flow of the resources of your website and other related details.
Hope this helps.

Drupal 6 website is very slow

I've made this website for someone a while ago, using Drupal 6. The problem is that it's getting incredibly slow... When I optimize the database it seems to go faster for a while and then it's slow again... I tried almost everything that I found on Google, and nothing seems to work. Maybe someone here knows a bit more than Google? :p
One thing I noticed using PageSpeed, is that some of your images on this page (http://heuvelfolies.be/CMS/Producten) are resized using HTML and CSS, rather than displaying thumbnails. Not related to your db issues, but overall it will help with page loading.
Example output:
http://heuvelfolies.be/img/Producten_Netten.jpg is resized in HTML or CSS from 360x360 to 100x100. Serving a scaled image could save 74.7KiB (92% reduction)
Are you using other caching techniques such as Memcached? Drupal caching would be step one, which you mentioned you did, but the next step would be an intermediate caching system. I've had great luck with it.
UPDATE: Doesn't look like your host provides VPS so this would be something to do if you ever moved to a VPS. Having said that, being on a shared server has its limitations. Not knowing what the "other guys" on the server are running that may be slowing the whole thing down, is one of those limitations.
Are you using Drupal's built-in caching?
If not, turn it on -- it can make a big difference.
You may also want to look into a server-based caching solution such as Varnish.
What modules are you using?
It's possible that you're using a module with known issues. Google for speed problems related to the various modules you're using.
Are you displaying any dynamic content on every page?
This can slow things down, as dynamic pages can't be cached. Consider using AHAH or AJAX to load the dynamic parts of the page via Javascript after page load, so they are separated from the main page content, which you can then cache properly.
I can't event ping that server. Maybe you should consider changing a hosting?
Other things worth checking are cache enabled, JS and CSS file merging enabled. If layout consists of many graphics, consider using CSS sprite. Also make sure that connection to your DB is fast.
Before trying to improve anything, check the "Recent Log Entries" on the admin page.
There are so many reasons for a site being slow, first try to make sure that there's no errors.
I've just had a look at your site, it wasn't particularly slow, nor fast. Pages didn't seem to hang but thumbnails were not loading so quickly.
Check your site's health, check your hosting provider, look into caching, for solutions like Varnish, you will need Pressflow or Drupal 7 as well as root access, meaning at least a VPS...

Resources