PluginProbe
Image Optimization – Compress Images and Convert to WebP or AVIF / 1.6.6
Image Optimization – Compress Images and Convert to WebP or AVIF v1.6.6
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 1.6.6 All 32 releases
image-optimization / modules / connect / rest / deactivate.php

deactivate.php in Image Optimization – Compress Images and Convert to WebP or AVIF 1.6.6, at modules/connect/rest/deactivate.php

44 lines 761 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ImageOptimization\Modules\Connect\Rest;
4
5 use ImageOptimization\Modules\Connect\Classes\{
6 Data,
7 Route_Base,
8 Service
9 };
10 use Throwable;
11
12 if ( ! defined( 'ABSPATH' ) ) {
13 exit; // Exit if accessed directly
14 }
15
16 /**
17 * Class Deactivate
18 */
19 class Deactivate extends Route_Base {
20 public string $path = 'deactivate';
21
22 public function get_methods(): array {
23 return [ 'POST' ];
24 }
25
26 public function get_name(): string {
27 return 'deactivate';
28 }
29
30 public function POST() {
31 try {
32 Service::deactivate_license();
33
34 return $this->respond_success_json();
35 } catch ( Throwable $t ) {
36 Data::ensure_reset_connect();
37 return $this->respond_error_json( [
38 'message' => $t->getMessage(),
39 'code' => 'internal_server_error',
40 ] );
41 }
42 }
43 }
44