| 1 |
<?php |
| 2 |
namespace ImageOptimization\Modules\ConnectManager\Classes; |
| 3 |
|
| 4 |
use ImageOptimization\Modules\ConnectManager\Components\Connect_Interface; |
| 5 |
|
| 6 |
if ( ! defined( 'ABSPATH' ) ) { |
| 7 |
exit; // exit if accessed directly |
| 8 |
} |
| 9 |
|
| 10 |
class Connect_Runner { |
| 11 |
public $connect; |
| 12 |
|
| 13 |
public function __construct( Connect_Interface $connect ) { |
| 14 |
$this->connect = $connect; |
| 15 |
} |
| 16 |
|
| 17 |
public function is_connected() { |
| 18 |
return $this->connect->is_connected(); |
| 19 |
} |
| 20 |
|
| 21 |
public function is_activated() : bool { |
| 22 |
return $this->connect->is_activated(); |
| 23 |
} |
| 24 |
|
| 25 |
public function is_valid_home_url() : bool { |
| 26 |
return $this->connect->is_valid_home_url(); |
| 27 |
} |
| 28 |
|
| 29 |
public function get_connect_status() { |
| 30 |
return $this->connect->get_connect_status(); |
| 31 |
} |
| 32 |
|
| 33 |
public function get_connect_data( bool $force = false ): array { |
| 34 |
return $this->connect->get_connect_data( $force ); |
| 35 |
} |
| 36 |
|
| 37 |
public function update_usage_data( $new_usage_data ): void { |
| 38 |
$this->connect->update_usage_data( $new_usage_data ); |
| 39 |
} |
| 40 |
|
| 41 |
public function get_activation_state() : string { |
| 42 |
return $this->connect->get_activation_state(); |
| 43 |
} |
| 44 |
|
| 45 |
public function get_access_token() { |
| 46 |
return $this->connect->get_access_token(); |
| 47 |
} |
| 48 |
|
| 49 |
public function get_client_id(): string { |
| 50 |
return $this->connect->get_client_id(); |
| 51 |
} |
| 52 |
|
| 53 |
public function get_client_secret(): string { |
| 54 |
return $this->connect->get_client_secret(); |
| 55 |
} |
| 56 |
|
| 57 |
public function images_left(): int { |
| 58 |
return $this->connect->images_left(); |
| 59 |
} |
| 60 |
|
| 61 |
public function user_is_subscription_owner(): bool { |
| 62 |
return $this->connect->user_is_subscription_owner(); |
| 63 |
} |
| 64 |
|
| 65 |
// Legacy Nonces. |
| 66 |
|
| 67 |
public function connect_init_nonce(): string { |
| 68 |
return $this->connect->connect_init_nonce(); |
| 69 |
} |
| 70 |
|
| 71 |
public function disconnect_nonce(): string { |
| 72 |
return $this->connect->disconnect_nonce(); |
| 73 |
} |
| 74 |
|
| 75 |
public function deactivate_nonce(): string { |
| 76 |
return $this->connect->deactivate_nonce(); |
| 77 |
} |
| 78 |
|
| 79 |
public function get_subscriptions_nonce(): string { |
| 80 |
return $this->connect->get_subscriptions_nonce(); |
| 81 |
} |
| 82 |
|
| 83 |
public function activate_nonce(): string { |
| 84 |
return $this->connect->activate_nonce(); |
| 85 |
} |
| 86 |
|
| 87 |
public function version_nonce(): string { |
| 88 |
return $this->connect->version_nonce(); |
| 89 |
} |
| 90 |
|
| 91 |
public function get_is_connect_on_fly(): bool { |
| 92 |
return $this->connect->get_is_connect_on_fly(); |
| 93 |
} |
| 94 |
|
| 95 |
public function refresh_token(): void { |
| 96 |
$this->connect->refresh_token(); |
| 97 |
} |
| 98 |
} |
| 99 |
|