<?php
/**
* Plugin Name: Clever Fox
* Description: Clever Fox plugin to enhance the functionality for free themes made by Nayra Themes. More than 60000+ trusted websites with Nayra Themes. It provides intuitive features to your website. 45+ Themes compatible with Clever Fox. See below free themes listed here. Avril, Gradiant, Flavita, Fiona Blog, MetaSoft, Conceptly & ColorPress is one of highest installations themes in our collections. Visit our website and find theme as you need. https://www.nayrathemes.com/themes/
* Version: 29.8
* Author: nayrathemes
* Author URI: https://nayrathemes.com
* Requires at least : 4.6 or higher
* License:	GPLv3 or later
* License URI:	http://www.gnu.org/licenses/gpl-3.0.html
* Text Domain:	clever-fox
* Requires PHP: 7.4
*/

if ( ! defined( 'ABSPATH' ) ) exit;

define( 'CLEVERFOX_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'CLEVERFOX_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'CLEVERFOX_FOOTER_ABOUT', 'There are many variations of dummy passages of Lorem Ipsum a available, but the majority have suffered that is alteration in some that form  injected humour or randomised' );

function cleverfox_activate() {
	
	/**
	 * Load Custom control in Customizer
	 */
	define( 'CLEVERFOX_DIRECTORY', plugin_dir_url( __FILE__ ) . '/inc/custom-controls/' );
	define( 'CLEVERFOX_DIRECTORY_URI', plugin_dir_url( __FILE__ ) . '/inc/custom-controls/' );
	if ( class_exists( 'WP_Customize_Control' ) ) {
		require_once('inc/custom-controls/controls/range-validator/range-control.php');	
		require_once CLEVERFOX_PLUGIN_DIR . 'inc/upgrade/init.php';
	}
	
	$cleverfox_theme = wp_get_theme(); // gets the current theme
		if ( 'StartKit' == $cleverfox_theme->name){	
			require_once('inc/startkit/startkit.php');
		}
		
		if ( 'StartBiz' == $cleverfox_theme->name){	
			require_once('inc/startbiz/startbiz.php');
		}
		
		if ('Arowana' == $cleverfox_theme->name){	
			 require_once('inc/arowana/arowana.php');
		}
		
		if ('Envira' == $cleverfox_theme->name){	
			 require_once('inc/envira/envira.php');			
		}
		
		if( 'Hantus' == $cleverfox_theme->name){
			require_once('inc/hantus/hantus.php');	
		}
		
		if( 'Thai Spa' == $cleverfox_theme->name){
			require_once('inc/thai-spa/thai-spa.php');	
		}
		
		if( 'Conceptly' == $cleverfox_theme->name){
			require_once('inc/conceptly/conceptly.php');
		}
		
		if( 'Ameya' == $cleverfox_theme->name){
			require_once('inc/ameya/ameya.php');
		}
		
		if( 'Azwa' == $cleverfox_theme->name){
			require_once('inc/azwa/azwa.php');
		}
		
		if( 'Avril' == $cleverfox_theme->name){
			require_once('inc/avril/avril.php');
		}
		
		if( 'Aera' == $cleverfox_theme->name){
			require_once('inc/aera/aera.php');
		}
		
		if( 'Avail' == $cleverfox_theme->name){
			require_once('inc/avail/avail.php');
		}
		
		if( 'Avtari' == $cleverfox_theme->name){
			require_once('inc/avtari/avtari.php');
		}
		
		if( 'Fiona Blog' == $cleverfox_theme->name){
			require_once('inc/fiona-blog/fiona-blog.php');
		}
		
		if( 'MetaSoft' == $cleverfox_theme->name ){
			require_once('inc/metasoft/metasoft.php');
		}
		
		if( 'Belltech' == $cleverfox_theme->name){
			require_once('inc/belltech/belltech.php');
		}
		
		if( 'Fiona Food' == $cleverfox_theme->name){
			require_once('inc/fiona-food/fiona-food.php');
		}
		
		if( 'Fiona News' == $cleverfox_theme->name){
			require_once('inc/fiona-news/fiona-news.php');
		}
		
		if( 'Axtia' == $cleverfox_theme->name){
			require_once('inc/axtria/axtria.php');
		}
		
		if( 'Aravalli' == $cleverfox_theme->name){
			require_once('inc/aravalli/aravalli.php');
		}
		
		if( 'Arbuda' == $cleverfox_theme->name){
			require_once('inc/arbuda/arbuda.php');
		}
		
		if( 'Boostify' == $cleverfox_theme->name){
			require_once('inc/boostify/boostify.php');
		}
		
		if( 'Gradiant' == $cleverfox_theme->name){
			require_once('inc/gradiant/gradiant.php');
			}
		
		if( 'Aviser' == $cleverfox_theme->name){
			require_once('inc/aviser/aviser.php');
		}
		
		if( 'Comoxa' == $cleverfox_theme->name){
			require_once('inc/comoxa/comoxa.php');
		}
		
		if( 'Techine' == $cleverfox_theme->name){
			require_once('inc/techine/techine.php');
		}
		
		if( 'ColorPress' == $cleverfox_theme->name){
			require_once('inc/colorpress/colorpress.php');
		}
		
		if( 'Flavita' == $cleverfox_theme->name){
			require_once('inc/flavita/flavita.php');
		}
		
		if( 'Avitech' == $cleverfox_theme->name){
			require_once('inc/avitech/avitech.php');
		}
		
		if( 'Colorsy' == $cleverfox_theme->name){
			require_once('inc/colorsy/colorsy.php');
		}
		
		if( 'Ampark' == $cleverfox_theme->name){
			require_once('inc/ampark/ampark.php');
		}
		
		if( 'Eduvert' == $cleverfox_theme->name){
			require_once('inc/eduvert/eduvert.php');
		}
		
		if( 'Varuda' == $cleverfox_theme->name){
			require_once('inc/varuda/varuda.php');
		}
		
		if( 'Cosmics' == $cleverfox_theme->name){
			require_once('inc/cosmics/cosmics.php');
		}
		
		if( 'StartWeb' == $cleverfox_theme->name){
			require_once('inc/startweb/startweb.php');
		}
		
		if( 'Appointo' == $cleverfox_theme->name){
			require_once('inc/appointo/appointo.php');
		}
		
		if( 'Renoval' == $cleverfox_theme->name){
			require_once('inc/renoval/renoval.php');
		}
		
		if( 'Builderse' == $cleverfox_theme->name){
			require_once('inc/builderse/builderse.php');
		}
		
		if( 'Eractor' == $cleverfox_theme->name){
			require_once('inc/eractor/eractor.php');
		}
		
		if( 'Medazin' == $cleverfox_theme->name){
			require_once('inc/medazin/medazin.php');
		}
		
		if( 'Medisafe' == $cleverfox_theme->name){
			require_once('inc/medisafe/medisafe.php');
		}
		
		if( 'TimeBlog' == $cleverfox_theme->name){
			require_once('inc/timeblog/timeblog.php');
		}		
		
		if( 'Convo' == $cleverfox_theme->name){
			require_once('inc/convo/convo.php');
		}
		
		if( 'Avenza' == $cleverfox_theme->name){
			require_once('inc/avenza/avenza.php');
		}
		
		if( 'CardioPress' == $cleverfox_theme->name){
			require_once('inc/cardiopress/cardiopress.php');
		}
		
		if( 'DoctorHub' == $cleverfox_theme->name){
			require_once('inc/doctorhub/doctorhub.php');
		}
		
		if( 'Accron' == $cleverfox_theme->name){
			require_once('inc/accron/accron.php');
		}
		
		if( 'Acronix' == $cleverfox_theme->name){
			require_once('inc/acronix/acronix.php');
		}
		
		if( 'Evita' == $cleverfox_theme->name){
			require_once('inc/evita/evita.php');
		}
		
		if( 'Corpex' == $cleverfox_theme->name){
			require_once('inc/corpex/corpex.php');
		}
		
		if( 'Cormex' == $cleverfox_theme->name){
			require_once('inc/cormex/cormex.php');
		}
		
		if( 'Profolio' == $cleverfox_theme->name){
			require_once('inc/profolio/profolio.php');
		}
		
		if( 'VillaPress' == $cleverfox_theme->name){
			require_once('inc/villapress/villapress.php');
		}
		
		if( 'NexCraft' == $cleverfox_theme->name){
			require_once('inc/nexcraft/nexcraft.php');
		}
		
		if( 'Evion' == $cleverfox_theme->name){
			require_once('inc/evion/evion.php');
		}
		
		if( 'Nexcraft BPO' == $cleverfox_theme->name){
			require_once('inc/nexcraft-bpo/nexcraft-bpo.php');
		}
		
		if( 'GradiantX' == $cleverfox_theme->name){
			require_once('inc/gradiantx/gradiantx.php');
		}
		
		if( 'ColorFlow' == $cleverfox_theme->name){
			require_once('inc/colorflow/colorflow.php');
		}
		
		if( 'Shadiant' == $cleverfox_theme->name){
			require_once('inc/shadiant/shadiant.php');
		}
		if( 'Webique' == $cleverfox_theme->name){
			require_once('inc/webique/webique.php');
		}
		if( 'Websy' == $cleverfox_theme->name){
			require_once('inc/websy/websy.php');
		}
		if( 'Webora' == $cleverfox_theme->name){
			require_once('inc/webora/webora.php');
		}
		if( 'WebAura' == $cleverfox_theme->name){
			require_once('inc/webaura/webaura.php');
		}
		if( 'News 25' == $cleverfox_theme->name){
			require_once('inc/news-25/news-25.php');
		}
		if( 'News25 Live' == $cleverfox_theme->name){
			require_once('inc/news25-live/news25-live.php');
		}
		if( 'News25 Prime' == $cleverfox_theme->name){
			require_once('inc/news25-prime/news25-prime.php');
		}
		if( 'News25 Breaking' == $cleverfox_theme->name){
			require_once('inc/news25-breaking/news25-breaking.php');
		}
		if( 'News25 Press' == $cleverfox_theme->name){
			require_once('inc/news25-press/news25-press.php');
		}
		if( 'News25 Headline' == $cleverfox_theme->name){
			require_once('inc/news25-headline/news25-headline.php');
		}
		if( 'Hotel 26' == $cleverfox_theme->name){
			require_once('inc/hotel-26/hotel-26.php');
		}
		if( 'Hotel Elegance' == $cleverfox_theme->name){
			require_once('inc/hotel-elegance/hotel-elegance.php');
		}
		if( 'Hotel Prime' == $cleverfox_theme->name){
			require_once('inc/hotel-prime/hotel-prime.php');
		}
	}
add_action( 'init', 'cleverfox_activate' );


$cleverfox_theme = wp_get_theme();

/**
 * Fiona Widgets
 */
if( 'Fiona Blog' == $cleverfox_theme->name || 'Fiona Food' == $cleverfox_theme->name || 'Fiona News' == $cleverfox_theme->name || 'TimeBlog' == $cleverfox_theme->name){
	require CLEVERFOX_PLUGIN_DIR . 'inc/fiona-blog/widgets/class-fiona-widgets.php';
}


/**
 * Gradiant Block
 */
if( 'Gradiant' == $cleverfox_theme->name  || 'Comoxa' == $cleverfox_theme->name  || 'ColorPress' == $cleverfox_theme->name  || 'Flavita' == $cleverfox_theme->name || 'GradiantX' == $cleverfox_theme->name || 'ColorFlow' == $cleverfox_theme->name || 'Shadiant' == $cleverfox_theme->name ){
	require CLEVERFOX_PLUGIN_DIR . '/inc/gradiant/block/info-box.php'; 
}



/**
 * Renoval Block
 */
if( 'Renoval' == $cleverfox_theme->name ){
	require CLEVERFOX_PLUGIN_DIR . '/inc/renoval/block/info-box.php'; 
}

/**
 * Webique Block
 */
if( 'Webique' == $cleverfox_theme->name ){
	require CLEVERFOX_PLUGIN_DIR . '/inc/webique/block/info-box.php'; 
}

/**
 * Profolio
 */
if( 'Profolio' == $cleverfox_theme->name ){
	require CLEVERFOX_PLUGIN_DIR . 'inc/profolio/cpt/cpt-main.php';
}

/**
 *  NexCraft CPT
 */
if( 'NexCraft' == $cleverfox_theme->name || 'Nexcraft BPO' == $cleverfox_theme->name ){
	require CLEVERFOX_PLUGIN_DIR . 'inc/nexcraft/cpt/cpt-main.php';
}

	if ( ! class_exists( 'CleverFox_Setup' ) ) {

	/**
	 * Customizer Loader
	 *
	 * @since 1.0.0
	 */
	class CleverFox_Setup {

		/**
		 * Instance
		 *
		 * @access private
		 * @var object
		 */
		private static $instance;

		/**
		 * Initiator
		 */
		public static function get_instance() {
			if ( ! isset( self::$instance ) ) {
				self::$instance = new self;
				}
			return self::$instance;
		}

		/**
		 * Constructor
		 */
		 public function __construct() {
			add_action( 'admin_menu', array($this, 'clever_fox_setup_menu') );
			add_action( 'wp_ajax_clever_fox_activate_theme', array( $this, 'activate_theme' ),2 );
			add_action('wp_ajax_nopriv_clever_fox_activate_theme', 'activate_theme');
			// add_action( 'wp_ajax_clever-fox-activate-theme', array( $this, 'activate_theme' ),1 );
			add_action( 'admin_enqueue_scripts', array( $this, 'clever_fox_enqueue_scripts' ) );
		}
		
		public function activate_theme() {
			/**
		 * Activate theme
		 *
		 * @since 1.0
		 * @return void
		 */
		function cleverfox_activate_theme_once() {
			// Check nonce for security
			check_ajax_referer('clever_fox_nonce', 'security');

			// Ensure the request came from a logged-in user with appropriate permissions
			if (!current_user_can('manage_options')) {
				wp_send_json_error(array(
					'success' => false,
					'message' => __('You do not have permission to activate themes.', 'clever-fox')
				));
			}

			// Validate and sanitize the theme name
			$cleverfox_theme_name = isset($_POST['theme_name']) ? sanitize_text_field(wp_unslash($_POST['theme_name'])) : '';

			if (empty($cleverfox_theme_name)) {
				wp_send_json_error(array(
					'success' => false,
					'message' => __('Invalid theme name.', 'clever-fox')
				));
			}

			
			// Check if the theme activation mode is set
			if (get_option('theme_activation_mode') !== 'activated') {
				// Set the theme activation mode to prevent running this code again
				update_option('theme_activation_mode', 'activated');
				$specia_current_theme_raw = filter_input(INPUT_POST, 'specia_current_theme', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
				$specia_current_theme = $specia_current_theme_raw ? sanitize_text_field(strtolower($specia_current_theme_raw)) : '';
				
				if (!empty($specia_current_theme)) {
					switch_theme($specia_current_theme);
					wp_send_json_success(
						array(
							'success' => true,
							'message' => __('Theme Successfully Activated', 'clever-fox'),
						)
					);
				}

				wp_die();
			}
		}
		
			add_action('after_switch_theme', 'cleverfox_activate_theme_once');		
		}
		
		public function clever_fox_enqueue_scripts() {
			wp_enqueue_style('clever-fox-admin',CLEVERFOX_PLUGIN_URL .'inc/assets/css/admin.css','','0.0');
			wp_enqueue_script( 'jquery-ui-core' );
			wp_enqueue_script( 'jquery-ui-dialog' );
			wp_enqueue_style( 'wp-jquery-ui-dialog' );	
			
			wp_enqueue_script( 'clever-fox-install-theme', CLEVERFOX_PLUGIN_URL . 'inc/assets/js/install-theme.js', array( 'jquery' ),'0.0',true );
			
			wp_enqueue_script( 'clever-fox-filter-tabs', CLEVERFOX_PLUGIN_URL . 'inc/assets/js/filter-tabs.js', array( 'jquery' ),'0.0',true );
			
			$data = apply_filters(
				'cleverfox_install_theme_localize_vars',
				array(
					'installed'  => __( 'Installed! Activating..', 'clever-fox' ),
					'activating' => __( 'Activating..', 'clever-fox' ),
					'activated'  => __( 'Activated! Reloading..', 'clever-fox' ),
					'installing' => __( 'Installing..', 'clever-fox' ),
					'ajaxurl'    => esc_url( admin_url( 'admin-ajax.php' ) ),
					'security' => wp_create_nonce( 'my-special-string' )
				)
			);
			wp_localize_script( 'clever-fox-install-theme', 'CleverFoxInstallThemeVars', $data );
		}

		public function clever_fox_setup_menu() {
			add_menu_page( 'Clever Fox', 'Clever Fox', 'manage_options', 'clever-fox', array($this, 'clever_fox_page_init')  );
		}


		function clever_fox_page_init(){
	echo "<h2 class='clever-heading'>Nayra Themes Compatible Themes</h2>";
	?>
	
	<div class="filter-buttons">
		<button class="filter-button button-primary" data-category="all"><?php esc_html_e('All','clever-fox'); ?></button>
		<button class="filter-button button-primary" data-category="Business"><?php esc_html_e('Business','clever-fox'); ?></button>
		<button class="filter-button button-primary" data-category="Agency"><?php esc_html_e('Agency','clever-fox'); ?></button>
		<button class="filter-button button-primary" data-category="Corporate"><?php esc_html_e('Corporate','clever-fox'); ?></button>
		<button class="filter-button button-primary" data-category="Multipurpose"><?php esc_html_e('Multipurpose','clever-fox'); ?></button>
		<button class="filter-button button-primary" data-category="IT-Software"><?php esc_html_e('IT & Software','clever-fox'); ?></button>
		<button class="filter-button button-primary" data-category="Education"><?php esc_html_e('Education','clever-fox'); ?></button>	
		<button class="filter-button button-primary" data-category="Hotel-Resorts"><?php esc_html_e('Hotel & Resorts','clever-fox'); ?></button>	
		<button class="filter-button button-primary" data-category="News-Blog"><?php esc_html_e('News & Blog','clever-fox'); ?></button>	
		<button class="filter-button button-primary" data-category="Spa-Saloon"><?php esc_html_e('Spa Saloon','clever-fox'); ?></button>	
		<button class="filter-button button-primary" data-category="Events"><?php esc_html_e('Events','clever-fox'); ?></button>	
		<button class="filter-button button-primary" data-category="Construction"><?php esc_html_e('Construction','clever-fox'); ?></button>
		<button class="filter-button button-primary" data-category="Medical"><?php esc_html_e('Medical','clever-fox'); ?></button>
	</div>
	
	<?php
	
		$api_url = 'https://api.wordpress.org/themes/info/1.1/?action=query_themes&request[author]=nayrathemes&request[per_page]=100';

		// Read JSON file
		$response = wp_remote_get( $api_url );

		if ( is_wp_error( $response ) ) {
			$error_message = $response->get_error_message();
		} else {
			$json_data = wp_remote_retrieve_body( $response );
		}

		// Decode JSON data into PHP array
		$response_data = json_decode($json_data);

	
		// All user data exists in 'data' object
		$cleverfox_theme_data = $response_data->themes;

		// Traverse array and display user data
		
		?>
		
		<div class="specia-sites-panel wp-clearfix">
			<div class="specia-sites-wrapper" id="wrap-disk">
				<?php foreach ($cleverfox_theme_data as $cleverfox_themes) { 
				
				$cleverfox_theme = wp_get_theme();
				
				$get_theme_staus='';
				// Theme installed and activate.
				if ( $cleverfox_themes->name == $cleverfox_theme->name ) {
					$get_theme_staus= 'installed-and-active';
					$specia_btn_value= 'Activated';
				}else{

					// Theme installed but not activate.
					foreach ( (array) wp_get_themes() as $cleverfox_theme_dir => $cleverfox_themesss ) {
						if ( $cleverfox_themes->name == $cleverfox_themesss->name ) {
							$get_theme_staus= 'installed-but-inactive';
							$specia_btn_value= 'Activate Now';
						}
						 //$get_theme_staus= 'not-installed';
					}
				}
				
				?>
				
				
					<?php 
						if ( ($cleverfox_themes->name) == "Ampark" ):
							$cleverfox_theme_category ="Business";

						elseif ( ($cleverfox_themes->name) == "Avitech" ):
							$cleverfox_theme_category ="Business";
							
						elseif ( ($cleverfox_themes->name) == "Aviser" ):
							$cleverfox_theme_category ="Business";
							
						elseif ( ($cleverfox_themes->name) == "Axtia" ):
							$cleverfox_theme_category ="Business";
							
						elseif ( ($cleverfox_themes->name) == "Avail" ):
							$cleverfox_theme_category ="Business";
							
						elseif ( ($cleverfox_themes->name) == "Aera" ):
							$cleverfox_theme_category ="Business";
							
						elseif ( ($cleverfox_themes->name) == "Avril" ):
							$cleverfox_theme_category ="Business";
							
						elseif ( ($cleverfox_themes->name) == "Varuda" ):
							$cleverfox_theme_category ="Business";
							
						elseif ( ($cleverfox_themes->name) == "Avtari" ):
							$cleverfox_theme_category ="Business";
							
						elseif ( ($cleverfox_themes->name) == "Techine" ):
						$cleverfox_theme_category ="Agency";
							
						elseif ( ($cleverfox_themes->name) == "Conceptly" || ($cleverfox_themes->name) == "Convo" ):
							$cleverfox_theme_category ="Agency";
							
						elseif ( ($cleverfox_themes->name) == "Ameya" ):
							$cleverfox_theme_category ="Agency";
							
						elseif ( ($cleverfox_themes->name) == "Azwa" ):
							$cleverfox_theme_category ="Agency";
							
						elseif ( ($cleverfox_themes->name) == "Colorsy" ):
						$cleverfox_theme_category ="Corporate";

						elseif ( ($cleverfox_themes->name) == "ColorPress" ):
						$cleverfox_theme_category ="Corporate";

						elseif ( ($cleverfox_themes->name) == "Flavita" ):
						$cleverfox_theme_category ="Corporate";

						elseif ( ($cleverfox_themes->name) == "Comoxa" ):
						$cleverfox_theme_category ="Corporate";

						elseif ( ($cleverfox_themes->name) == "Gradiant" ):
						$cleverfox_theme_category ="Corporate";

						elseif ( ($cleverfox_themes->name) == "Boostify" ):
						$cleverfox_theme_category ="Multipurpose";

						elseif ( ($cleverfox_themes->name) == "Envira" ):
						$cleverfox_theme_category ="Multipurpose";

						elseif ( ($cleverfox_themes->name) == "StartKit" ):
						$cleverfox_theme_category ="Multipurpose";

						elseif ( ($cleverfox_themes->name) == "StartBiz" ):
						$cleverfox_theme_category ="Multipurpose";

						elseif ( ($cleverfox_themes->name) == "Arowana" ):
						$cleverfox_theme_category ="Multipurpose";

						elseif ( ($cleverfox_themes->name) == "StartWeb" ):
						$cleverfox_theme_category ="Multipurpose";

						elseif ( ($cleverfox_themes->name) == "MetaSoft" ):
						$cleverfox_theme_category ="IT-Software";

						elseif ( ($cleverfox_themes->name) == "Belltech" ):
						$cleverfox_theme_category ="IT-Software";

						elseif ( ($cleverfox_themes->name) == "Eduvert" ):
						$cleverfox_theme_category ="Education";

						elseif ( ($cleverfox_themes->name) == "Aravalli" || ($cleverfox_themes->name) == "VillaPress" || ($cleverfox_themes->name) == "Hotel 26" || ($cleverfox_themes->name) == "Hotel Elegance" || ($cleverfox_themes->name) == "Hotel Prime" ):
						$cleverfox_theme_category ="Hotel-Resorts";

						elseif ( ($cleverfox_themes->name) == "Arbuda" ):
						$cleverfox_theme_category ="Hotel-Resorts";

						elseif ( ($cleverfox_themes->name) == "Fiona Blog" ):
						$cleverfox_theme_category ="News-Blog";

						elseif ( ($cleverfox_themes->name) == "Fiona Food" ):
						$cleverfox_theme_category ="News-Blog";

						elseif ( ($cleverfox_themes->name) == "Fiona News" ):
						$cleverfox_theme_category ="News-Blog";
						
						elseif ( ($cleverfox_themes->name) == "TimeBlog" ):
						$cleverfox_theme_category ="News-Blog";

						elseif ( ($cleverfox_themes->name) == "Hantus" ):
						$cleverfox_theme_category ="Spa-Saloon";

						elseif ( ($cleverfox_themes->name) == "Thai Spa" ):
						$cleverfox_theme_category ="Spa-Saloon";

						elseif ( ($cleverfox_themes->name) == "Cosmics" ):
						$cleverfox_theme_category ="Spa-Saloon";

						elseif ( ($cleverfox_themes->name) == "EventPress" ):
						$cleverfox_theme_category ="Events";

						elseif ( ($cleverfox_themes->name) == "Appointo" ):
						$cleverfox_theme_category ="Agency";
						
						elseif ( ($cleverfox_themes->name) == "Renoval" ||  ($cleverfox_themes->name) == "Builderse" || ($cleverfox_themes->name) == "Eractor"):
						$cleverfox_theme_category ="Construction";
						
						elseif ( ($cleverfox_themes->name) == "Medazin" || ($cleverfox_themes->name) == "DoctorHub" || ($cleverfox_themes->name) == "CardioPress" || ($cleverfox_themes->name) == "Medisafe" ):
						$cleverfox_theme_category ="Medical";

						elseif ( ($cleverfox_themes->name) == "News 25" || ($cleverfox_themes->name) == "News25 Live" || ($cleverfox_themes->name) == "News25 Prime" || ($cleverfox_themes->name) == "News25 Breaking" || ($cleverfox_themes->name) == "News25 Press" || ($cleverfox_themes->name) == "News25 Headline" ):
						$cleverfox_theme_category ="News-Blog";

						else :
							$cleverfox_theme_category ="Business";
						endif;
					?>
					<div id="specia-theme-activation-xl" data-category="<?php echo esc_html($cleverfox_theme_category); ?>" class="clever-fox-sites-items <?php echo esc_html($cleverfox_themes->name); ?>">
						<div class="clever-fox-items-inner">
							<div class="specia-demo-screenshot">
								<div class="specia-demo-image" style="background-image: url(<?php echo esc_url($cleverfox_themes->screenshot_url); ?>);"></div>
									<div class="specia-demo-actions">
										<a class="clever-fox-btn clever-fox-btn-outline" href="https://nayrathemes.com/demo/pro/<?php echo esc_html($cleverfox_themes->slug); ?>" target="_blank"><?php esc_html_e('Preview','clever-fox'); ?></a>
										<?php 
										if($get_theme_staus !== 'installed-and-active' && $get_theme_staus !== 'installed-but-inactive'):
											$get_theme_staus= 'not-installed';
											$specia_btn_value= 'Install & Activate Now';
										endif;
										$cleverfox_theme_status = 'clever-fox-theme-' . $get_theme_staus;
										echo wp_kses_post(sprintf(/* translators: 1: Theme Slug 3:Anchor Class 4: Text */ __( '<a href="#" class="%3$s xl-btn-active clever-fox-btn-outline xl-install-action clever-fox-btn" data-theme-slug="%1$s">%4$s</a>', 'clever-fox' ), esc_html($cleverfox_themes->name),esc_url( admin_url( 'themes.php?theme=%1$s' ) ), esc_html($cleverfox_theme_status), esc_html($specia_btn_value) ) );
										//switch_theme( $cleverfox_themes->name );
										?>
									</div>
								</div>
								<div class="sp-demo-meta  sp-demo-meta--with-preview">
									<div class="sp-demo-name"><h4 title="Nayra Themes"><a href="<?php echo esc_url(admin_url('theme-install.php?search='.$cleverfox_themes->name)); ?>"><?php echo esc_html($cleverfox_themes->name); ?></a></h4></div>	
									<a class="clever-fox-btn clever-fox-btn-outline" href="https://nayrathemes.com/<?php echo esc_html($cleverfox_themes->slug); ?>-pro/" target="_blank"><?php esc_html_e('Buy Now','clever-fox'); ?></a>	
								</div>
								<?php //echo $get_theme_staus; ?>
						</div>
					</div>
				<?php } ?>									
				</div>
			</div>
		
		<?php
		}
			
	}
}// End if().

/**
 *  Kicking this off by calling 'get_instance()' method
 */
CleverFox_Setup::get_instance();


/**
 * The code during plugin activation.
 */
function cleverfox__activate() {
	require_once plugin_dir_path( __FILE__ ) . 'inc/cleverfox-activator.php';
	Cleverfox_Activator::activate();
}
register_activation_hook( __FILE__, 'cleverfox__activate' );