|
|
@@ -76,6 +76,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
|
throw new Exception($connectionTest['error']);
|
|
|
}
|
|
|
} elseif (isset($_POST['start_import'])) {
|
|
|
+ // Debug: Starting import
|
|
|
+ error_log('About to start WordPress import');
|
|
|
+
|
|
|
// Start import
|
|
|
$importOptions = [
|
|
|
'import_categories' => isset($_POST['import_categories']),
|
|
|
@@ -84,11 +87,21 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
|
'import_comments' => isset($_POST['import_comments'])
|
|
|
];
|
|
|
|
|
|
+ error_log('Import options: ' . print_r($importOptions, true));
|
|
|
+
|
|
|
+ // Debug: About to call importAll
|
|
|
+ error_log('About to call importer->importAll()');
|
|
|
+
|
|
|
$importResults = $importer->importAll($importOptions);
|
|
|
|
|
|
+ // Debug: Import completed
|
|
|
+ error_log('importAll() completed');
|
|
|
+
|
|
|
if ($importResults['success']) {
|
|
|
$message = t('wordpress_import_success');
|
|
|
+ error_log('Import successful: ' . print_r($importResults['results'], true));
|
|
|
} else {
|
|
|
+ error_log('Import failed: ' . $importResults['error']);
|
|
|
throw new Exception($importResults['error']);
|
|
|
}
|
|
|
}
|