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