| 1 |
<?php |
| 2 |
namespace Elementor\Core\Frontend; |
| 3 |
|
| 4 |
use Elementor\Plugin; |
| 5 |
|
| 6 |
class Performance { |
| 7 |
|
| 8 |
private static $use_style_controls = false; |
| 9 |
|
| 10 |
private static $is_frontend = null; |
| 11 |
|
| 12 |
public static function set_use_style_controls( bool $is_use ): void { |
| 13 |
static::$use_style_controls = $is_use; |
| 14 |
} |
| 15 |
|
| 16 |
public static function is_use_style_controls(): bool { |
| 17 |
return static::$use_style_controls; |
| 18 |
} |
| 19 |
|
| 20 |
public static function should_optimize_controls() { |
| 21 |
if ( null === static::$is_frontend ) { |
| 22 |
static::$is_frontend = ( |
| 23 |
! is_admin() |
| 24 |
&& ! Plugin::$instance->preview->is_preview_mode() |
| 25 |
&& ! defined( 'REST_REQUEST' ) |
| 26 |
); |
| 27 |
} |
| 28 |
|
| 29 |
return static::$is_frontend; |
| 30 |
} |
| 31 |
} |
| 32 |
|