Skip to content

Conversation

@abaicus
Copy link
Contributor

@abaicus abaicus commented Dec 11, 2025

All Submissions:

Changes proposed in this Pull Request:

Improves/implements third party background lazyload compatibilities for builder/block plugins, including:

  • Kadence Blocks;
  • Spectra Blocks;
  • Essential Blocks;
  • Elementor:
    • compatibility was deprecated because the main containers in Elementor were changed some time ago. We retain legacy compatibility and also fix the issue for newer versions;
    • moved the old Elementor selectors from the lazyload replacer class into the compatibility handler;
  • Beaver Builder:
    • Here we were missing compatibility with their Box element, which acts like a container in the Beaver context. I believe this too was changed at some point;

Closes Codeinwp/optimole-service#1602.

How to test the changes in this Pull Request:

  • Install the specified plugin.
  • Make sure you have background lazyloading enabled in Optimole and have the Skip first x images option set to 0.
  • For each builder/plugin:
    1. Create a new page that has elements with image backgrounds - sections/containers/rows would be the ones that are most probable to support backgrounds usually.
    2. Add a large spacer at the top (~2000px should be good enough) to make sure that the content goes out of screen.
    3. Visit the page in incognito - the backgrounds should be lazy-loaded.
    4. You can test that things are working by keeping the inspector open on the Network tab, filter by Img and reload the page - the images should not be loaded until you scroll down.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@pirate-bot
Copy link
Collaborator

pirate-bot commented Dec 11, 2025

Plugin build for 85d56e1 is ready 🛎️!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants