<?php

add_action( 'admin_menu', 'affiliate_marketing_business_gettingstarted' );
function affiliate_marketing_business_gettingstarted() {
	add_theme_page( esc_html__('About Theme', 'affiliate-marketing-business'), esc_html__('Theme Demo Import', 'affiliate-marketing-business'), 'edit_theme_options', 'affiliate-marketing-business-guide-page', 'affiliate_marketing_business_guide');
}

function affiliate_marketing_business_admin_theme_style() {
   wp_enqueue_style('affiliate-marketing-business-custom-admin-style', esc_url(get_template_directory_uri()) . '/inc/dashboard/get_started_info.css');
   wp_enqueue_script('affiliate-marketing-business-tab', esc_url( get_template_directory_uri() ) . '/inc/dashboard/js/get_started_tab.js');

    // Admin notice code START
	wp_register_script('affiliate-marketing-notice', esc_url(get_template_directory_uri()) . '/inc/dashboard/js/notice.js', array('jquery'), time(), true);
	wp_enqueue_script('affiliate-marketing-notice');
	// Admin notice code END
}
add_action('admin_enqueue_scripts', 'affiliate_marketing_business_admin_theme_style');

// Notice after Theme Activation
add_action('admin_notices', 'affiliate_marketing_business_activation_notice');

function affiliate_marketing_business_activation_notice(){
   // Hide permanently if dismissed
    if ( get_option('affiliate_marketing_business_admin_notice') == 1 ) {
        return;
    }
    // Hide ONLY on Get Started page
    if ( isset($_GET['page']) && $_GET['page'] === 'affiliate-marketing-business-guide-page' ) {
        return;
    }  {?>
    <div id="affiliate-marketing-welcome-notice" class="notice notice-success is-dismissible getting_started activation-notice">
		<div class="notice-info">
			<div class="notice-image">
				<img style="width: 100%;max-width: 320px;line-height: 40px;display: inline-block;vertical-align: top;" src="<?php echo esc_url(get_stylesheet_directory_uri()) .'/screenshot.png'; ?>" />
			</div>
			<div class="notice-content">
				<h2><?php esc_html_e( 'Thanks For Installing Affiliate Marketing Business, You Rock!', 'affiliate-marketing-business' ) ?> </h2>
				<p><?php esc_html_e( 'Take benefit of a variety of features, functionalities, elements, and an exclusive set of customization options to build your own professional charity website. Please Click on the link below to know the theme setup information.', 'affiliate-marketing-business' ) ?></p>
				<div style="display: grid;">
					<a class="button notice-btn" href="<?php echo esc_url( admin_url( 'themes.php?page=affiliate-marketing-business-guide-page' )); ?>"><?php esc_html_e( 'Get Started', 'affiliate-marketing-business' ) ?></a>
					<a class="button notice-btn" target="_blank" href="<?php echo esc_url( AFFILIATE_MARKETING_BUSINESS_LIVE_DEMO ); ?>"><?php esc_html_e('Pro Demo', 'affiliate-marketing-business') ?></a>
					<a  class="button notice-btn" target="_blank" href="<?php echo esc_url( AFFILIATE_MARKETING_BUSINESS_BUY_PRO ); ?>"><?php esc_html_e('Upgrade To Pro', 'affiliate-marketing-business') ?></a>
					<a  class="button notice-btn" target="_blank" href="<?php echo esc_url( AFFILIATE_MARKETING_BUSINESS_FREE_DOC ); ?>"><?php esc_html_e('Free Doc', 'affiliate-marketing-business') ?></a>
				</div>
			</div>
		</div>
	</div>
	<?php }
}
//Hook (VERY IMPORTANT)
add_action('admin_notices', 'affiliate_marketing_business_activation_notice');

// Admin notice code START
add_action('wp_ajax_affiliate_marketing_business_dismiss_notice', 'affiliate_marketing_business_dismiss_notice');
function affiliate_marketing_business_dismiss_notice() {
    update_option('affiliate_marketing_business_admin_notice', 1);
    wp_die();
}

//After Switch theme function
add_action('after_switch_theme', 'affiliate_marketing_business_getstart_setup_options');
function affiliate_marketing_business_getstart_setup_options () {
    delete_option('affiliate_marketing_business_admin_notice');
}
// Admin notice code END

/**
 * Theme Info Page
 */
function affiliate_marketing_business_guide() {

	// Theme info
	$affiliate_marketing_business_return = add_query_arg( array()) ;
	$affiliate_marketing_business_theme = wp_get_theme( 'affiliate-marketing-business' ); ?>

	<div class="wrap getting-started">
		<div class="getting-started__header">
		    <div>
                <h2 class="tgmpa-notice-warning"></h2>
            </div>
		</div>
		<div class="tab-sec">
			<div class="tab">
				<button role="tab" class="tablinks home" onclick="affiliate_marketing_business_openCity(event, 'bwp_getstart')"><?php esc_html_e( 'Theme Demo Import', 'affiliate-marketing-business' ); ?></button>
				<button role="tab" class="tablinks" onclick="affiliate_marketing_business_openCity(event, 'bwp_setup')"><?php esc_html_e( 'Free Theme Information', 'affiliate-marketing-business' ); ?></button>
				<button role="tab" class="tablinks" onclick="affiliate_marketing_business_openCity(event, 'bwp_premium_info')"><?php esc_html_e( 'Premium Theme Information', 'affiliate-marketing-business' ); ?></button>
				<a class="tablinks tablinks-demo" role="tab" href="<?php echo esc_url( AFFILIATE_MARKETING_BUSINESS_LIVE_DEMO ); ?>" target="_blank">
					<?php esc_html_e( 'Live Demo', 'affiliate-marketing-business' ); ?>
				</a>
				<a class="tablinks tablinks-pro" role="tab" href="<?php echo esc_url( AFFILIATE_MARKETING_BUSINESS_BUY_PRO ); ?>" target="_blank">
					<?php esc_html_e( 'Buy Pro', 'affiliate-marketing-business' ); ?>
				</a>
			</div>
			<div  id="bwp_getstart" class="tabcontent">
				<div class="row">
					<div class="col-md-5 intro">
						<div class="pad-box">
							<h2><?php esc_html_e( 'Welcome to Affiliate Marketing Business ', 'affiliate-marketing-business' ); ?>
							<span><?php esc_html_e( 'Version: ', 'affiliate-marketing-business' ); ?><?php echo esc_html($affiliate_marketing_business_theme['Version']);?></span>
							</h2>
							<span class="intro__version"><?php esc_html_e( 'Congratulations! You are about to use the most easy to use and flexible WordPress theme.', 'affiliate-marketing-business' ); ?>
							</span>
							<div class="powered-by">
								<p><strong><?php esc_html_e( 'Theme created by Buy WP Templates', 'affiliate-marketing-business' ); ?></strong></p>
								<p>
									<img class="logo" src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/theme-logo.png'); ?>"/>
								</p>
								<div class="demo-content">
									<?php
										/* Demo Import */
										require get_parent_theme_file_path( '/inc/dashboard/demo-content.php' );
									?>
								</div>

								<div id="demo-import-loader">
									<img src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/spinner.gif'); ?>" alt="<?php echo esc_attr( 'Loading...', 'affiliate-marketing-business'); ?>" />
								</div>
							</div>
						</div>
					</div>
					<div class="col-md-7">
						<div class="install-plugins">
							<img src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/responsive1.png'); ?>" alt="<?php echo esc_attr( 'responsive-image', 'affiliate-marketing-business'); ?>" />
						</div>
					</div>
				</div>
				<div class="dashboard__blocks">
					<div class="row">
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Get Support','affiliate-marketing-business'); ?></h3>
							<ol>
								<li><a target="_blank" href="<?php echo esc_url( AFFILIATE_MARKETING_BUSINESS_FREE_SUPPORT ); ?>"><?php esc_html_e( 'Free Theme Support','affiliate-marketing-business'); ?></a></li>
								<li><a target="_blank" href="<?php echo esc_url( AFFILIATE_MARKETING_BUSINESS_PRO_SUPPORT ); ?>"><?php esc_html_e( 'Premium Theme Support','affiliate-marketing-business'); ?></a></li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Getting Started','affiliate-marketing-business'); ?></h3>
							<ol>
								<li><?php esc_html_e( 'Start','affiliate-marketing-business'); ?> <a target="_blank" href="<?php echo esc_url( admin_url('customize.php') ); ?>"><?php esc_html_e( 'Customizing','affiliate-marketing-business'); ?></a> <?php esc_html_e( 'your website.','affiliate-marketing-business'); ?> </li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Help Docs','affiliate-marketing-business'); ?></h3>
							<ol>
								<li><a target="_blank" href="<?php echo esc_url( AFFILIATE_MARKETING_BUSINESS_FREE_DOC ); ?>"><?php esc_html_e( 'Free Theme Documentation','affiliate-marketing-business'); ?></a></li>
								<li><a target="_blank" href="<?php echo esc_url( AFFILIATE_MARKETING_BUSINESS_PRO_DOC ); ?>"><?php esc_html_e( 'Premium Theme Documentation','affiliate-marketing-business'); ?></a></li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Buy Premium','affiliate-marketing-business'); ?></h3>
							<ol>
								<a href="<?php echo esc_url( AFFILIATE_MARKETING_BUSINESS_BUY_PRO ); ?>" target="_blank"><?php esc_html_e('Buy Pro', 'affiliate-marketing-business'); ?></a>
							</ol>
						</div>
					</div>
				</div>
			</div>
			<div  id="bwp_setup" class="tabcontent">
				<h2 class="tg-docs-section intruction-title" id="section-4"><?php esc_html_e( '1) Setup Affiliate Marketing Business Theme', 'affiliate-marketing-business' ); ?></h2>
				<div class="row">
					<div class="theme-instruction-block col-md-7">
						<div class="pad-box">
							<p><?php esc_html_e( 'Affiliate Marketing Business is a powerful and versatile solution tailored for online affiliate businesses, digital marketing professionals, bloggers, entrepreneurs, and eCommerce startups, making it an ideal choice for a modern agency or consulting service, enriched with relevant search terms like affiliate niche sites, coupon deals, discount codes, comparison charts, review blogs, product listings, funnels, landing pages, lead magnets, SEO optimization, schema-rich snippets, conversion optimization, A/B testing, analytics tracking, influencer promotions, pay-per-click campaigns, and high-ticket affiliate offers. It provides a clean, user-friendly layout ideal for promoting affiliate programs, referral systems, partner networks, CPA models, and niche websites while supporting dashboards, mega menus, call-to-action blocks, ad placements, banner creatives, and responsive templates suited for marketing campaigns and professional agency presentation. With a fully responsive design, it ensures seamless browsing on all devices, boosting engagement and conversion rates while supporting growth-driven consulting strategies. The platform is optimized for SEO and content monetization, helping websites rank higher in search results and attract organic traffic with structured content and performance-focused design. Its built-in tools support affiliate link management, commission tracking, lead generation, product reviews, comparison tables, sales funnels, and content strategies along with features for product filtering, keyword-rich blog posts, email automation, social promotion, and micro-niche targeting, making it perfect for scalable business operations. Whether focusing on digital products, online courses, SaaS tools, influencer collaborations, social media campaigns, or email automation, this solution simplifies operations while maximizing efficiency. Advanced features include integration with tracking pixels, cookies for accurate sales attribution, and detailed performance analytics, enabling data-driven decision-making for consulting professionals. Customization options allow businesses to align their website with brand identity using templates, banners, and call-to-action sections tailored for agency branding. It supports plugins like ThirstyAffiliates, Pretty Links, and AffiliateWP Addons for link cloaking, automated link generation, affiliate recruitment, redirects, smart link categorization, and tracking, enhancing overall functionality. Designed for all levels, it offers resources for beginners and advanced users alike, making it easy to set up networks, manage campaigns, publish high-converting content, and scale revenue streams. With social media integration, blogging features, SEO-friendly structure, and community engagement options, this theme helps strengthen partnerships, boost conversions, and grow a successful affiliate business.', 'affiliate-marketing-business' ); ?><p><br>
							<ol>
								<li><?php esc_html_e( 'Start','affiliate-marketing-business'); ?> <a target="_blank" href="<?php echo esc_url( admin_url('customize.php') ); ?>"><?php esc_html_e( 'Customizing','affiliate-marketing-business'); ?></a> <?php esc_html_e( 'your website.','affiliate-marketing-business'); ?> </l>
								<li><?php esc_html_e( 'Affiliate Marketing Business','affiliate-marketing-business'); ?> <a target="_blank" href="<?php echo esc_url( AFFILIATE_MARKETING_BUSINESS_FREE_DOC ); ?>"><?php esc_html_e( 'Documentation','affiliate-marketing-business'); ?></a> </li>
							</ol>
						</div>
					</div>
					<div class="col-md-5">
						<div class="pad-box">
								<img class="logo" src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/screenshot.png'); ?>"/>
						</div>
					</div>	
				</div>
			</div>
			<div class="col-md-12 text-block tabcontent"  id="bwp_premium_info">
				<h2 class="dashboard-install-title"><?php esc_html_e( '2) Premium Theme Information.','affiliate-marketing-business'); ?></h2>
				<div class="row">
					<div class="col-md-7">
						<img src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/responsive.png'); ?>" alt="<?php echo esc_attr( 'responsive-image', 'affiliate-marketing-business'); ?>">
						<div class="pad-box">
							<h3><?php esc_html_e( 'Pro Theme Description','affiliate-marketing-business'); ?></h3>
							<p class="pad-box-p"><?php esc_html_e( 'Affiliate Marketing Business is a robust and versatile WordPress theme designed for online affiliate businesses and marketing professionals. This theme offers a sleek, clean layout that is user-friendly and visually appealing, making it perfect for showcasing affiliate programs and partner marketing opportunities. With its responsive design, the theme ensures a seamless browsing experience across all devices, enhancing both user engagement and conversion rates. This theme is optimized for SEO, helping your affiliate content rank higher in search engine results and attract more organic traffic. The built-in affiliate management tools allow you to efficiently track affiliate links, manage commissions, e-commerce, digital products, online services, lead generation, product reviews, content marketing, sales funnels, social media marketing, email campaigns, influencer marketing, affiliate networks, niche marketing, commission tracking, online revenue and monitor performance with detailed analytics. You can easily integrate affiliate tracking pixels and cookies, ensuring accurate tracking of affiliate sales and revenue sharing. Customization options are extensive, allowing you to tailor the design to match your brands identity. Choose from various affiliate marketing templates, affiliate banners, and creatives to create a professional and cohesive look. The theme supports multiple affiliate plugins, enhancing functionality with features like affiliate links generator, referral marketing, and affiliate recruitment tools. Additionally, the Affiliate Marketing Business WordPress Theme provides resources for both beginners and advanced marketers. Engage with the affiliate community through blogs, forums, and social media integrations, fostering collaboration and growth.', 'affiliate-marketing-business'  ); ?><p>
						</div>
					</div>
					<div class="col-md-5 install-plugin-right">
						<div class="pad-box">
							<h3><?php esc_html_e( 'Pro Theme Features','affiliate-marketing-business'); ?></h3>
							<div class="dashboard-install-benefit">
								<ul>
									<li><?php esc_html_e( 'Theme options using Customizer API','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Responsive design','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Site Icon and Logo option','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Header Images option','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Favicon, Logo, title, and tagline customization','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Advanced Color options and color pallets','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( '100+ Font Family Options','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Pagination option','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Demo Importer','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Enable-Disable options on All sections','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Main Slider','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Woocommerce Compatible','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Unlimited Slides','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Section to show categories','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Product Listing based on category','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Top Categories Section','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Best Seller Tab','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Testimonial with custom post type','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Promotional Banners','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Partner Listing','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Shortcodes for Testimonials','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Newsletter with the help of contact form 7.','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Well-sanitized as per WordPress standards.','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Responsive layout for all devices','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Typography for the complete website','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Global Color pallete','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Section specific Color pallete','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Fully integrated with Font Awesome Icon','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Instagram Section','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Partner Listing','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Background Image Option','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Custom page templates','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Allow setting site title, tagline, logo','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Left and Right Sidebar','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Sticky post & Comment threads','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Customizable Home Page','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Multiple inner page templates','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Contact Page Template','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Blog Full width and right and left sidebar','affiliate-marketing-business'); ?></li>
									<li><?php esc_html_e( 'Recent post widget with images, Related post','affiliate-marketing-business'); ?></li>
								</ul>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

<?php }?>
