# image-optimization/1.7.4/modules/reviews/classes/feedback-handler.php

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

- Page: https://pluginprobe.com/plugins/image-optimization/1.7.4/code/modules/reviews/classes/feedback-handler.php
- Raw: https://pluginprobe.com/plugins/image-optimization/1.7.4/raw/modules/reviews/classes/feedback-handler.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/feedback-handler.php#L10-L20`.

```php
<?php

namespace ImageOptimization\Modules\Reviews\Classes;

use Exception;
use ImageOptimization\Classes\Utils;

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

/**
 * Feedback_Handler
 *
 * Class to post feedback
 */
class Feedback_Handler {

	const SERVICE_ENDPOINT = 'feedback/reviews';

	/**
	 * Send request to the service to submit the feedback.
	 *
	 * @param $params
	 *
	 * @return string
	 * @throws Exception
	 */
	public static function post_feedback( $params ) {
		$response = Utils::get_api_client()->make_request(
			'POST',
			self::SERVICE_ENDPOINT,
			$params
		);

		if ( empty( $response ) || is_wp_error( $response ) ) {
			throw new Exception( 'Failed to add the feedback.' );
		}

		return $response;
	}
}

```
