WordPress Connection Test"; // Test basic form submission if ($_SERVER['REQUEST_METHOD'] === 'POST') { echo "
" . print_r($_POST, true) . ""; // Test WordPress connection if (!empty($_POST['wp_host']) && !empty($_POST['wp_database']) && !empty($_POST['wp_username'])) { echo "
Config: " . htmlspecialchars($wpConfig['host']) . " / " . htmlspecialchars($wpConfig['database']) . " / " . htmlspecialchars($wpConfig['username']) . "
"; // Test PDO connection directly $dsn = "mysql:host={$wpConfig['host']};dbname={$wpConfig['database']};charset=utf8mb4"; echo "DSN: " . htmlspecialchars($dsn) . "
"; $options = [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_TIMEOUT => 5 ]; $pdo = new PDO($dsn, $wpConfig['username'], $wpConfig['password'], $options); echo "✓ PDO Connection successful!
"; // Test simple query $result = $pdo->query("SELECT 1 as test"); echo "✓ Simple query successful!
"; // Test WordPress tables $tables = ['wp_posts', 'wp_users', 'wp_terms', 'wp_term_taxonomy', 'wp_term_relationships', 'wp_comments']; $existingTables = []; foreach ($tables as $table) { $stmt = $pdo->query("SHOW TABLES LIKE '$table'"); if ($stmt->rowCount() > 0) { $existingTables[] = $table; echo "✓ Found table: $table
"; } else { echo "⚠ Missing table: $table
"; } } if (count($existingTables) >= 6) { echo "" . print_r($stats, true) . ""; } else { echo "
✗ PDO Error: " . htmlspecialchars($e->getMessage()) . "
"; } catch (Exception $e) { echo "✗ Error: " . htmlspecialchars($e->getMessage()) . "
"; } } } else { echo "Please submit the form to test connection.
"; } ?>PDO Support:
PDO MySQL Support:
Memory Limit:
Max Execution Time: seconds