PluginProbe
Image Optimizer – Compress Images and Convert to WebP or AVIF / 1.6.3
Image Optimizer – Compress Images and Convert to WebP or AVIF v1.6.3
1.7.7 1.7.6 1.7.5 1.7.4 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 All 33 releases
image-optimization / modules / connect-manager / components / legacy-connect.php

legacy-connect.php in Image Optimizer – Compress Images and Convert to WebP or AVIF 1.6.3, at modules/connect-manager/components/legacy-connect.php

103 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace ImageOptimization\Modules\ConnectManager\Components;
3
4 use ImageOptimization\Modules\Oauth\{
5 Components\Connect,
6 Classes\Data,
7 Rest\Activate,
8 Rest\Connect_Init,
9 Rest\Deactivate,
10 Rest\Disconnect,
11 Rest\Get_Subscriptions,
12 Rest\Version,
13 };
14
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit; // exit if accessed directly
17 }
18
19 class Legacy_Connect implements Connect_Interface {
20
21 public function is_connected() : bool {
22 return Connect::is_connected();
23 }
24
25 public function is_activated() : bool {
26 return Connect::is_activated();
27 }
28
29 public function is_valid_home_url() : bool {
30 return true;
31 }
32
33 public function get_connect_status() {
34 return Connect::get_connect_status();
35 }
36
37 public function get_connect_data( bool $force = false ): array {
38 return Data::get_connect_data( $force );
39 }
40
41 public function update_usage_data( $new_usage_data ): void {
42 Connect::update_usage_data( $new_usage_data );
43 }
44
45 public function get_activation_state() : string {
46 return Data::get_activation_state();
47 }
48
49 public function get_access_token() {
50 return Data::get_access_token();
51 }
52
53 public function get_client_id(): string {
54 return Data::get_client_id();
55 }
56
57 public function get_client_secret(): string {
58 return Data::get_client_secret();
59 }
60
61 public function images_left(): int {
62 return Data::images_left();
63 }
64
65 public function user_is_subscription_owner(): bool {
66 return Data::user_is_subscription_owner();
67 }
68
69 // Legacy Nonces.
70
71 public function connect_init_nonce(): string {
72 return Connect_Init::NONCE_NAME;
73 }
74
75 public function disconnect_nonce(): string {
76 return Disconnect::NONCE_NAME;
77 }
78
79 public function deactivate_nonce(): string {
80 return Deactivate::NONCE_NAME;
81 }
82
83 public function get_subscriptions_nonce(): string {
84 return Get_Subscriptions::NONCE_NAME;
85 }
86
87 public function activate_nonce(): string {
88 return Activate::NONCE_NAME;
89 }
90
91 public function version_nonce(): string {
92 return Version::NONCE_NAME;
93 }
94
95 public function get_is_connect_on_fly(): bool {
96 return false;
97 }
98
99 // Placeholder function for legacy connect.
100 public function refresh_token(): void {
101 }
102 }
103