| 1 |
<?php |
| 2 |
|
| 3 |
namespace ImageOptimization\Modules\Oauth; |
| 4 |
|
| 5 |
use ImageOptimization\Classes\Module_Base; |
| 6 |
|
| 7 |
if ( ! defined( 'ABSPATH' ) ) { |
| 8 |
exit; // Exit if accessed directly. |
| 9 |
} |
| 10 |
|
| 11 |
/** |
| 12 |
* Class Module |
| 13 |
*/ |
| 14 |
class Module extends Module_Base { |
| 15 |
/** |
| 16 |
* Get module name. |
| 17 |
* Retrieve the module name. |
| 18 |
* @access public |
| 19 |
* @return string Module name. |
| 20 |
*/ |
| 21 |
public function get_name(): string { |
| 22 |
return 'oauth'; |
| 23 |
} |
| 24 |
|
| 25 |
public static function routes_list() : array { |
| 26 |
return [ |
| 27 |
'Connect_Init', |
| 28 |
'Disconnect', |
| 29 |
'Get_Subscriptions', |
| 30 |
'Activate', |
| 31 |
'Deactivate', |
| 32 |
'Version', |
| 33 |
]; |
| 34 |
} |
| 35 |
|
| 36 |
public static function component_list() : array { |
| 37 |
return [ |
| 38 |
'Connect', |
| 39 |
'Checkpoint', |
| 40 |
'Connect_Pointer', |
| 41 |
]; |
| 42 |
} |
| 43 |
|
| 44 |
public static function is_active() : bool { |
| 45 |
return ! empty( get_option( 'image_optimizer_client_data' ) ); |
| 46 |
} |
| 47 |
|
| 48 |
public function __construct() { |
| 49 |
|
| 50 |
$this->register_components(); |
| 51 |
$this->register_routes(); |
| 52 |
} |
| 53 |
} |
| 54 |
|