| Server IP : 62.60.133.156 / Your IP : 216.73.217.51 Web Server : LiteSpeed System : Linux linux24.centraldnserver.com 4.18.0-553.141.2.lve.el8.x86_64 #1 SMP Wed Jul 8 16:10:02 UTC 2026 x86_64 User : mimradmin ( 1166) PHP Version : 7.4.33 Disable Function : show_source, system, shell_exec, passthru, exec, popen, proc_open MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/mimradmin/www/wp-content/plugins/wp-rocket/inc/Engine/Media/Lazyload/ |
Upload File : |
<?php
declare(strict_types=1);
namespace WP_Rocket\Engine\Media\Lazyload;
trait CanLazyloadTrait {
/**
* Checks if lazyload should be applied
*
* @since 3.3
*
* @return bool
*/
protected function should_lazyload() {
if (
rocket_get_constant( 'REST_REQUEST', false )
||
rocket_get_constant( 'DONOTLAZYLOAD', false )
||
rocket_get_constant( 'DONOTROCKETOPTIMIZE', false )
||
rocket_get_constant( 'DONOTCACHEPAGE', false )
) {
return false;
}
if (
is_admin()
||
is_feed()
||
is_preview()
) {
return false;
}
if (
is_search()
&&
// This filter is documented in inc/classes/Buffer/class-tests.php.
! (bool) apply_filters( 'rocket_cache_search', false )
) {
return false;
}
// Exclude Page Builders editors.
$excluded_parameters = [
'fl_builder',
'et_fb',
'ct_builder',
];
foreach ( $excluded_parameters as $excluded ) {
if ( isset( $_GET[ $excluded ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
return false;
}
}
return true;
}
}