Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| PerformanceFeature | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
| initialize | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace NewfoldLabs\WP\Module\Performance; |
| 4 | |
| 5 | use function NewfoldLabs\WP\ModuleLoader\container as getContainer; |
| 6 | |
| 7 | /** |
| 8 | * Set up the performance feature. |
| 9 | */ |
| 10 | class PerformanceFeature extends \NewfoldLabs\WP\Module\Features\Feature { |
| 11 | |
| 12 | /** |
| 13 | * The feature name. |
| 14 | * |
| 15 | * @var string |
| 16 | */ |
| 17 | protected $name = 'performance'; |
| 18 | |
| 19 | /** |
| 20 | * The feature value. Defaults to on. |
| 21 | * |
| 22 | * @var boolean |
| 23 | */ |
| 24 | protected $value = true; // default to on |
| 25 | |
| 26 | /** |
| 27 | * Initialize performance feature. |
| 28 | */ |
| 29 | public function initialize() { |
| 30 | if ( function_exists( 'add_action' ) ) { |
| 31 | // Register module |
| 32 | add_action( |
| 33 | 'plugins_loaded', |
| 34 | function () { |
| 35 | new Performance( getContainer() ); |
| 36 | } |
| 37 | ); |
| 38 | } |
| 39 | } |
| 40 | } |