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