PluginProbe
Image Optimizer – Compress Images and Convert to WebP or AVIF / 1.7.7
Image Optimizer – Compress Images and Convert to WebP or AVIF v1.7.7
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 / oauth / rest / version.php

version.php in Image Optimizer – Compress Images and Convert to WebP or AVIF 1.7.7, at modules/oauth/rest/version.php

40 lines 666 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\Oauth\Rest;
4
5 use ImageOptimization\Modules\Oauth\{
6 Classes\Route_Base,
7 };
8
9 use WP_REST_Request;
10
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit; // Exit if accessed directly.
13 }
14
15 class Version extends Route_Base {
16 const NONCE_NAME = 'image-optimization-version';
17
18 protected string $path = 'version';
19
20 public function get_name(): string {
21 return 'version';
22 }
23
24 public function get_methods(): array {
25 return [ 'GET' ];
26 }
27
28 public function GET( WP_REST_Request $request ) {
29 $error = $this->verify_capability();
30
31 if ( $error ) {
32 return $error;
33 }
34
35 return $this->respond_success_json( [
36 'version' => 1,
37 ] );
38 }
39 }
40