<?php
session_start();
$_SESSION['admin_logged_in'] = true;

// Set up for testing AJAX
$_SERVER['REQUEST_METHOD'] = 'POST';
$_POST['action'] = 'load_products';

header('Content-Type: application/json');

// Load JUST the start of the file to see where it breaks
ob_start();

// Start with minimal includes
try {
    require_once 'db_config.php';
    echo "✓ db_config loaded\n";
} catch (Exception $e) {
    echo "✗ db_config: " . $e->getMessage() . "\n";
}

try {
    require_once 'seo_plugin.php';
    echo "✓ seo_plugin loaded\n";
} catch (Exception $e) {
    echo "✗ seo_plugin: " . $e->getMessage() . "\n";
}

try {
    require_once 'seo_readability.php';
    echo "✓ seo_readability loaded\n";
} catch (Exception $e) {
    echo "✗ seo_readability: " . $e->getMessage() . "\n";
}

try {
    require_once 'seo_keywords.php';
    echo "✓ seo_keywords loaded\n";
} catch (Exception $e) {
    echo "✗ seo_keywords: " . $e->getMessage() . "\n";
}

try {
    require_once 'seo_schema.php';
    echo "✓ seo_schema loaded\n";
} catch (Exception $e) {
    echo "✗ seo_schema: " . $e->getMessage() . "\n";
}

try {
    require_once 'seo_analytics.php';
    echo "✓ seo_analytics loaded\n";
} catch (Exception $e) {
    echo "✗ seo_analytics: " . $e->getMessage() . "\n";
}

try {
    require_once 'seo_site_auditor.php';
    echo "✓ seo_site_auditor loaded\n";
} catch (Exception $e) {
    echo "✗ seo_site_auditor: " . $e->getMessage() . "\n";
}

try {
    require_once 'seo_db_schema.php';
    echo "✓ seo_db_schema loaded\n";
} catch (Exception $e) {
    echo "✗ seo_db_schema: " . $e->getMessage() . "\n";
}

try {
    require_once 'seo_helper_advanced.php';
    echo "✓ seo_helper_advanced loaded\n";
} catch (Exception $e) {
    echo "✗ seo_helper_advanced: " . $e->getMessage() . "\n";
}

$output = ob_get_clean();
echo $output;
?>
