# depicter/1.3.2/app/src/Controllers/Ajax/PluginDeactivationController.php

Depicter — Popup &amp; Slider Builder, version 1.3.2. 47 lines.

- Page: https://pluginprobe.com/plugins/depicter/1.3.2/code/app/src/Controllers/Ajax/PluginDeactivationController.php
- Raw: https://pluginprobe.com/plugins/depicter/1.3.2/raw/app/src/Controllers/Ajax/PluginDeactivationController.php
- Modified: 2022-06-01T06:26:20+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/depicter/1.3.2/code/app/src/Controllers/Ajax/PluginDeactivationController.php#L10-L20`.

```php
<?php
namespace Depicter\Controllers\Ajax;

use Depicter\GuzzleHttp\Exception\GuzzleException;
use Psr\Http\Message\ResponseInterface;

class PluginDeactivationController
{
	/**
	 * Send deactivation feedback
	 *
	 * @return ResponseInterface
	 */
	public function sendFeedback(){

		if ( empty( $_POST['issueRelatesTo'] ) ) {
			return \Depicter::json([
				'errors'   => "Empty deactivation reason"
			])->withStatus(400 );
		}

		$feedback = [
			'issueType'         => 'deactivation',
			'issueRelatesTo'    => sanitize_text_field( $_POST['issueRelatesTo'] ),
			'userDescription'   => !empty( $_POST['userDescription'] ) ? sanitize_text_field( $_POST['userDescription'] ) : ''
		];

		try {
			if ( \Depicter::deactivationFeedback()->sendFeedback( $feedback ) ) {
				return \Depicter::json([
					"hits" => 1,
					'message'   => "Feedback has been sent successfully"
				])->withStatus(200 );
			} else {
				return \Depicter::json([
					'errors'   => "Error while sending feedback, please try again later"
				])->withStatus(400 );
			}
		} catch( GuzzleException $e ) {
			return \Depicter::json([
               'errors'   => "Error while sending feedback, connection error..."
            ])->withStatus(400 );
		}

	}
}

```
