Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| Jetpack_Boost_Modules | |
0.00% |
0 / 5 |
|
0.00% |
0 / 3 |
20 | |
0.00% |
0 / 1 |
| init | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
| get_ready_active_optimization_modules | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| have_enabled_modules | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName |
| 2 | |
| 3 | /** |
| 4 | * Jetpack Boost Active Modules |
| 5 | * |
| 6 | * Since the speed scores API will be used in the Jetpack plugin and in the My Jetpack, if Jetpack Boost |
| 7 | * is uninstalled, all we need is to pass along this placeholder class for the modules that essentially |
| 8 | * tells the API the user doesn't have any Boost modules active. |
| 9 | * |
| 10 | * @package automattic/jetpack/boost_speed_score |
| 11 | */ |
| 12 | namespace Automattic\Jetpack\Boost_Speed_Score; |
| 13 | |
| 14 | /** |
| 15 | * Jetpack Boost Modules |
| 16 | */ |
| 17 | class Jetpack_Boost_Modules { |
| 18 | |
| 19 | /** |
| 20 | * Holds the singleton instance of the class |
| 21 | * |
| 22 | * @var Jetpack_Boost_Modules |
| 23 | */ |
| 24 | private static $instance = false; |
| 25 | |
| 26 | /** |
| 27 | * Singleton |
| 28 | * |
| 29 | * @static |
| 30 | * @return Jetpack_Boost_Modules |
| 31 | */ |
| 32 | public static function init() { |
| 33 | if ( ! self::$instance ) { |
| 34 | self::$instance = new Jetpack_Boost_Modules(); |
| 35 | } |
| 36 | |
| 37 | return self::$instance; |
| 38 | } |
| 39 | /** |
| 40 | * Returns status of all active boost modules that are also ready |
| 41 | * |
| 42 | * @return array - An empty array. The user will never have active modules when using the Boost Score API |
| 43 | */ |
| 44 | public function get_ready_active_optimization_modules() { |
| 45 | return array(); |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Returns whether or not the user has active modules |
| 50 | * |
| 51 | * @return false - The user will never have active modules when using the Boost Score API |
| 52 | */ |
| 53 | public function have_enabled_modules() { |
| 54 | return false; |
| 55 | } |
| 56 | } |