<?php
/**
 * @package Demo Import
 * @since 1.0.0
 */

class ThemeWhizzie {

	protected $version = '1.1.0';

	/** @var string Current theme name, used as namespace in actions. */
	protected $theme_name = '';
	protected $theme_title = '';

	/** @var string Demo Import page slug and title. */
	protected $page_slug = '';
	protected $page_title = '';

	/** @var array Demo Import steps set by user. */
	protected $config_steps = array();
	public $parent_slug;
	/**
	 * Constructor
	 *
	 * @param $butcher_meatshop_config	Our config parameters
	*/
	public function __construct( $butcher_meatshop_config ) {
		$this->set_vars( $butcher_meatshop_config );
		$this->init();
	}

	/**
	 * Set some settings
	 * @since 1.0.0
	 * @param $butcher_meatshop_config	Our config parameters
	*/
	public function set_vars( $butcher_meatshop_config ) {
		if( isset( $butcher_meatshop_config['page_slug'] ) ) {
			$this->page_slug = esc_attr( $butcher_meatshop_config['page_slug'] );
		}
		if( isset( $butcher_meatshop_config['page_title'] ) ) {
			$this->page_title = esc_attr( $butcher_meatshop_config['page_title'] );
		}
		if( isset( $butcher_meatshop_config['steps'] ) ) {
			$this->config_steps = $butcher_meatshop_config['steps'];
		}

		$current_theme = wp_get_theme();
		$this->theme_title = $current_theme->get( 'Name' );
		$this->theme_name = strtolower( preg_replace( '#[^a-zA-Z]#', '', $current_theme->get( 'Name' ) ) );
		$this->page_slug = apply_filters( $this->theme_name . '_theme_setup_wizard_page_slug', $this->theme_name . '-demoimport' );
		$this->parent_slug = apply_filters( $this->theme_name . '_theme_setup_wizard_parent_slug', '' );
	}

	/**
	 * Hooks and filters
	 * @since 1.0.0
	*/
	public function init() {
		add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
		add_action( 'admin_menu', array( $this, 'menu_page' ) );
		add_action( 'wp_ajax_setup_widgets', array( $this, 'setup_widgets' ) );
	}
	
	public function enqueue_scripts() {
		wp_enqueue_style( 'demo-import-style', get_template_directory_uri() . '/demo-import/assets/css/demo-import-style.css');
		wp_register_script( 'demo-import-script', get_template_directory_uri() . '/demo-import/assets/js/demo-import-script.js', array( 'jquery' ), time() );
		wp_localize_script(
			'demo-import-script',
			'butcher_meatshop_whizzie_params',
			array(
				'ajaxurl' 		=> admin_url( 'admin-ajax.php' ),
				'wpnonce' 		=> wp_create_nonce( 'whizzie_nonce' ),
				'verify_text'	=> esc_html( 'verifying', 'butcher-meatshop' )
			)
		);
		wp_enqueue_script( 'demo-import-script' );
	}

	/**  Make a modal screen for the wizard **/
	public function menu_page() {
		add_menu_page( esc_html( $this->page_title ), esc_html( $this->page_title ), 'manage_options', $this->page_slug, array( $this, 'butcher_meatshop_guide' ) ,'',40);
	}

	/** Make an interface for the wizard **/
	public function wizard_page() {
		/* If we arrive here, we have the filesystem */ ?>
		<div class="wrap">
			<?php echo '<div class="whizzie-wrap">';
				// The wizard is a list with only one item visible at a time
				$steps = $this->get_steps();
				echo '<ul class="whizzie-nav wizard-icon-nav">';?>
				<?php
					$stepI=1;
					foreach( $steps as $step ) {
						$stepAct=($stepI ==1)? 1 : 0;
						if( isset( $step['icon_text'] ) && $step['icon_text'] ) {
							echo '<li class="commom-cls nav-step-' . esc_attr( $step['id'] ) . '" wizard-steps="step-'.esc_attr( $step['id'] ).'" data-enable="'.$stepAct.'">
							<p>'.esc_attr( $step['icon_text'] ).'</p>
							</li>';
						}
					$stepI++;}
			 	echo '</ul>';
				echo '<ul class="whizzie-menu wizard-menu-page">';
				foreach( $steps as $step ) {
					$class = 'step step-' . esc_attr( $step['id'] );
					echo '<li data-step="' . esc_attr( $step['id'] ) . '" class="' . esc_attr( $class ) . '" >';
						$content = call_user_func( array( $this, $step['view'] ) );
						printf('<div class="wizard-button-wrapper">');
							if( isset( $step['button_text_one'] )) {
								printf(
									'<div class="button-wrap button-wrap-one">
										<a href="#" class="button button-primary do-it" data-callback="install_widgets" data-step="widgets"><p class="demo-type-text">%s</p></a>
									</div>',
									esc_html( $step['button_text_one'] )
								);
							}
						printf('</div>');
					echo '</li>';
				}
				echo '</ul>';
				?>
				<div class="step-loading"><span class="spinner">
					<img src="<?php echo esc_url(get_template_directory_uri().'/demo-import/assets/images/Spinner-Animaion.gif'); ?>">
				</span></div>
			<?php echo '</div>';?>
		</div>
	<?php }

	/**
	 * Set options for the steps
	 * @return Array
	*/
	public function get_steps() {
		if ( get_option('butcher_meatshop_demo_imported') ) {
			return array(
				'done' => array(
					'id'        => 'done',
					'title'     => __( 'All Done', 'butcher-meatshop' ),
					'icon'      => 'yes',
					'view'      => 'get_step_done',
					'callback'  => '',
					'icon_text' => 'View Site'
				)
			);
		}
		$dev_steps = $this->config_steps;
		$steps = array(
			'widgets' => array(
				'id'			=> 'widgets',
				'title'			=> __( 'Customizer', 'butcher-meatshop' ),
				'icon'			=> 'welcome-widgets-menus',
				'view'			=> 'get_step_widgets',
				'callback'		=> 'install_widgets',
				'button_text_one'	=> __( 'Import Demo', 'butcher-meatshop' ),
				'can_skip'		=> true,
				'icon_text'      => 'Import Demo'
			),
			'done' => array(
				'id'			=> 'done',
				'title'			=> __( 'All Done', 'butcher-meatshop' ),
				'icon'			=> 'yes',
				'view'			=> 'get_step_done',
				'callback'		=> '',
				'icon_text'      => 'Done'
			)
		);
		// Iterate through each step and replace with dev config values
		if( $dev_steps ) {
			// Configurable elements - these are the only ones the dev can update from config.php
			$can_config = array( 'title', 'icon', 'button_text', 'can_skip' );
			foreach( $dev_steps as $dev_step ) {
				// We can only proceed if an ID exists and matches one of our IDs
				if( isset( $dev_step['id'] ) ) {
					$id = $dev_step['id'];
					if( isset( $steps[$id] ) ) {
						foreach( $can_config as $element ) {
							if( isset( $dev_step[$element] ) ) {
								$steps[$id][$element] = $dev_step[$element];
							}
						}
					}
				}
			}
		}
		return $steps;
	}

	/**    Print the content for the intro step     **/
		public function get_step_importer() { ?>
		<div class="summary">
			<p>
				<?php esc_html_e('Thank you for choosing this Butcher Meatshop Theme. Using this quick setup wizard, you will be able to configure your new website and get it running in just a few minutes. Just follow these simple steps mentioned in the wizard and get started with your website.','butcher-meatshop'); ?>
			</p>
		</div>
	<?php }

	/**   Print the content for the widgets step   **/
	public function get_step_widgets() { ?>
		<div class="summary">
			<p>
				<?php esc_html_e('This theme allows you to import demo content and add widgets. Install them using the button below. You can also update or deactivate them using the Customizer.','butcher-meatshop'); ?>
			</p>
		</div>
	<?php }

	/** Print the content for the final step **/
	public function get_step_done() { ?>

		<div class="setup-finish">
			<p>
				<?php echo esc_html('Your demo content has been imported successfully. Click the finish button for more information.'); ?>
			</p>
			<div class="finish-buttons">
				<a href="<?php echo esc_url( admin_url( 'themes.php?page=butcher-meatshop-getstart-page' ) ); ?>" class="wz-btn-customizer" target="_blank"><?php esc_html_e('About Butcher Meatshop','butcher-meatshop') ?></a>
				<a href="<?php echo esc_url(admin_url('/customize.php')); ?>" class="wz-btn-customizer" target="_blank"><?php esc_html_e('Customize Your Demo','butcher-meatshop') ?></a>
				<a href="<?php echo esc_url(home_url()); ?>" class="wz-btn-visit-site" target="_blank"><?php esc_html_e('Visit Your Site','butcher-meatshop'); ?></a>
			</div>
			<div class="finish-buttons">
				<a href="<?php echo esc_url(admin_url()); ?>" class="button button-primary"><?php esc_html_e('Finish','butcher-meatshop'); ?></a>
			</div>
		</div>

	<?php }


	//................................................. MENUS .................................................//
	
	public function butcher_meatshop_customizer_nav_menu() {
		// ------- Create Primary Menu --------
		$butcher_meatshop_themename = 'Butcher Meatshop'; // Ensure the theme name is set
		$butcher_meatshop_menuname = $butcher_meatshop_themename . ' Responsive Menu';
		$butcher_meatshop_menulocation = 'responsive-menu';
		$butcher_meatshop_menu_exists = wp_get_nav_menu_object($butcher_meatshop_menuname);

		if (!$butcher_meatshop_menu_exists) {
			$butcher_meatshop_menu_id = wp_create_nav_menu($butcher_meatshop_menuname);

			// Home
			wp_update_nav_menu_item($butcher_meatshop_menu_id, 0, array(
				'menu-item-title' => __('Home', 'butcher-meatshop'),
				'menu-item-classes' => 'home',
				'menu-item-url' => home_url('/'),
				'menu-item-status' => 'publish'
			));

			// About
			$butcher_meatshop_page_about = get_page_by_path('about');
			if($butcher_meatshop_page_about){
				wp_update_nav_menu_item($butcher_meatshop_menu_id, 0, array(
					'menu-item-title' => __('About', 'butcher-meatshop'),
					'menu-item-classes' => 'about',
					'menu-item-url' => get_permalink($butcher_meatshop_page_about),
					'menu-item-status' => 'publish'
				));
			}

			// Services
			$butcher_meatshop_page_services = get_page_by_path('services');
			if($butcher_meatshop_page_services){
				wp_update_nav_menu_item($butcher_meatshop_menu_id, 0, array(
					'menu-item-title' => __('Services', 'butcher-meatshop'),
					'menu-item-classes' => 'services',
					'menu-item-url' => get_permalink($butcher_meatshop_page_services),
					'menu-item-status' => 'publish'
				));
			}

			// Blog
			$butcher_meatshop_page_blog = get_page_by_path('blog');
			if($butcher_meatshop_page_blog){
				wp_update_nav_menu_item($butcher_meatshop_menu_id, 0, array(
					'menu-item-title' => __('Blog', 'butcher-meatshop'),
					'menu-item-classes' => 'blog',
					'menu-item-url' => get_permalink($butcher_meatshop_page_blog),
					'menu-item-status' => 'publish'
				));
			}

			// Project
			$butcher_meatshop_page_project = get_page_by_path('project');
			if($butcher_meatshop_page_project){
				wp_update_nav_menu_item($butcher_meatshop_menu_id, 0, array(
					'menu-item-title' => __('Project', 'butcher-meatshop'),
					'menu-item-classes' => 'project',
					'menu-item-url' => get_permalink($butcher_meatshop_page_project),
					'menu-item-status' => 'publish'
				));
			}

			// Contact Us
			$butcher_meatshop_page_contact = get_page_by_path('contact');
			if($butcher_meatshop_page_contact){
				wp_update_nav_menu_item($butcher_meatshop_menu_id, 0, array(
					'menu-item-title' => __('Contact Us', 'butcher-meatshop'),
					'menu-item-classes' => 'contact',
					'menu-item-url' => get_permalink($butcher_meatshop_page_contact),
					'menu-item-status' => 'publish'
				));
			}

			// Assign menu to location if not set
			if (!has_nav_menu($butcher_meatshop_menulocation)) {
				$butcher_meatshop_locations = get_theme_mod('nav_menu_locations');
				$butcher_meatshop_locations[$butcher_meatshop_menulocation] = $butcher_meatshop_menu_id; // Use $butcher_meatshop_menu_id here
				set_theme_mod('nav_menu_locations', $butcher_meatshop_locations);
			}
		}
	}
	
	public function butcher_meatshop_social_menu() {

		// ------- Create Social Menu --------
		$butcher_meatshop_themename = 'Butcher Meatshop'; // Ensure the theme name is set
		$butcher_meatshop_menuname = $butcher_meatshop_themename . ' Social Menu';
		$butcher_meatshop_menulocation = 'social-menu';
		$butcher_meatshop_menu_exists = wp_get_nav_menu_object( $butcher_meatshop_menuname );

		if( !$butcher_meatshop_menu_exists){
			$butcher_meatshop_menu_id = wp_create_nav_menu($butcher_meatshop_menuname);

			wp_update_nav_menu_item( $butcher_meatshop_menu_id, 0, array(
				'menu-item-title'  => __( 'Facebook', 'butcher-meatshop' ),
				'menu-item-url'    => 'https://www.facebook.com',
				'menu-item-status' => 'publish',
			) );

			wp_update_nav_menu_item( $butcher_meatshop_menu_id, 0, array(
				'menu-item-title'  => __( 'Pinterest', 'butcher-meatshop' ),
				'menu-item-url'    => 'https://www.pinterest.com',
				'menu-item-status' => 'publish',
			) );
	
			wp_update_nav_menu_item( $butcher_meatshop_menu_id, 0, array(
				'menu-item-title'  => __( 'Twitter', 'butcher-meatshop' ),
				'menu-item-url'    => 'https://www.twitter.com',
				'menu-item-status' => 'publish',
			) );
	
			wp_update_nav_menu_item( $butcher_meatshop_menu_id, 0, array(
				'menu-item-title'  => __( 'Youtube', 'butcher-meatshop' ),
				'menu-item-url'    => 'https://www.youtube.com',
				'menu-item-status' => 'publish',
			) );

			wp_update_nav_menu_item( $butcher_meatshop_menu_id, 0, array(
				'menu-item-title'  => __( 'Instagram', 'butcher-meatshop' ),
				'menu-item-url'    => 'https://www.instagram.com',
				'menu-item-status' => 'publish',
			) );

			if( !has_nav_menu( $butcher_meatshop_menulocation ) ){
					$locations = get_theme_mod('nav_menu_locations');
					$locations[$butcher_meatshop_menulocation] = $butcher_meatshop_menu_id;
					set_theme_mod( 'nav_menu_locations', $locations );
			}
		}
	}

	public function butcher_meatshop_customizer_left_menu() {
		// ------- Create Primary Menu --------
		$butcher_meatshop_themename = 'Butcher Meatshop'; // Ensure the theme name is set
		$butcher_meatshop_menuname = $butcher_meatshop_themename . ' Left Menu';
		$butcher_meatshop_menulocation = 'left-menu';
		$butcher_meatshop_menu_exists = wp_get_nav_menu_object($butcher_meatshop_menuname);

		if (!$butcher_meatshop_menu_exists) {
			$butcher_meatshop_menu_id = wp_create_nav_menu($butcher_meatshop_menuname);

			// Home
			wp_update_nav_menu_item($butcher_meatshop_menu_id, 0, array(
				'menu-item-title' => __('Home', 'butcher-meatshop'),
				'menu-item-classes' => 'home',
				'menu-item-url' => home_url('/'),
				'menu-item-status' => 'publish'
			));

			// About
			$butcher_meatshop_page_about = get_page_by_path('about');
			if($butcher_meatshop_page_about){
				wp_update_nav_menu_item($butcher_meatshop_menu_id, 0, array(
					'menu-item-title' => __('About', 'butcher-meatshop'),
					'menu-item-classes' => 'about',
					'menu-item-url' => get_permalink($butcher_meatshop_page_about),
					'menu-item-status' => 'publish'
				));
			}

			// Services
			$butcher_meatshop_page_services = get_page_by_path('services');
			if($butcher_meatshop_page_services){
				wp_update_nav_menu_item($butcher_meatshop_menu_id, 0, array(
					'menu-item-title' => __('Services', 'butcher-meatshop'),
					'menu-item-classes' => 'services',
					'menu-item-url' => get_permalink($butcher_meatshop_page_services),
					'menu-item-status' => 'publish'
				));
			}

			wp_update_nav_menu_item( $butcher_meatshop_menu_id, 0, array(
				'menu-item-title'  => __( 'Team', 'butcher-meatshop' ),
				'menu-item-url'    => '#',
				'menu-item-status' => 'publish',
			) );

			// Assign menu to location if not set
			if (!has_nav_menu($butcher_meatshop_menulocation)) {
				$butcher_meatshop_locations = get_theme_mod('nav_menu_locations');
				$butcher_meatshop_locations[$butcher_meatshop_menulocation] = $butcher_meatshop_menu_id; // Use $butcher_meatshop_menu_id here
				set_theme_mod('nav_menu_locations', $butcher_meatshop_locations);
			}
		}
	}

	public function butcher_meatshop_customizer_right_menu() {
		// ------- Create Primary Menu --------
		$butcher_meatshop_themename = 'Butcher Meatshop'; // Ensure the theme name is set
		$butcher_meatshop_menuname = $butcher_meatshop_themename . ' Right Menu';
		$butcher_meatshop_menulocation = 'right-menu';
		$butcher_meatshop_menu_exists = wp_get_nav_menu_object($butcher_meatshop_menuname);

		if (!$butcher_meatshop_menu_exists) {
			$butcher_meatshop_menu_id = wp_create_nav_menu($butcher_meatshop_menuname);

			// Blog
			$butcher_meatshop_page_blog = get_page_by_path('blog');
			if($butcher_meatshop_page_blog){
				wp_update_nav_menu_item($butcher_meatshop_menu_id, 0, array(
					'menu-item-title' => __('Blog', 'butcher-meatshop'),
					'menu-item-classes' => 'blog',
					'menu-item-url' => get_permalink($butcher_meatshop_page_blog),
					'menu-item-status' => 'publish'
				));
			}

			wp_update_nav_menu_item( $butcher_meatshop_menu_id, 0, array(
				'menu-item-title'  => __( 'Pages', 'butcher-meatshop' ),
				'menu-item-url'    => '#',
				'menu-item-status' => 'publish',
			) );

			// Project
			$butcher_meatshop_page_project = get_page_by_path('project');
			if($butcher_meatshop_page_project){
				wp_update_nav_menu_item($butcher_meatshop_menu_id, 0, array(
					'menu-item-title' => __('Project', 'butcher-meatshop'),
					'menu-item-classes' => 'project',
					'menu-item-url' => get_permalink($butcher_meatshop_page_project),
					'menu-item-status' => 'publish'
				));
			}

			// Contact Us
			$butcher_meatshop_page_contact = get_page_by_path('contact');
			if($butcher_meatshop_page_contact){
				wp_update_nav_menu_item($butcher_meatshop_menu_id, 0, array(
					'menu-item-title' => __('Contact Us', 'butcher-meatshop'),
					'menu-item-classes' => 'contact',
					'menu-item-url' => get_permalink($butcher_meatshop_page_contact),
					'menu-item-status' => 'publish'
				));
			}

			// Assign menu to location if not set
			if (!has_nav_menu($butcher_meatshop_menulocation)) {
				$butcher_meatshop_locations = get_theme_mod('nav_menu_locations');
				$butcher_meatshop_locations[$butcher_meatshop_menulocation] = $butcher_meatshop_menu_id; // Use $butcher_meatshop_menu_id here
				set_theme_mod('nav_menu_locations', $butcher_meatshop_locations);
			}
		}
	}

	/**
	* Imports the Demo Content
	* @since 1.1.0
	*/
	public function setup_widgets() {

		//................................................. MENU PAGES .................................................//
		
			$butcher_meatshop_home_id='';
			$butcher_meatshop_home_content = '';

			$butcher_meatshop_home_title = 'Home';
			$butcher_meatshop_home = array(
					'post_type' => 'page',
					'post_title' => $butcher_meatshop_home_title,
					'post_content'  => $butcher_meatshop_home_content,
					'post_status' => 'publish',
					'post_author' => 1,
					'post_slug' => 'home'
			);
			$butcher_meatshop_home_id = wp_insert_post($butcher_meatshop_home);

			//Set the home page template
			add_post_meta( $butcher_meatshop_home_id, '_wp_page_template', 'revolution-home.php' );

			//Set the static front page
			$butcher_meatshop_home = get_page_by_title( 'Home' );
			update_option( 'page_on_front', $butcher_meatshop_home->ID );
			update_option( 'show_on_front', 'page' );


			// Create a posts page and assign the template
			$butcher_meatshop_blog_title = 'Blog';
			$butcher_meatshop_blog_check = get_page_by_path('blog');
			if (!$butcher_meatshop_blog_check) {
				$butcher_meatshop_blog = array(
					'post_type'    => 'page',
					'post_title'   => $butcher_meatshop_blog_title,
					'post_status'  => 'publish',
					'post_author'  => 1,
					'post_name'    => 'blog' // Unique slug for the blog page
				);
				$butcher_meatshop_blog_id = wp_insert_post($butcher_meatshop_blog);

				// Set the posts page
				if (!is_wp_error($butcher_meatshop_blog_id)) {
					update_option('page_for_posts', $butcher_meatshop_blog_id);
				}
			}

			// Create a Contact Us page and assign the template
			$butcher_meatshop_contact_title = 'Contact Us';
			$butcher_meatshop_contact_check = get_page_by_path('contact');
			if (!$butcher_meatshop_contact_check) {
				$butcher_meatshop_contact = array(
					'post_type'    => 'page',
					'post_title'   => $butcher_meatshop_contact_title,
					'post_content'   => '"More About The Free Butcher WordPress Theme"
										The Free Butcher WordPress Theme stands out with its clean, elegant design, making it ideal for both local butchers and large-scale meat suppliers. This theme features a user-friendly layout that ensures a smooth browsing experience, allowing customers to easily explore your selection of fresh sausages, steak cuts, and specialty meats like venison and game meat. The theme’s intuitive navigation allows even first-time visitors to quickly find meat delivery options, butcher specials, and BBQ meat packs without confusion. With a dedicated meat counter section, you can effectively showcase your best products, including premium cuts like ribeye steak, t-bone steak, and sirloin steak, drawing in customers. Additionally, the clean layout and optimized features of this free theme offer an attractive and professional presence for any butcher business.

										With its responsive layout, the Free Butcher WordPress Theme ensures your website will look stunning on both mobile devices and desktop screens. Whether you’re offering meat boxes, meat subscriptions, or wholesale butcher services, this theme adapts perfectly to your needs, helping you reach a broader audience. The theme integrates seamlessly with WooCommerce, allowing you to manage meat delivery options, meat packs, and online transactions with ease. Whether you’re operating a small butcher shop or a high-end premium meat store, this theme enhances your ability to showcase your butchery skills, meat processing, and meat hygiene practices professionally. It offers a user-friendly design, ensuring both business owners and customers can navigate and interact effortlessly. With customizable features, you can tailor your website to reflect your brand and business, making it stand out in the competitive meat industry.

										In addition to its excellent functionality, the Free Butcher WordPress Theme offers numerous personalization options that make it easy to tailor your site to reflect the unique style of your butcher shop. Whether you are showcasing custom meat bundles, butcher promotions, or meat subscription options, the seamless integration with WooCommerce ensures an effortless setup for your online store, providing a smooth shopping experience for your customers. The theme\'s flexible layout makes it simple to highlight key offerings such as meat carvings, meat rubs, and custom meat cutting in an organized, visually appealing manner, helping to attract and engage customers. Additionally, the theme is built with SEO-friendly code, improving your website\'s visibility and making it easier for potential customers to find you through search engines. This combination of customization, functionality, and SEO optimization ensures your butcher shop thrives online.',
					'post_status'  => 'publish',
					'post_author'  => 1,
					'post_name'    => 'contact' // Unique slug for the Contact Us page
				);
				wp_insert_post($butcher_meatshop_contact);
			}

			// Create a About page and assign the template
			$butcher_meatshop_about_title = 'About';
			$butcher_meatshop_about_check = get_page_by_path('about');
			if (!$butcher_meatshop_about_check) {
				$butcher_meatshop_about = array(
					'post_type'    => 'page',
					'post_title'   => $butcher_meatshop_about_title,
					'post_content'   => '"More About The Free Butcher WordPress Theme"
										The Free Butcher WordPress Theme stands out with its clean, elegant design, making it ideal for both local butchers and large-scale meat suppliers. This theme features a user-friendly layout that ensures a smooth browsing experience, allowing customers to easily explore your selection of fresh sausages, steak cuts, and specialty meats like venison and game meat. The theme’s intuitive navigation allows even first-time visitors to quickly find meat delivery options, butcher specials, and BBQ meat packs without confusion. With a dedicated meat counter section, you can effectively showcase your best products, including premium cuts like ribeye steak, t-bone steak, and sirloin steak, drawing in customers. Additionally, the clean layout and optimized features of this free theme offer an attractive and professional presence for any butcher business.

										With its responsive layout, the Free Butcher WordPress Theme ensures your website will look stunning on both mobile devices and desktop screens. Whether you’re offering meat boxes, meat subscriptions, or wholesale butcher services, this theme adapts perfectly to your needs, helping you reach a broader audience. The theme integrates seamlessly with WooCommerce, allowing you to manage meat delivery options, meat packs, and online transactions with ease. Whether you’re operating a small butcher shop or a high-end premium meat store, this theme enhances your ability to showcase your butchery skills, meat processing, and meat hygiene practices professionally. It offers a user-friendly design, ensuring both business owners and customers can navigate and interact effortlessly. With customizable features, you can tailor your website to reflect your brand and business, making it stand out in the competitive meat industry.

										In addition to its excellent functionality, the Free Butcher WordPress Theme offers numerous personalization options that make it easy to tailor your site to reflect the unique style of your butcher shop. Whether you are showcasing custom meat bundles, butcher promotions, or meat subscription options, the seamless integration with WooCommerce ensures an effortless setup for your online store, providing a smooth shopping experience for your customers. The theme\'s flexible layout makes it simple to highlight key offerings such as meat carvings, meat rubs, and custom meat cutting in an organized, visually appealing manner, helping to attract and engage customers. Additionally, the theme is built with SEO-friendly code, improving your website\'s visibility and making it easier for potential customers to find you through search engines. This combination of customization, functionality, and SEO optimization ensures your butcher shop thrives online.',
					'post_status'  => 'publish',
					'post_author'  => 1,
					'post_name'    => 'about' // Unique slug for the About page
				);
				wp_insert_post($butcher_meatshop_about);
			}

			// Create a Projects page and assign the template
			$butcher_meatshop_project_title = 'project';
			$butcher_meatshop_project_check = get_page_by_path('project');
			if (!$butcher_meatshop_project_check) {
				$butcher_meatshop_project = array(
					'post_type'    => 'page',
					'post_title'   => $butcher_meatshop_project_title,
					'post_content'   => '"More About The Free Butcher WordPress Theme"
										The Free Butcher WordPress Theme stands out with its clean, elegant design, making it ideal for both local butchers and large-scale meat suppliers. This theme features a user-friendly layout that ensures a smooth browsing experience, allowing customers to easily explore your selection of fresh sausages, steak cuts, and specialty meats like venison and game meat. The theme’s intuitive navigation allows even first-time visitors to quickly find meat delivery options, butcher specials, and BBQ meat packs without confusion. With a dedicated meat counter section, you can effectively showcase your best products, including premium cuts like ribeye steak, t-bone steak, and sirloin steak, drawing in customers. Additionally, the clean layout and optimized features of this free theme offer an attractive and professional presence for any butcher business.

										With its responsive layout, the Free Butcher WordPress Theme ensures your website will look stunning on both mobile devices and desktop screens. Whether you’re offering meat boxes, meat subscriptions, or wholesale butcher services, this theme adapts perfectly to your needs, helping you reach a broader audience. The theme integrates seamlessly with WooCommerce, allowing you to manage meat delivery options, meat packs, and online transactions with ease. Whether you’re operating a small butcher shop or a high-end premium meat store, this theme enhances your ability to showcase your butchery skills, meat processing, and meat hygiene practices professionally. It offers a user-friendly design, ensuring both business owners and customers can navigate and interact effortlessly. With customizable features, you can tailor your website to reflect your brand and business, making it stand out in the competitive meat industry.

										In addition to its excellent functionality, the Free Butcher WordPress Theme offers numerous personalization options that make it easy to tailor your site to reflect the unique style of your butcher shop. Whether you are showcasing custom meat bundles, butcher promotions, or meat subscription options, the seamless integration with WooCommerce ensures an effortless setup for your online store, providing a smooth shopping experience for your customers. The theme\'s flexible layout makes it simple to highlight key offerings such as meat carvings, meat rubs, and custom meat cutting in an organized, visually appealing manner, helping to attract and engage customers. Additionally, the theme is built with SEO-friendly code, improving your website\'s visibility and making it easier for potential customers to find you through search engines. This combination of customization, functionality, and SEO optimization ensures your butcher shop thrives online.',
					'post_status'  => 'publish',
					'post_author'  => 1,
					'post_name'    => 'project' // Unique slug for the project page
				);
				wp_insert_post($butcher_meatshop_project);
			}

			// Create a Services page and assign the template
			$butcher_meatshop_services_title = 'Services';
			$butcher_meatshop_services_check = get_page_by_path('services');
			if (!$butcher_meatshop_services_check) {
				$butcher_meatshop_services = array(
					'post_type'    => 'page',
					'post_title'   => $butcher_meatshop_services_title,
					'post_content'   => '"More About The Free Butcher WordPress Theme"
										The Free Butcher WordPress Theme stands out with its clean, elegant design, making it ideal for both local butchers and large-scale meat suppliers. This theme features a user-friendly layout that ensures a smooth browsing experience, allowing customers to easily explore your selection of fresh sausages, steak cuts, and specialty meats like venison and game meat. The theme’s intuitive navigation allows even first-time visitors to quickly find meat delivery options, butcher specials, and BBQ meat packs without confusion. With a dedicated meat counter section, you can effectively showcase your best products, including premium cuts like ribeye steak, t-bone steak, and sirloin steak, drawing in customers. Additionally, the clean layout and optimized features of this free theme offer an attractive and professional presence for any butcher business.

										With its responsive layout, the Free Butcher WordPress Theme ensures your website will look stunning on both mobile devices and desktop screens. Whether you’re offering meat boxes, meat subscriptions, or wholesale butcher services, this theme adapts perfectly to your needs, helping you reach a broader audience. The theme integrates seamlessly with WooCommerce, allowing you to manage meat delivery options, meat packs, and online transactions with ease. Whether you’re operating a small butcher shop or a high-end premium meat store, this theme enhances your ability to showcase your butchery skills, meat processing, and meat hygiene practices professionally. It offers a user-friendly design, ensuring both business owners and customers can navigate and interact effortlessly. With customizable features, you can tailor your website to reflect your brand and business, making it stand out in the competitive meat industry.

										In addition to its excellent functionality, the Free Butcher WordPress Theme offers numerous personalization options that make it easy to tailor your site to reflect the unique style of your butcher shop. Whether you are showcasing custom meat bundles, butcher promotions, or meat subscription options, the seamless integration with WooCommerce ensures an effortless setup for your online store, providing a smooth shopping experience for your customers. The theme\'s flexible layout makes it simple to highlight key offerings such as meat carvings, meat rubs, and custom meat cutting in an organized, visually appealing manner, helping to attract and engage customers. Additionally, the theme is built with SEO-friendly code, improving your website\'s visibility and making it easier for potential customers to find you through search engines. This combination of customization, functionality, and SEO optimization ensures your butcher shop thrives online.',
					'post_status'  => 'publish',
					'post_author'  => 1,
					'post_name'    => 'services' // Unique slug for the Services page
				);
				wp_insert_post($butcher_meatshop_services);
			}

			
		//................................................. HEADER SECTION .................................................//

			set_theme_mod( 'butcher_meatshop_header_info_phone', '1234567890' );
			set_theme_mod( 'butcher_meatshop_header_info_email', 'info@example.com' );
			set_theme_mod( 'butcher_meatshop_header_info_time', 'Mon-Sat 8am - 6pm' );

			set_theme_mod( 'butcher_meatshop_enable_slider', 1 );
			set_theme_mod( 'butcher_meatshop_gallery_sec_enable', 1 );

			
		//................................................. SLIDER SECTION .................................................//

			for($butcher_meatshop_i=1;$butcher_meatshop_i<=3;$butcher_meatshop_i++){
				set_theme_mod( 'butcher_meatshop_slider_image'.$butcher_meatshop_i,get_template_directory_uri().'/revolution/assets/images/slider'.$butcher_meatshop_i.'.png' );
				set_theme_mod( 'butcher_meatshop_slider_heading'.$butcher_meatshop_i, 'FRESH CUTS BUTCHER SHOP IN THE CITY' );
				set_theme_mod( 'butcher_meatshop_slider_xtra_heading'.$butcher_meatshop_i, 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.' );
				set_theme_mod( 'butcher_meatshop_slider_text'.$butcher_meatshop_i, 'Lorem Ipsum is simply dummy text of the printing and industry.' );
				set_theme_mod( 'butcher_meatshop_slider_button1_text'.$butcher_meatshop_i, 'SHOP NOW' );
				set_theme_mod( 'butcher_meatshop_slider_button1_link'.$butcher_meatshop_i, '#' );
			}

		//................................................. GALLERY SECTION .................................................//

			set_theme_mod( 'butcher_meatshop_service_sub_heading', 'GALLERY' );
			set_theme_mod( 'butcher_meatshop_service_about_us', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.' );

			set_theme_mod( 'butcher_meatshop_gallery_first',get_template_directory_uri().'/revolution/assets/images/gallery1.png' );
			set_theme_mod( 'butcher_meatshop_gallery_sec',get_template_directory_uri().'/revolution/assets/images/gallery2.png' );
			set_theme_mod( 'butcher_meatshop_gallery_third',get_template_directory_uri().'/revolution/assets/images/gallery3.png' );
			set_theme_mod( 'butcher_meatshop_gallery_fourth',get_template_directory_uri().'/revolution/assets/images/gallery4.png' );
			set_theme_mod( 'butcher_meatshop_gallery_fifth',get_template_directory_uri().'/revolution/assets/images/gallery5.png' );
			set_theme_mod( 'butcher_meatshop_gallery_sixth',get_template_directory_uri().'/revolution/assets/images/gallery6.png' );
			
	
		$this->butcher_meatshop_customizer_nav_menu();
		$this->butcher_meatshop_social_menu();
		$this->butcher_meatshop_customizer_left_menu();
		$this->butcher_meatshop_customizer_right_menu();
		update_option('butcher_meatshop_demo_imported', true);
	}

	//guidline for about theme
	public function butcher_meatshop_guide() {
		$display_string = '';
		//custom function about theme customizer
		$return = add_query_arg( array()) ;
		$theme = wp_get_theme( 'butcher-meatshop' );
		?>
		<div class="wrapper-info get-stared-page-wrap">
			<div class="wrapper-info-content">
				<div class="buynow__">
					<h2><?php esc_html_e( 'Welcome to Butcher Meatshop', 'butcher-meatshop' ); ?> <span class="version">Version: <?php echo esc_html($theme['Version']);?></span></h2>
					<p><?php esc_html_e('The quick setup wizard will assist you in configuring your new website. This wizard will import the demo content.', 'butcher-meatshop'); ?></p>
				</div>
				<div class="buynow_">
					<a target="_blank" class="buynow_themepage" href="<?php echo esc_url('https://www.revolutionwp.com/products/meatshop-wordpress-theme'); ?>"><?php echo esc_html__('Go Premium Now', 'butcher-meatshop'); ?></a>
				</div>
			</div>
			<div class="tab-sec theme-option-tab">
				<div id="demo_offer" class="tabcontent open">
					<?php $this->wizard_page(); ?>
				</div>
			</div>
		</div>
	<?php }
}