Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions inc/compatibilities/beaver_builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public function register() {
function ( $all_watchers ) {
$all_watchers[] = '.fl-col-content';
$all_watchers[] = '.fl-row-bg-photo > .fl-row-content-wrap';
$all_watchers[] = '.fl-module-box';

return $all_watchers;
}
Expand Down
5 changes: 5 additions & 0 deletions inc/compatibilities/elementor_builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ public function register() {
function ( $all_watchers ) {
$all_watchers[] = '.elementor-widget-container';
$all_watchers[] = '.elementor-background-slideshow__slide__image';
$all_watchers[] = '.elementor-section[data-settings*="background_background"]';
$all_watchers[] = '.elementor-column[data-settings*="background_background"] > .elementor-widget-wrap';
$all_watchers[] = '.elementor-element[data-settings*="background_background"]';
$all_watchers[] = '.elementor-section > .elementor-background-overlay';

return $all_watchers;
}
);
Expand Down
37 changes: 37 additions & 0 deletions inc/compatibilities/essential_blocks.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

/**
* Class Optml_essential_blocks
*
* @reason Adding selectors for background lazyload
*/
class Optml_essential_blocks extends Optml_compatibility {

/**
* Should we load the integration logic.
*
* @return bool Should we load.
*/
public function should_load() {
include_once ABSPATH . 'wp-admin/includes/plugin.php';

return is_plugin_active( 'essential-blocks/essential-blocks.php' );
}

/**
* Register integration details.
*
* @return void
*/
public function register() {
add_filter(
'optml_lazyload_bg_selectors',
function ( $all_watchers ) {
// Class starts with `eb-` and ends with `-container`
$all_watchers[] = '[class^="eb-"][class*="-container"]';

return $all_watchers;
}
);
}
}
39 changes: 39 additions & 0 deletions inc/compatibilities/kadence_blocks.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

/**
* Class Optml_kadence_blocks.
*
* @reason @reason Adding selectors for background lazyload
*/
class Optml_kadence_blocks extends Optml_compatibility {


/**
* Should we load the integration logic.
*
* @return bool Should we load.
*/
public function should_load() {
include_once ABSPATH . 'wp-admin/includes/plugin.php';

return is_plugin_active( 'kadence-blocks/kadence-blocks.php' );
}

/**
* Register integration details.
*
* @return void
*/
public function register() {
add_filter(
'optml_lazyload_bg_selectors',
function ( $all_watchers ) {
$all_watchers[] = '.kt-row-has-bg';
$all_watchers[] = '.kt-row-layout-overlay';
$all_watchers[] = '.kt-inside-inner-col';

return $all_watchers;
}
);
}
}
12 changes: 11 additions & 1 deletion inc/compatibilities/spectra.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,24 @@ class Optml_spectra extends Optml_compatibility {
*/
public function should_load() {
include_once ABSPATH . 'wp-admin/includes/plugin.php';
return is_plugin_active( 'ultimate-addons-for-gutenberg/ultimate-addons-for-gutenberg.php' ) && 'enabled' === get_option( '_uagb_allow_file_generation', 'enabled' );

return is_plugin_active( 'ultimate-addons-for-gutenberg/ultimate-addons-for-gutenberg.php' );
}

/**
* Register integration details.
*/
public function register() {
add_filter( 'uagb_block_attributes_for_css_and_js', [ $this, 'optimize_src' ], PHP_INT_MAX, 2 );

add_filter(
'optml_lazyload_bg_selectors',
function ( $all_watchers ) {
$all_watchers[] = '.wp-block-uagb-container';

return $all_watchers;
}
);
}

/**
Expand Down
3 changes: 0 additions & 3 deletions inc/lazyload_replacer.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,6 @@ public static function get_background_lazyload_selectors() {
return self::$background_lazyload_selectors;
}
$default_watchers = [
'.elementor-section[data-settings*="background_background"]',
'.elementor-column[data-settings*="background_background"] > .elementor-widget-wrap',
'.elementor-section > .elementor-background-overlay',
'[class*="wp-block-cover"][style*="background-image"]',
'[style*="background-image:url("]', '[style*="background-image: url("]',
'[style*="background:url("]', '[style*="background: url("]',
Expand Down
2 changes: 2 additions & 0 deletions inc/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ final class Optml_Manager {
* @var array Integrations classes.
*/
private $possible_compatibilities = [
'kadence_blocks',
'essential_blocks',
'shortcode_ultimate',
'foogallery',
'envira',
Expand Down
Loading