# image-optimization/1.7.4/modules/reviews/classes/route-base.php

Image Optimizer – Compress Images and Convert to WebP or AVIF, version 1.7.4. 40 lines.

- Page: https://pluginprobe.com/plugins/image-optimization/1.7.4/code/modules/reviews/classes/route-base.php
- Raw: https://pluginprobe.com/plugins/image-optimization/1.7.4/raw/modules/reviews/classes/route-base.php
- Modified: 2025-09-11T08:55:06+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.7.4/code/modules/reviews/classes/route-base.php#L10-L20`.

```php
<?php

namespace ImageOptimization\Modules\Reviews\Classes;

use ImageOptimization\Classes\Rest\Route;

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

/**
 * Class Route_Base
 */
class Route_Base extends Route {
	protected bool $override = false;
	protected $auth = true;
	protected string $path = '';
	public function get_methods(): array {
		return [];
	}

	public function get_endpoint(): string {
		return 'reviews/' . $this->get_path();
	}

	public function get_path(): string {
		return $this->path;
	}

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

	public function get_permission_callback( \WP_REST_Request $request ): bool {
		$valid = $this->permission_callback( $request );

		return $valid && user_can( $this->current_user_id, 'manage_options' );
	}
}

```
