课程落地页


<?php /**
 * WordPress SaaS 2.0 Course Landing Page Shortcode - Updated for Enrolled Users
 * Add this code to your theme's functions.php or create a custom plugin
 * Usage: [wordpress_saas_landing]
 */


/**
 * Get real member avatars and count for social proof
 */
function get_wp_saas_social_proof_data() {
    // Check cache first
    $cached_avatars = get_transient('wp_saas_member_avatars');
    $cached_count = get_transient('wp_saas_member_count');
	
	
	if ($cached_avatars !== false && $cached_count !== false) {
        return array(
            'avatars' => $cached_avatars,
            'count' => $cached_count
        );
    }
    
   
    
    // Get all users to count total members
    $all_users = get_users(array(
        'number' => -1
    ));
    
    $total_count = 0;
    
    // Count all members with course access
    foreach ($all_users as $user) {
        if (lwh_is_user_power_member_old($user->ID)) {
            $total_count++;
        }
    }
    
    // Get recent users for avatar collection
    $recent_users = get_users(array(
        'orderby' => 'registered',
        'order' => 'DESC',
        'number' => 500 // Increased to find more users with custom avatars
    ));
    
    $avatars = array();
    
    foreach ($recent_users as $user) {
        // Stop if we have 10 avatars
        if (count($avatars) >= 10) {
            break;
        }
        
        // Check if user has course access
        if (lwh_is_user_power_member_old($user->ID)) {
            // Get avatar URL
            $avatar_url = get_avatar_url($user->ID, array('size' => 150));
            
            // Skip if URL contains buddyboss
            if (stripos($avatar_url, 'buddyboss') !== false) {
                continue;
            }
            
            // Skip if it's a default gravatar
            if (stripos($avatar_url, 'gravatar.com') !== false && 
                (stripos($avatar_url, 'd=mm') !== false || 
                 stripos($avatar_url, 'd=mystery') !== false || 
                 stripos($avatar_url, 'd=blank') !== false)) {
                continue;
            }
            
            // Add the avatar (removed the header check as it might be blocking valid images)
            $avatars[] = $avatar_url;
        }
    }
    
    // Cache the results for 24 hours
    set_transient('wp_saas_member_avatars', $avatars, DAY_IN_SECONDS);
    set_transient('wp_saas_member_count', $total_count, DAY_IN_SECONDS);
    
    return array(
        'avatars' => $avatars,
        'count' => $total_count
    );
}

function wordpress_saas_landing_page_shortcode() {
    ob_start();
    
    // Configuration JSON - Easy to edit all content here
    $config = json_decode('{
		 "hero": {
		    "image": "https://learnwithhasan.com/wp-content/uploads/2025/06/wp-saas-2.png",
		    "badge": "WordPress SaaS 2.0",
			"heading": "Build Your MicroSaaS in Days, Not Months - With WordPress!",
			"subheading": "The Only Course That Teaches You to Build Real SaaS, MicroSaas, or Online Tools on WordPress, FAST!",
			"lastUpdated": "June 2025",
			"buttonText": "Get Instant Access →",
			"enrolledButtonText": "Go To The Course →",
			"socialProof": {
				"text": "solopreneurs already joined!",
				"rating": "4.9",
				"reviews": "487"
			}
		},
  
        "curriculum": {
            "heading": "What You\'ll Master",
            "items": [
                {
                    "icon": "🎯",
                    "title": "WordPress API Mastery",
                    "description": "Build custom API endpoints, handle POST/GET requests, and create secure backends"
                },
                {
                    "icon": "🤖",
                    "title": "AI Integration",
                    "description": "Connect with OpenAI and build AI-powered tools with structured JSON responses"
                },
                {
                    "icon": "🎨",
                    "title": "Professional UI Development",
                    "description": "Create stunning interfaces with HTML, CSS, JS, AlpineJS, and Tailwind"
                },
                {
                    "icon": "🔐",
                    "title": "Security Implementation",
                    "description": "Add reCAPTCHA, user authentication, and protect your tools from abuse"
                },
                {
                    "icon": "💳",
                    "title": "Monetization Systems",
                    "description": "Implement token systems with MyCred and create sustainable revenue streams"
                },
                {
                    "icon": "🔗",
                    "title": "No-Code Integration",
                    "description": "Connect with n8n, Make.com, and webhooks for powerful automations"
                },
                {
                    "icon": "💬",
                    "title": "Real-World Projects",
                    "description": "Build chatbots, calculators, and interactive tools users will love"
                },
                {
                    "icon": "🔌",
                    "title": "Plugin Development",
                    "description": "Transform snippets into professional WordPress plugins with GitHub integration"
                }
            ]
        },
        "showcase": {
            "heading": "See What You Can Build",
            "projects": [
                {
                    "imageUrl": "https://learnwithhasan.com/wp-content/uploads/2025/06/Screenshot-2025-06-06-215941.png",
                    "title": "TubeDigest.com",
                    "description": "A powerful YouTube content analysis tool built entirely on WordPress using the techniques from this course.",
                    "link": "https://tubedigest.com",
                    "linkText": "View Live Site →"
                },
                {
                    "imageUrl": "https://learnwithhasan.com/wp-content/uploads/2025/06/Screenshot-2025-06-06-220112.png",
                    "title": "PromoterKit.com",
                    "description": "A comprehensive marketing toolkit with multiple tools, all powered by WordPress and custom APIs.",
                    "link": "https://promoterkit.com",
                    "linkText": "View Live Site →"
                }
            ]
        },
        "faqs": [
            {
                "question": "Do I need to know PHP or advanced programming?",
                "answer": "No! While basic WordPress knowledge helps, we provide all the code snippets you need. You\'ll learn to use AI coding assistants to build professional tools without being a developer."
            },
            {
                "question": "Can I really build a SaaS on WordPress?",
                "answer": "Absolutely! WordPress powers 43% of the web for a reason. With custom APIs and modern frontend techniques, you can build powerful SaaS applications. Our showcase sites prove it works!"
            },
            {
                "question": "What kind of tools can I build?",
                "answer": "The possibilities are endless! Build AI-powered tools, calculators, content generators, analytics dashboards, chatbots, automation tools, and any interactive web application you can imagine."
            },
            {
                "question": "How often is the course updated?",
                "answer": "We add new content monthly! You\'ll get fresh examples, new code snippets, latest techniques, and additional lectures to keep your skills cutting-edge."
            },
            {
                "question": "Is this suitable for beginners?",
                "answer": "Yes! We start with the basics and gradually build up. If you can install WordPress and follow instructions, you can build SaaS tools with our step-by-step approach."
            }
        ],
		"faqContact": {
			"heading": "Still Have Questions?",
			"text": "We are here to help! Feel free to reach out.",
			"buttonText": "Contact Us",
			"buttonUrl": "/contact-us"
		},
        "cta": {
            "heading": "Ready to Build Your WordPress SaaS?",
            "subheading": "Join hundreds of students who are already building and monetizing their tools",
            "buttonText": "Enroll Now & Start Building",
            "enrolledButtonText": "Continue Your Learning Journey →"
        }
    }', true);
    
    // Check if user is already enrolled
    $is_enrolled = lwh_is_user_power_member_old();
    
    // Define URLs
    $course_url = "https://learnwithhasan.com/learn/wordpress-saas-2-0/lessons/welcome-to-wp-saas-2-0/";
    $enrollment_url = "https://learnwithhasan.com/membership-levels/";
    
    ?>
    <style>
        /* Landing Page Styles */
        .wp-saas-landing {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            line-height: 1.6;
            color: #0d2451;
            overflow-x: hidden;
        }
        
        .wp-saas-landing * {
            box-sizing: border-box;
        }
        
        .wp-saas-container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
        }
        
        /* Enrolled User Banner */
        .wp-saas-enrolled-banner {
            background: #28a745;
            color: white;
            padding: 20px 0;
            text-align: center;
        }
        
        .wp-saas-enrolled-banner .container {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 20px;
            flex-wrap: wrap;
        }
        
        .wp-saas-enrolled-banner p {
            margin: 0;
            font-size: 1.2em;
            font-weight: 600;
        }
        
        .wp-saas-enrolled-banner .wp-saas-btn {
            background: white;
            color: #28a745;
            padding: 10px 30px;
            font-size: 1em;
        }
        
        .wp-saas-enrolled-banner .wp-saas-btn:hover {
            background: #f8f9fa;
        }
        
        /* Hero Section */
        .wp-saas-hero {
            background: white;
            background-image: 
                radial-gradient(circle at 20% 50%, rgba(255, 107, 107, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255, 107, 107, 0.03) 0%, transparent 50%);
            color: #0d2451;
            padding: 20px 0 80px 0;
            text-align: center;
            position: relative;
            overflow: hidden;
            border-bottom: 1px solid #e9ecef;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        }
        
        .wp-saas-hero::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(255, 107, 107, 0.03) 0%, transparent 70%);
            animation: pulse 20s ease-in-out infinite;
        }
        
        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); }
        }
        
        .wp-saas-hero .hero-image {
            width: 200px;
            height: 200px;
            margin: 0 auto 15px auto;
            position: relative;
            z-index: 1;
            transition: transform 0.3s ease;
        }
        
        .wp-saas-hero .hero-image:hover {
            transform: scale(1.05);
        }
        
        .wp-saas-hero .hero-image img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            display: block;
        }
        
        .wp-saas-hero .badge {
            display: inline-block;
            background: #ff6b6b;
            color: white;
            padding: 8px 20px;
            border-radius: 30px;
            font-size: 0.9em;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: 20px;
            position: relative;
            z-index: 1;
            box-shadow: 0 3px 10px rgba(255, 107, 107, 0.3);
        }
        
        .wp-saas-hero h1 {
			font-size: 3.5em;
			margin-bottom: 20px;
			font-weight: 700;
			position: relative;
			z-index: 1;
			color: #0d2451;
		}
		
		@media (max-width: 768px) {
			.wp-saas-hero h1 {
				font-size: 2em; /* Reduced from 3.5em */
				line-height: 1.2;
				margin-bottom: 15px;
			}
		}
        
        .wp-saas-hero .subtitle {
            font-size: 1.5em;
            margin-bottom: 20px;
            opacity: 0.8;
            position: relative;
            z-index: 1;
            color: #0d2451;
        }
        
        .wp-saas-hero .last-updated {
            font-size: 1em;
            opacity: 0.6;
            margin-bottom: 30px;
            position: relative;
            z-index: 1;
            color: #0d2451;
        }
        
        .wp-saas-btn {
            display: inline-block;
            padding: 15px 40px;
            background: #ff6b6b;
            color: white;
            text-decoration: none;
            border-radius: 50px;
            font-weight: 600;
            font-size: 1.1em;
            transition: all 0.3s ease;
            position: relative;
            z-index: 1;
            box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        }
        
        .wp-saas-btn:hover {
            background: #ff5252;
            transform: translateY(-2px);
            box-shadow: 0 7px 20px rgba(0,0,0,0.3);
            color: white;
            text-decoration: none;
        }
        
        /* Enrolled User Button Styles */
        .wp-saas-btn.enrolled {
            background: #28a745;
            box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
        }
        
        .wp-saas-btn.enrolled:hover {
            background: #218838;
            box-shadow: 0 7px 20px rgba(40, 167, 69, 0.4);
            color: white;
        }
        
        /* Comparison Section */
        .wp-saas-comparison {
            padding: 80px 0;
            background: white;
        }
        
        .wp-saas-comparison h2 {
            text-align: center;
            font-size: 2.5em;
            margin-bottom: 50px;
            color: #333;
        }
        
        .comparison-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
            gap: 40px;
            max-width: 1000px;
            margin: 0 auto;
        }
        
        .comparison-card {
            padding: 40px;
            border-radius: 15px;
            position: relative;
            transition: transform 0.3s ease;
        }
        
        .comparison-card.engineer {
            background: #f8f9fa;
            border: 2px solid #e9ecef;
        }
        
        .comparison-card.entrepreneur {
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            border: 2px solid #4a5568;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        }
        
        .comparison-card.entrepreneur::before {
            content: 'RECOMMENDED';
            position: absolute;
            top: -12px;
            right: 20px;
            background: #ff6b6b;
            color: white;
            padding: 5px 20px;
            border-radius: 20px;
            font-size: 0.8em;
            font-weight: 600;
        }
        
        .comparison-card:hover {
            transform: translateY(-5px);
        }
        
        .comparison-card h3 {
            font-size: 1.8em;
            margin-bottom: 25px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .comparison-card.engineer h3 {
            color: #6c757d;
        }
        
        .comparison-card.entrepreneur h3 {
            color: #0d2451;
        }
        
        .comparison-list {
            list-style: none;
            padding: 0;
            margin: 0;
        }
        
        .comparison-list li {
            padding: 12px 0;
            display: flex;
            align-items: flex-start;
            gap: 10px;
            font-size: 1.1em;
            line-height: 1.6;
        }
        
        .comparison-card.engineer .comparison-list li {
            color: #6c757d;
        }
        
        .comparison-card.entrepreneur .comparison-list li {
            color: #0d2451;
            font-weight: 500;
        }
        
        /* Features Grid */
        .wp-saas-features {
            padding: 80px 0;
            background: #f8f9fa;
        }
        
        .wp-saas-features h2 {
            text-align: center;
            font-size: 2.5em;
            margin-bottom: 50px;
            color: #0d2451;
        }
        
        .features-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 30px;
            margin-bottom: 50px;
        }
        
        .feature-card {
            background: white;
            padding: 30px;
            border-radius: 10px;
            box-shadow: 0 5px 20px rgba(0,0,0,0.1);
            transition: transform 0.3s ease;
        }
        
        .feature-card:hover {
            transform: translateY(-5px);
        }
        
        .feature-icon {
            font-size: 3em;
            margin-bottom: 20px;
        }
        
        .feature-card h3 {
            font-size: 1.5em;
            margin-bottom: 15px;
            color: #333;
        }
        
        /* What You'll Learn */
        .wp-saas-curriculum {
            padding: 80px 0;
            background: white;
        }
        
        .wp-saas-curriculum h2 {
            text-align: center;
            font-size: 2.5em;
            margin-bottom: 50px;
            color: #0d2451;
        }
        
        .curriculum-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
        }
        
        .curriculum-item {
            padding: 20px;
            border-left: 4px solid #4a5568;
            background: #f8f9fa;
            border-radius: 5px;
            transition: all 0.3s ease;
        }
        
        .curriculum-item:hover {
            background: #e9ecef;
            border-left-color: #ff6b6b;
        }
        
        .curriculum-item h4 {
            font-size: 1.2em;
            margin-bottom: 10px;
            color: #0d2451;
        }
        
        .curriculum-item p {
            color: #0d2451;
            opacity: 0.8;
        }
        
        /* Showcase Section */
        .wp-saas-showcase {
            padding: 80px 0;
            background: #f8f9fa;
            position: relative;
        }

        .wp-saas-showcase h2 {
            text-align: center;
            font-size: 2.5em;
            margin-bottom: 50px;
            color: #0d2451;
        }

        /* Showcase Slider Container */
        .showcase-slider-container {
            position: relative;
            max-width: 1200px;
            margin: 0 auto;
            overflow: hidden;
            padding: 0 80px;
        }

        .showcase-slider {
            display: flex;
            transition: transform 0.5s ease;
            gap: 40px;
        }

        .showcase-item {
            flex: 0 0 calc(50% - 20px);
            background: white;
            border-radius: 15px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            border: none !important;
            border-bottom: none !important;
            outline: none !important;
            box-sizing: border-box;
        }

        @media (max-width: 768px) {
			
			.wp-saas-showcase {
				display: none;
			}
			
			.showcase-slider-container {
				padding: 0 60px;
			}

			.showcase-item {
				flex: 0 0 100%; 
			}
			
		    .showcase-slider {
				gap: 20px; /* Reduced from 40px */
			}
		}

        .showcase-item:hover {
            transform: translateY(-10px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.15);
        }

        .showcase-image {
            height: 250px;
            overflow: hidden;
            background: #e9ecef;
            position: relative;
        }

        .showcase-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.3s ease;
        }

        .showcase-item:hover .showcase-image img {
            transform: scale(1.05);
        }

        .showcase-content {
            padding: 30px;
            background: white;
            position: relative;
            z-index: 1;
            border: none !important;
            border-bottom: none !important;
            border-top: none !important;
            margin: 0;
        }

        .showcase-content h3 {
            font-size: 1.5em;
            margin-bottom: 15px;
            color: #0d2451;
            font-weight: 600;
        }

        .showcase-content p {
            color: #0d2451;
            opacity: 0.8;
            line-height: 1.6;
            margin-bottom: 20px;
        }

        .showcase-link {
            display: inline-block;
            margin-top: 15px;
            color: #ff6b6b;
            text-decoration: none;
            font-weight: 600;
            transition: color 0.3s ease;
        }

        .showcase-link:hover {
            color: #ff5252;
            text-decoration: none;
        }

        /* Slider Navigation */
        .showcase-nav {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background: rgba(255, 107, 107, 0.9);
            color: white;
            border: none;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            font-size: 1.5em;
            cursor: pointer;
            z-index: 10;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
        }

        .showcase-nav:hover {
            background: #ff5252;
            transform: translateY(-50%) scale(1.1);
            box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
        }

        .showcase-nav.prev {
            left: 20px;
        }

        .showcase-nav.next {
            right: 20px;
        }

        .showcase-nav:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: translateY(-50%) scale(1);
        }

        .showcase-nav:disabled:hover {
            background: rgba(255, 107, 107, 0.9);
            transform: translateY(-50%) scale(1);
        }

        /* Slider Dots */
        .showcase-dots {
            text-align: center;
            margin-top: 40px;
        }

        .showcase-dot {
            display: inline-block;
            width: 12px;
            height: 12px;
            background: #ccc;
            border-radius: 50%;
            margin: 0 8px;
            cursor: pointer;
            transition: all 0.3s ease;
            border: 2px solid transparent;
        }

        .showcase-dot:hover {
            background: #ff6b6b;
            transform: scale(1.2);
        }

        .showcase-dot.active {
            background: #ff6b6b;
            border-color: #ff6b6b;
            transform: scale(1.3);
        }
        
        /* FAQ Section */
		/* FAQ Contact Section */
		.wp-saas-faq-contact {
			text-align: center;
			margin-top: 60px;
			padding: 50px 30px;
			background: #f8f9fa;
			border-radius: 15px;
			box-shadow: 0 5px 20px rgba(0,0,0,0.05);
		}

		.wp-saas-faq-contact h3 {
			font-size: 2em;
			margin-bottom: 15px;
			color: #0d2451;
		}

		.wp-saas-faq-contact p {
			font-size: 1.1em;
			color: #0d2451;
			opacity: 0.8;
			margin-bottom: 25px;
		}

		.wp-saas-faq-contact .wp-saas-btn {
			background: #0d2451;
			padding: 12px 35px;
			font-size: 1em;
		}

		.wp-saas-faq-contact .wp-saas-btn:hover {
			background: #1a3a6e;
		}

		@media (max-width: 768px) {
			.wp-saas-faq-contact {
				margin-top: 40px;
				padding: 40px 20px;
			}

			.wp-saas-faq-contact h3 {
				font-size: 1.6em;
			}
		}
        .wp-saas-faq {
            padding: 80px 0;
            background: white;
        }
        
        .wp-saas-faq h2 {
            text-align: center;
            font-size: 2.5em;
            margin-bottom: 50px;
            color: #0d2451;
        }
        
        .faq-item {
            margin-bottom: 20px;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        
        .faq-question {
            background: #f8f9fa;
            padding: 20px;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-weight: 600;
            color: #0d2451;
        }
        
        .faq-question:hover {
            background: #e9ecef;
        }
        
        .faq-toggle {
            font-size: 1.5em;
            transition: transform 0.3s ease;
        }
        
        .faq-item.active .faq-toggle {
            transform: rotate(45deg);
        }
        
        .faq-answer {
            background: white;
            padding: 0 20px;
            max-height: 0;
            overflow: hidden;
            transition: all 0.3s ease;
            color: #0d2451;
        }
        
        .faq-item.active .faq-answer {
            padding: 20px;
            max-height: 500px;
        }
        
        .faq-answer p {
            color: #0d2451;
            opacity: 0.8;
        }
        
        /* CTA Section */
        .wp-saas-cta {
            background: white;
            background-image: 
                radial-gradient(circle at 20% 50%, rgba(255, 107, 107, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255, 107, 107, 0.03) 0%, transparent 50%);
            color: #0d2451;
            padding: 80px 0;
            text-align: center;
            border-top: 1px solid #e9ecef;
        }
        
        .wp-saas-cta h2 {
            font-size: 2.5em;
            margin-bottom: 20px;
            color: #0d2451;
        }
        
        .wp-saas-cta p {
            font-size: 1.2em;
            margin-bottom: 30px;
            opacity: 0.8;
            color: #0d2451;
        }
		
		
		/* Social Proof Section */
		.wp-saas-social-proof {
			display: flex;
			align-items: center;
			justify-content: center;
			gap: 20px;
			margin: 40px 0 30px 0;
			flex-wrap: wrap;
			position: relative;
			z-index: 1;
		}

		.social-proof-avatars {
			display: flex;
			align-items: center;
		}

		.avatar-stack {
			display: flex;
			margin-right: 15px;
		}

		.avatar-stack img {
			width: 48px;
			height: 48px;
			border-radius: 50%;
			border: 3px solid white;
			box-shadow: 0 2px 8px rgba(0,0,0,0.1);
			margin-left: -15px;
			transition: transform 0.2s ease;
		}

		.avatar-stack img:first-child {
			margin-left: 0;
		}

		.avatar-stack img:hover {
			transform: scale(1.1);
			z-index: 10;
		}

		.social-proof-text {
			font-size: 1.1em;
			color: #0d2451;
			font-weight: 500;
		}

		.social-proof-text .count {
			color: #ff6b6b;
			font-weight: 700;
		}

		.social-proof-rating {
			display: flex;
			align-items: center;
			gap: 8px;
			font-size: 1em;
			color: #0d2451;
		}

		.stars {
			color: #ffd700;
			font-size: 1.2em;
		}

		@media (max-width: 768px) {
			.wp-saas-social-proof {
				flex-direction: column;
				gap: 15px;
				margin: 30px 0 25px 0;
			}

			.social-proof-avatars {
				flex-direction: column;
				align-items: center;
				gap: 15px;
			}

			.avatar-stack {
				margin-right: 0;
				justify-content: center;
			}

			.avatar-stack img {
				width: 40px;
				height: 40px;
			}

			.social-proof-text {
				font-size: 1em;
				text-align: center;
			}
		}
        
        /* Responsive */
        @media (max-width: 768px) {
            .wp-saas-hero .hero-image {
                width: 150px;
                height: 150px;
                margin-bottom: 10px;
            }
            
            .wp-saas-hero .subtitle {
                font-size: 1.2em;
            }
            
            .wp-saas-enrolled-banner .container {
                flex-direction: column;
                gap: 15px;
            }
            
            .wp-saas-enrolled-banner p {
                font-size: 1.1em;
            }
            
            .comparison-grid {
                grid-template-columns: 1fr;
                gap: 30px;
            }
            
            .comparison-card {
                padding: 30px 20px;
            }
            
            .comparison-card h3 {
                font-size: 1.5em;
            }
            
            .comparison-list li {
                font-size: 1em;
            }
            
            .features-grid,
            .curriculum-grid {
                grid-template-columns: 1fr;
            }
            
            .showcase-nav {
                width: 40px;
                height: 40px;
                font-size: 1.2em;
            }
            
            .showcase-nav.prev {
                left: 10px;
            }
            
            .showcase-nav.next {
                right: 10px;
            }
            
            .wp-saas-features h2,
            .wp-saas-curriculum h2,
            .wp-saas-showcase h2,
            .wp-saas-faq h2,
            .wp-saas-cta h2,
            .wp-saas-comparison h2 {
                font-size: 2em;
                color: #0d2451;
            }
        }
    </style>
    
    <div class="wp-saas-landing">
        <?php if ($is_enrolled): ?>
        <!-- Enrolled User Banner -->
        <section class="wp-saas-enrolled-banner">
            <div class="wp-saas-container">
                <div class="container">
                    <p>🎉 Awesome! You're already enrolled in WordPress SaaS 2.0!</p>
                    <a href="<?php echo esc_url($course_url); ?>" class="wp-saas-btn">Continue Learning →</a>
                </div>
            </div>
        </section>
        <?php endif; ?>
        
        <!-- Hero Section -->
        <section class="wp-saas-hero">
            <div class="wp-saas-container">
                <?php if (!empty($config['hero']['image'])): ?>
                <div class="hero-image">
                    <img src="<?php echo esc_url($config['hero']['image']); ?>" alt="<?php echo esc_attr($config['hero']['badge']); ?>">
                </div>
                <?php endif; ?>
                <?php if (!empty($config['hero']['badge'])): ?>
                <span class="badge"><?php echo esc_html($config['hero']['badge']); ?></span>
                <?php endif; ?>
                <h1><?php echo esc_html($config['hero']['heading']); ?></h1>
                <p class="subtitle"><?php echo esc_html($config['hero']['subheading']); ?></p>
                <p class="last-updated">📅 Last Updated: <?php echo esc_html($config['hero']['lastUpdated']); ?></p>
				<!-- Social Proof -->
				<?php 
				$social_proof_data = get_wp_saas_social_proof_data();
				if (!empty($social_proof_data['avatars']) || $social_proof_data['count'] > 0): 
				?>
				<div class="wp-saas-social-proof">
					<div class="social-proof-avatars">
						<?php if (!empty($social_proof_data['avatars'])): ?>
						<div class="avatar-stack">
							<?php foreach ($social_proof_data['avatars'] as $avatar_url): ?>
								<img src="<?php echo esc_url($avatar_url); ?>" alt="Course member">
							<?php endforeach; ?>
						</div>
						<?php endif; ?>
						<div class="social-proof-text">
							<span class="count"><?php echo number_format($social_proof_data['count']); ?></span>
							<?php echo esc_html($config['hero']['socialProof']['text']); ?>
						</div>
					</div>
			
				</div>
				<?php endif; ?>
                <?php if ($is_enrolled): ?>
                    <a href="<?php echo esc_url($course_url); ?>" class="wp-saas-btn enrolled"><?php echo esc_html($config['hero']['enrolledButtonText']); ?></a>
                <?php else: ?>
                    <a href="#enroll" class="wp-saas-btn"><?php echo esc_html($config['hero']['buttonText']); ?></a>
                <?php endif; ?>
            </div>
        </section>
        
        <!-- Comparison Section -->
        <section class="wp-saas-comparison">
            <div class="wp-saas-container">
                <h2>Build Like a Pro, Think Like an Solopreneur 🚀</h2>
                <div class="comparison-grid">
                    <div class="comparison-card engineer">
                        <h3>🤓 The Software Engineer Way</h3>
                        <ul class="comparison-list">
                            <li>📝 Write 1000 lines of code to automate a 5-minute task</li>
                            <li>🎓 Study design patterns you'll explain in interviews but never use</li>
                            <li>🔍 Spend hours debugging a missing semicolon</li>
                            <li>📚 Learn 12 JavaScript frameworks that'll be obsolete next year</li>
                            <li>🏗️ Build everything from scratch because "it's more efficient"</li>
                        </ul>
                    </div>
                    <div class="comparison-card entrepreneur">
                        <h3>🚀 The Solopreneur Way</h3>
                        <ul class="comparison-list">
                            <li>🎯 Learn what really matters for business</li>
                            <li>🤖 Use AI to code for you</li>
                            <li>✅ Learn from tested, proven systems</li>
                            <li>📦 Use ready-made snippets and code</li>
                            <li>⚡ Let WordPress handle 60% of the work</li>
                        </ul>
                    </div>
                </div>
            </div>
        </section>
        
        <!-- Features Section -->
        <section class="wp-saas-features">
            <div class="wp-saas-container">
                <h2>Everything You Need to Build & Monetize</h2>
                <div class="features-grid">
                    <div class="feature-card">
                        <div class="feature-icon">📚</div>
                        <h3>Complete Course</h3>
                        <p>Step-by-step video tutorials, code snippets, and visual guides to build real SaaS products.</p>
                    </div>
                    <div class="feature-card">
                        <div class="feature-icon">🔧</div>
                        <h3>Ready-to-Use Code</h3>
                        <p>Copy-paste code snippets and reusable templates to implement features instantly.</p>
                    </div>
                    <div class="feature-card">
                        <div class="feature-icon">🚀</div>
                        <h3>Monthly Updates</h3>
                        <p>Fresh examples, new code snippets, and cutting-edge techniques added every month.</p>
                    </div>
                    <div class="feature-card">
                        <div class="feature-icon">💡</div>
                        <h3>AI-Powered Development</h3>
                        <p>Learn to leverage Claude and AI coding assistants to build professional UIs faster.</p>
                    </div>
                    <div class="feature-card">
                        <div class="feature-icon">💰</div>
                        <h3>Monetization Strategies</h3>
                        <p>Token systems, payment integration, and proven strategies to turn tools into revenue.</p>
                    </div>
                    <div class="feature-card">
                        <div class="feature-icon">🛡️</div>
                        <h3>Security First</h3>
                        <p>Implement captchas, user authentication, and secure API endpoints from day one.</p>
                    </div>
                </div>
            </div>
        </section>
        
        <!-- Curriculum Section -->
        <section class="wp-saas-curriculum">
            <div class="wp-saas-container">
                <h2><?php echo esc_html($config['curriculum']['heading']); ?></h2>
                <div class="curriculum-grid">
                    <?php foreach ($config['curriculum']['items'] as $item): ?>
                    <div class="curriculum-item">
                        <h4><?php echo $item['icon']; ?> <?php echo esc_html($item['title']); ?></h4>
                        <p><?php echo esc_html($item['description']); ?></p>
                    </div>
                    <?php endforeach; ?>
                </div>
            </div>
        </section>
        
        <!-- Showcase Section -->
        <section class="wp-saas-showcase">
            <div class="wp-saas-container">
                <h2><?php echo esc_html($config['showcase']['heading']); ?></h2>
                <div class="showcase-slider-container">
                    <?php if (count($config['showcase']['projects']) > 2): ?>
                    <button class="showcase-nav prev" aria-label="Previous">‹</button>
                    <button class="showcase-nav next" aria-label="Next">›</button>
                    <?php endif; ?>
                    
                    <div class="showcase-slider" id="showcaseSlider">
                        <?php foreach ($config['showcase']['projects'] as $project): ?>
                        <div class="showcase-item">
                            <div class="showcase-image">
                                <img src="<?php echo esc_url($project['imageUrl']); ?>" alt="<?php echo esc_attr($project['title']); ?>">
                            </div>
                            <div class="showcase-content">
                                <h3><?php echo esc_html($project['title']); ?></h3>
                                <p><?php echo esc_html($project['description']); ?></p>
                                <a href="<?php echo esc_url($project['link']); ?>" target="_blank" class="showcase-link"><?php echo esc_html($project['linkText']); ?></a>
                            </div>
                        </div>
                        <?php endforeach; ?>
                    </div>
                    
                    <?php if (count($config['showcase']['projects']) > 2): ?>
                    <div class="showcase-dots">
                        <?php for ($i = 0; $i < ceil(count($config['showcase']['projects']) / 2); $i++): ?>
                        <span class="showcase-dot <?php echo $i === 0 ? 'active' : ''; ?>" data-slide="<?php echo $i; ?>"></span>
                        <?php endfor; ?>
                    </div>
                    <?php endif; ?>
                </div>
            </div>
        </section>
        
        <!-- FAQ Section -->
        <section class="wp-saas-faq">
            <div class="wp-saas-container">
                <h2>Frequently Asked Questions</h2>
                <div class="faq-list">
                    <?php foreach ($config['faqs'] as $faq): ?>
                    <div class="faq-item">
                        <div class="faq-question">
                            <span><?php echo esc_html($faq['question']); ?></span>
                            <span class="faq-toggle">+</span>
                        </div>
                        <div class="faq-answer">
                            <p><?php echo esc_html($faq['answer']); ?></p>
                        </div>
                    </div>
                    <?php endforeach; ?>
                </div>
				<!-- Still Have Questions -->
				<?php if (!empty($config['faqContact'])): ?>
				<div class="wp-saas-faq-contact">
					<h3><?php echo esc_html($config['faqContact']['heading']); ?></h3>
					<p><?php echo esc_html($config['faqContact']['text']); ?></p>
					<a target="_blank" href="<?php echo esc_url($config['faqContact']['buttonUrl']); ?>" class="wp-saas-btn">
						<?php echo esc_html($config['faqContact']['buttonText']); ?>
					</a>
				</div>
				<?php endif; ?>
            </div>
        </section>
        
        <!-- CTA Section -->
        <section class="wp-saas-cta" id="enroll">
            <div class="wp-saas-container">
                <h2><?php echo esc_html($config['cta']['heading']); ?></h2>
                <p><?php echo esc_html($config['cta']['subheading']); ?></p>
                <?php if ($is_enrolled): ?>
                    <a href="<?php echo esc_url($course_url); ?>" class="wp-saas-btn enrolled"><?php echo esc_html($config['cta']['enrolledButtonText']); ?></a>
                <?php else: ?>
                    <a href="<?php echo esc_url($enrollment_url); ?>" class="wp-saas-btn"><?php echo esc_html($config['cta']['buttonText']); ?></a>
                <?php endif; ?>
            </div>
        </section>
    </div>
    
    <script>
        // FAQ Toggle Functionality
        document.addEventListener('DOMContentLoaded', function() {
            const faqItems = document.querySelectorAll('.faq-question');
            
            faqItems.forEach(item => {
                item.addEventListener('click', function() {
                    const parent = this.parentElement;
                    parent.classList.toggle('active');
                    
                    // Close other FAQs
                    const allFaqs = document.querySelectorAll('.faq-item');
                    allFaqs.forEach(faq => {
                        if (faq !== parent && faq.classList.contains('active')) {
                            faq.classList.remove('active');
                        }
                    });
                });
            });
            
            // Showcase Slider Functionality
            const showcaseProjects = <?php echo json_encode($config['showcase']['projects']); ?>;
            if (showcaseProjects.length > 2) {
                const slider = document.getElementById('showcaseSlider');
                const prevBtn = document.querySelector('.showcase-nav.prev');
                const nextBtn = document.querySelector('.showcase-nav.next');
                const dots = document.querySelectorAll('.showcase-dot');
                
                let currentSlide = 0;
                const itemsPerSlide = window.innerWidth <= 768 ? 1 : 2;
                const totalSlides = Math.ceil(showcaseProjects.length / itemsPerSlide);
                
                function updateSlider() {
                    const slideWidth = 100 / itemsPerSlide;
                    const translateX = -currentSlide * 100;
                    slider.style.transform = `translateX(${translateX}%)`;
                    
                    // Update navigation buttons
                    prevBtn.disabled = currentSlide === 0;
                    nextBtn.disabled = currentSlide === totalSlides - 1;
                    
                    // Update dots
                    dots.forEach((dot, index) => {
                        dot.classList.toggle('active', index === currentSlide);
                    });
                }
                
                prevBtn.addEventListener('click', () => {
                    if (currentSlide > 0) {
                        currentSlide--;
                        updateSlider();
                    }
                });
                
                nextBtn.addEventListener('click', () => {
                    if (currentSlide < totalSlides - 1) {
                        currentSlide++;
                        updateSlider();
                    }
                });
                
                dots.forEach((dot, index) => {
                    dot.addEventListener('click', () => {
                        currentSlide = index;
                        updateSlider();
                    });
                });
                
                // Initialize slider
                updateSlider();
                
                // Handle window resize
                let resizeTimer;
                window.addEventListener('resize', () => {
                    clearTimeout(resizeTimer);
                    resizeTimer = setTimeout(() => {
                        currentSlide = 0;
                        updateSlider();
                    }, 250);
                });
            }
        });
    </script>
    <?php
    return ob_get_clean();
}

// Register the shortcode
add_shortcode('wordpress_saas_landing', 'wordpress_saas_landing_page_shortcode');
×
课程落地页

课程落地页

<?php /** * WordP...