<?php
/**
 * Ungoupped snippets
 *
 * @author        Alexander Kovalev <alex.kovalevv@gmail.com>
 * @copyright (c) 14.11.2019, Webcraftic
 * @version       1.0
 */

add_action( 'plugins_loaded', function () {
	if ( defined( 'WCL_PLUGIN_ACTIVE' ) && version_compare( WCL_PLUGIN_VERSION, '1.6.1', '<' ) ) {
		$clearfy_compat_func = function () {
			$error = __( 'Premium package for Clearfy requires the installation of the free version 1.6.1 or higher. Please update the Clearfy plugin to version 1.6.1 or higher to continue.', 'clearfy' );
			echo '<div class="notice notice-error"><p>' . $error . '</p></div>';
		};

		add_action( 'admin_notices', $clearfy_compat_func );
		add_action( 'network_admin_notices', $clearfy_compat_func );
	}
} );