Layout – Webdesign

0,00 / maand excl. BTW

Layout kiezen / webdesign aanpassen

Ander webdesign / layout? Dat kan hier heel gemakkelijk!

  1. Gratis: Kies één van de voor geprogrammeerde layouts.
  2. Gratis: Pas je gekozen webdesign naar wens aan.
  3. Kies hier een andere gratis layout: Gratis implementatie.
  4. Kies een andere gratis layout: Vergoeding voor implementatie.
  5. Kies een betaald thema: Vergoeding voor implementatie.
  6. Laat een layout voor je maken.

Andere Layout

Ander Webdesign

Eénmalige betaling

1. Om welk webdesign gaat het (naam)
2. Waar kunnen wij het vinden
3. Als het in een account staat, mogen wij dan inlog-gegevens opdat wij het kunnen uploaden

Het verwijderen van webdesigns bespaart webruimte. Als er een webdesign extra op je website / webshop wordt gezet, dan kost dat webruimte.

Prijs per maand

Categorie:

Beschrijving

Lazy Load Fix for Divi

Beschrijving

Offers Fine-grained control for manually setting the threshold which images on a Divi page are lazy-loaded.

Includes a fix for a Divi bug that causes incorrect calculation of the lazy-load threshold.

Background

To improve page load performance, modern browsers allow for images and other media to be lazy loaded. Lazy loading defers media loading until after the first page render.

For best page load performance, only Below The Fold (btf) media should be lazy loaded. Below The Fold means the part of the page that is not visible on first page load, prior to any scrolling.

Google Page Speed Insights (PSI) will rightly complain if media atf are lazy loaded, and also if media btf are not lazy loaded.

In version 5.7.0, WordPress added a feature that automatically adds the loading=”lazy” attribute to media it considers to be btf. What it considers btf basically means everything after the 3rd media component irrespective of page design.

Divi’s Critical CSS feature attempts to do a better job of determining the fold by analysing the raw page modules’ shortcodes.
Divi offers different threshold settings of where it considers The Fold to be. eg. ‘Low’, ‘Medium’ or ‘High’. (This setting is found in Divi Settings|Performance|Critical CSS Threshold.)

The exact position of The Fold however, depends on a few factors, perhaps the most obvious is the screen width. Divi’s analysis is approximate and is easily confused by the use of additional custom css.

How the Lazy-Load-Fix-for-Divi plugin works

This plugin allows the developer to determine the exact position of The Fold by manually setting it’s location for each page. You can do this after making a simple observation in a browser at the screen widths you want to optimise for.

For example, suppose you decide that you want to optimise for the following screen resolutions:

1200 x 834 - desktop 320 x 820 - mobile 

(these are the approximate resolutions that Google PSI uses)

Then, after completing your page design, inspect your page in a browser that is set to these dimensions(note 1) and identify the first Divi module that is btf.

To manually set the threshold, add one or more of the custom classes to the first Divi module btf.(note 2).

Allowed values are:

ww-btf-desktop ww-btf-mobile ww-btf-tablet (see note 3) 

All media items btf will be lazy-loaded, those atf won’t be.

Repeat in the same way to set up thresholds for each page you want to optimise for.

  • Note that ww-btf-tablet is not implemented in this version and will be treated as ww-btf-mobile

Notes

Note 1 — Set a browser to a specific resolution I suggest using Chrome with Developer Tools enabled (right click, select Inspect). Resizing the window with a mouse shows the window size next to the cursor.
Note 2 — Add a custom class to a Divi module Edit the module and select the Advanced tab and use CSS ID & Classes
Note 3 — Tablet devices are not implemented in this plugin version and will be treated as if they were ww-btf-mobile

Divi BUG

In addition, this plugin fixes a code bug in Divi relating to the lazy loading of images. (introduced in 4.5.2 and still present in 4.27.4)

The problem occurs in

Divi\includes\builder\core.php @ line #63 

– the remove_filter() call quietly fails because the priority is not specified. This bug results in the WordPress media counting logic to be run twice which defeats the lazy-load threshold when using Divi.
The WordPress function remove_filter() specifies parameter 3 as int $priority = 10. If the priority is not 10 (in this case it is actually 12), the remove_filter call fails.

I guess Elegant Themes’s priority are now with version 5 so this bug may not ever get fixed. If the bug ever gets fixed, this bugfix part of this plugin will have no effect.

This bugfix is distinct from and will work independently from the custom setting of the custom classes described above.

Note: I contacted Elegant Themes about the bug and was advised to use the plugin: “Disable Lazy Loading”
which does an excellent job of disabling ALL lazy loading.
In this case though, this is not the behaviour I want.

My motivation for writing this plugin is to improve the Google PSI score on Mobile and Desktop devices.

I welcome helpful comments and suggestions 🙂

This plugin will have no effect if used on Divi < 4.5 or on WordPress < 5.7.0

Schermafbeeldingen

  • Above The Fold image loading without plugin – Atf image being lazy loaded => BAD
  • Above The Fold image loading with plugin enabled – aft image not lazy loaded

Installatie

Lazy Load Fix For Divi just as you would any other WP Plugin:

  1. Download Lazy Load For Divi from WordPress.org.

  2. Unzip the .zip file.

  3. Upload the Plugin folder (lazy-load-fix-for-divi/) to the wp-content/plugins folder.

  4. Go to Plugins Admin Panel and find the newly uploaded Plugin, “Lazy Load Fix for Divi” in the list.

  5. Click Activate Plugin to activate it.

FAQ

Will this Plugin work on my WordPress.com website?

Sorry, this plugin is available for use only on self-hosted (WordPress.org) websites.

Can I use this plugin with the Divi Builder

This plugin has only been tested with the Divi Theme to date. It may work with Divi Builder using a different theme. Please do let me know how that goes 🙂

What Divi settings should I use

This is a performance tweak plugin. It is only effective if Divi’s performance options are ENABLED, and in particular Critical CSS must be ENABLED for this plugin to have any effect. (This is the Divi default)

Will this work on Divi 5?

No. Divi 4 only please.

How do I use this plugin?

Install and activate. Add custom classes as per description. That’s it!

How to uninstall the plugin?

Simply deactivate and delete the plugin. It will clean up nicely and leave no trace.

Beoordelingen

Er zijn geen beoordelingen voor deze plugin.

Bijdragers & ontwikkelaars

“Lazy Load Fix for Divi” is open source software. De volgende personen hebben bijgedragen aan deze plugin.

Bijdragers

Vertaal “Lazy Load Fix for Divi” in je eigen taal.

Interesse in ontwikkeling?

Bekijk de code, haal de SVN repository op, of abonneer je op het ontwikkellog via RSS.

Changelog

1.1.1

Tested up to 6.9

1.1

Added ability to set The Fold per page, per device

1.0

Inital Release – Divi bugfix only