Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
6 / 6 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| PrioritizeCssHealthCheck | |
100.00% |
6 / 6 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
1 | |||
| test | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace NewfoldLabs\WP\Module\Performance\HealthChecks; |
| 4 | |
| 5 | /** |
| 6 | * Health check for critical CSS prioritization. |
| 7 | */ |
| 8 | class PrioritizeCssHealthCheck extends HealthCheck { |
| 9 | /** |
| 10 | * Constructor. |
| 11 | */ |
| 12 | public function __construct() { |
| 13 | $this->id = 'newfold-prioritize-critical-css'; |
| 14 | $this->title = esc_html__( 'Prioritize Critical CSS', 'wp-module-performance' ); |
| 15 | $this->passing_text = esc_html__( 'Critical CSS is prioritized', 'wp-module-performance' ); |
| 16 | $this->failing_text = esc_html__( 'Critical CSS is not prioritized', 'wp-module-performance' ); |
| 17 | $this->description = esc_html__( 'Prioritizing critical CSS can improve performance by loading the most important CSS first.', 'wp-module-performance' ); |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * Test if critical CSS is prioritized. |
| 22 | * |
| 23 | * @return bool |
| 24 | */ |
| 25 | public function test() { |
| 26 | return get_option( 'jetpack_boost_status_critical-css', false ); |
| 27 | } |
| 28 | } |