<?php
header('Content-Type: text/plain');

$log = __DIR__ . '/unzip_log.txt';
if (file_exists($log)) {
    $content = file_get_contents($log);
    $lines = explode("\n", trim($content));
    $total = count($lines);
    echo "Lines in log: $total\n";
    echo "Last 5 lines:\n";
    echo implode("\n", array_slice($lines, -5)) . "\n\n";
} else {
    echo "No log file yet.\n";
}

// Check if homepage images exist
$hp = __DIR__ . '/wp-content/uploads/2026/04/homepage';
if (is_dir($hp)) {
    $files = glob($hp . '/*');
    echo "Homepage images: " . count($files) . "\n";
} else {
    echo "Homepage dir not yet extracted.\n";
}

// Check if process running
$running = shell_exec("ps aux | grep unzip | grep -v grep 2>/dev/null");
echo "Unzip process: " . ($running ? "RUNNING" : "NOT RUNNING") . "\n";
