# image-optimization/1.5.4/modules/oauth/rest/version.php

Image Optimizer – Compress Images and Convert to WebP or AVIF, version 1.5.4. 36 lines.

- Page: https://pluginprobe.com/plugins/image-optimization/1.5.4/code/modules/oauth/rest/version.php
- Raw: https://pluginprobe.com/plugins/image-optimization/1.5.4/raw/modules/oauth/rest/version.php
- Modified: 2024-06-26T13:37:14+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/image-optimization/1.5.4/code/modules/oauth/rest/version.php#L10-L20`.

```php
<?php

namespace ImageOptimization\Modules\Oauth\Rest;

use ImageOptimization\Modules\Oauth\{
	Classes\Route_Base,
	Components\Connect,
};

use Throwable;
use WP_REST_Request;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

class Version extends Route_Base {
	const NONCE_NAME = 'image-optimization-version';

	protected string $path = 'version';

	public function get_name(): string {
		return 'version';
	}

	public function get_methods(): array {
		return [ 'GET' ];
	}

	public function GET( WP_REST_Request $request ) {
		return $this->respond_success_json( [
			'version' => 1,
		] );
	}
}

```
