	<?php
	// Assicuriamoci che la funzione is_plugin_active sia disponibile.
	if ( ! function_exists( 'is_plugin_active' ) ) {
		include_once ABSPATH . 'wp-admin/includes/plugin.php';
	}

	$pro_plugin_path = 'qrcdr-pro/qrcdr-pro.php';
	$templates_plugin_path = 'qrcdr-templates/qrcdr-templates.php';

	$is_pro_installed = $this->is_plugin_installed( $pro_plugin_path );
	$is_templates_installed = $this->is_plugin_installed( $templates_plugin_path );

	$is_pro_active = is_plugin_active( $pro_plugin_path );
	$is_templates_active = is_plugin_active( $templates_plugin_path );

	$images_path = 'https://assets.qrcdr.pro/images';
	$shop_path = 'https://veno.es/shop';
	?>

	<aside class="qrcdr-sidebar" style="display: block;">
		<div class="qrcdr-pro-teaser-sidebar <?php echo ! $is_pro_active ? 'is-locked' : ''; ?>">
			<?php
			if ( ! $is_pro_active ) :
				?>
				<div class="qrcdr-upsell-promo">
					<div>
					<h2>Stop generating QR codes for free.
					<br><span class="marker-underline">Start getting paid for them</span></h2>

					</div>
					<p>QRcdr PRO turns this tool into a branded SaaS.
					<br>Dynamic codes, subscription plans, Stripe billing.</p>
					<p>One setup, recurring revenue every month.</p>

					<div class="qrcdr-upsell-cta">
						<a href="<?php echo esc_url( $shop_path ); ?>/product/qrcdr-pro-bundle/?utm_source=wp-plugin" target="_blank" class="button-hero">
							Upgrade to PRO & Start Earning
						</a>
					</div>
				</div>
	
				<div id="qr-modal-payments" style="display:none">
					<div class="qr-modal-promo">
						<div class="qr-modal-col qr-col-stretch">
							<div>
								<h4>Monetize your QR code service instantly.</h4>
								<p>Seamlessly integrate Stripe to accept global payments, manage automatic webhooks for real-time transactions, and test your setup with a dedicated Sandbox mode.</p>
								<div class="qr-margin-b">
									<a href="<?php echo esc_url( $shop_path ); ?>/product/qrcdr-pro/?utm_source=wp-plugin" target="_blank" class="button">Get QRcdr PRO</a>
								</div>
							</div>
							<img src="<?php echo esc_url( $images_path ); ?>/payments-modal.jpg">
						</div>

						<div class="qr-modal-col">
							<img src="<?php echo esc_url( $images_path ); ?>/payments.jpg">
						</div>
					</div>
				</div>
				<div id="qr-modal-plans" style="display:none">
					<div class="qr-modal-promo">
						<div class="qr-modal-col qr-col-stretch">
							<div>
								<h4>Design your business model.</h4>
								<p>Create and manage multiple subscription tiers by defining custom descriptions, exclusive feature lists, pricing, and billing cycles (monthly/yearly) to suit your customers' needs.</p>
								<div class="qr-margin-b">
									<a href="<?php echo esc_url( $shop_path ); ?>/product/qrcdr-pro/?utm_source=wp-plugin" target="_blank" class="button">Get QRcdr PRO</a>
								</div>
							</div>
							<img src="<?php echo esc_url( $images_path ); ?>/pricing-table.jpg">
						</div>

						<div class="qr-modal-col">
							<img src="<?php echo esc_url( $images_path ); ?>/plans.jpg">
						</div>
					</div>
				</div>
				<div id="qr-modal-customers" style="display:none">
					<div class="qr-modal-promo">
						<div class="qr-modal-col qr-col-stretch">
							<div>
								<h4>Full control over your user base.</h4>
								<p>Monitor your subscribers, manually assign or revoke memberships, use advanced filters to segment your audience, and keep your database clean by purging unverified users.</p>
								<div class="qr-margin-b">
									<a href="<?php echo esc_url( $shop_path ); ?>/product/qrcdr-pro/?utm_source=wp-plugin" target="_blank" class="button">Get QRcdr PRO</a>
								</div>
							</div>
							<img src="<?php echo esc_url( $images_path ); ?>/customer-account.jpg">
						</div>
						<div class="qr-modal-col">
							<img src="<?php echo esc_url( $images_path ); ?>/customers.jpg">
						</div>
					</div>
				</div>
				<div id="qr-modal-pages" style="display:none">
					<div class="qr-modal-promo">
						<div class="qr-modal-col qr-col-stretch">
							<div>
								<h4>Streamline the user experience.</h4>
								<p>Easily assign and configure essential front-end pages, such as the User Account dashboard and your Pricing table, to create a professional SaaS environment.</p>
								<div class="qr-margin-b">
									<a href="<?php echo esc_url( $shop_path ); ?>/product/qrcdr-pro/?utm_source=wp-plugin" target="_blank" class="button">Get QRcdr PRO</a>
								</div>
							</div>
							<img src="<?php echo esc_url( $images_path ); ?>/login.jpg">
						</div>
						<div class="qr-modal-col">
							<img src="<?php echo esc_url( $images_path ); ?>/pages.jpg">
						</div>
					</div>
				</div>
				<div id="qr-modal-emails" style="display:none">
					<div class="qr-modal-promo">
						<div class="qr-modal-col qr-col-stretch">
							<div>
								<h4>Maintain a consistent brand identity.</h4>
								<p>Customize all system-generated emails sent to your customers by adding your own logo, adjusting brand colors, and tailoring the content for a true white-label experience.</p>
								<div class="qr-margin-b">
									<a href="<?php echo esc_url( $shop_path ); ?>/product/qrcdr-pro/?utm_source=wp-plugin" target="_blank" class="button">Get QRcdr PRO</a>
								</div>
							</div>
							<img src="<?php echo esc_url( $images_path ); ?>/email-preview.jpg">
						</div>
						<div class="qr-modal-col">
							<img src="<?php echo esc_url( $images_path ); ?>/emails.jpg">
						</div>
					</div>

				</div>
				<div id="qr-modal-templates" style="display:none">
					<div class="qr-modal-promo">
						<div class="qr-modal-col qr-col-stretch">
							<div>
								<h4>Maintain a consistent brand identity.</h4>
								<p>Customize all system-generated emails sent to your customers by adding your own logo, adjusting brand colors, and tailoring the content for a true white-label experience.</p>
								<div class="qr-margin-b">
									<a href="<?php echo esc_url( $shop_path ); ?>/product/qrcdr-templates/?utm_source=wp-plugin" target="_blank" class="button">Get QRcdr Templates</a>
								</div>
							</div>
							<img src="<?php echo esc_url( $images_path ); ?>/templates-ui.jpg">
						</div>
						<div class="qr-modal-col">
							<img src="<?php echo esc_url( $images_path ); ?>/templates.jpg">
						</div>
					</div>
				</div>
				<?php
			endif;
			?>
			<span class="qrcdr-badge"><?php esc_html_e( 'PRO Features', 'qrcdr' ); ?></span>

			<ul class="qrcdr-sidebar-links">
				<!-- Link condizionali per QRcdr PRO -->
				<li>
					<a href="<?php echo ! $is_pro_active ? '#' : 'admin.php?page=qrcdr-payment-gateways'; ?>"<?php echo $is_pro_active ? '' : ' data-qrcdr-admin-modal="#qr-modal-payments" data-modal-title="' . esc_html__( 'Payments', 'qrcdr' ) . '"'; ?> data-modal-group="qrcdr-upsell">
						<span class="dashicons dashicons-cart"></span> <?php esc_html_e( 'Payments', 'qrcdr' ); ?>
					</a>
				</li>
				<li>
					<a href="<?php echo ! $is_pro_active ? '#' : 'admin.php?page=qrcdr-subscription-plans'; ?>"<?php echo $is_pro_active ? '' : ' data-qrcdr-admin-modal="#qr-modal-plans" data-modal-title="' . esc_html__( 'Subscription Plans', 'qrcdr' ) . '"'; ?> data-modal-group="qrcdr-upsell">
						<span class="dashicons dashicons-calendar-alt"></span> <?php esc_html_e( 'Subscription Plans', 'qrcdr' ); ?>
					</a>
				</li>
				<li>
					<a href="<?php echo ! $is_pro_active ? '#' : 'admin.php?page=qrcdr-subscribed-users'; ?>"<?php echo $is_pro_active ? '' : ' data-qrcdr-admin-modal="#qr-modal-customers" data-modal-title="' . esc_html__( 'Customers', 'qrcdr' ) . '"'; ?> data-modal-group="qrcdr-upsell">
						<span class="dashicons dashicons-admin-users"></span> <?php esc_html_e( 'Customers', 'qrcdr' ); ?>
					</a>
				</li>
				<li>
					<a href="<?php echo ! $is_pro_active ? '#' : 'admin.php?page=qrcdr-settings-pages'; ?>"<?php echo $is_pro_active ? '' : ' data-qrcdr-admin-modal="#qr-modal-pages" data-modal-title="' . esc_html__( 'Pages', 'qrcdr' ) . '"'; ?> data-modal-group="qrcdr-upsell">
						<span class="dashicons dashicons-admin-settings"></span> <?php esc_html_e( 'Pages', 'qrcdr' ); ?>
					</a>
				</li>
				<li>
					<a href="<?php echo ! $is_pro_active ? '#' : 'admin.php?page=qrcdr-email-settings'; ?>"<?php echo $is_pro_active ? '' : ' data-qrcdr-admin-modal="#qr-modal-emails" data-modal-title="' . esc_html__( 'E-Mails', 'qrcdr' ) . '"'; ?> data-modal-group="qrcdr-upsell">
						<span class="dashicons dashicons-email"></span> <?php esc_html_e( 'E-Mails', 'qrcdr' ); ?>
					</a>
				</li>
				<li>
					<a href="<?php echo ! $is_pro_active ? '#' : 'admin.php?page=qrcdr-settings-templates'; ?>"<?php echo $is_pro_active ? '' : ' data-qrcdr-admin-modal="#qr-modal-templates" data-modal-title="' . esc_html__( 'Templates', 'qrcdr' ) . '"'; ?> data-modal-group="qrcdr-upsell">
						<span class="dashicons dashicons-email"></span> <?php esc_html_e( 'Templates', 'qrcdr' ); ?>
					</a>
				</li>
			</ul>
		</div>
	</aside>
</div>