|
@@ -42,7 +42,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
|
|
|
|
|
|
// Validate required fields
|
|
// Validate required fields
|
|
|
if (empty($wpConfig['host']) || empty($wpConfig['database']) || empty($wpConfig['username'])) {
|
|
if (empty($wpConfig['host']) || empty($wpConfig['database']) || empty($wpConfig['username'])) {
|
|
|
- throw new Exception(t('wordpress_import_config_required'));
|
|
|
|
|
|
|
+ throw new Exception("WordPress database configuration is required. Please provide host, database, and username.");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Direct WordPress connection test (bypass WordPressImport class)
|
|
// Direct WordPress connection test (bypass WordPressImport class)
|
|
@@ -88,11 +88,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
|
$stats['comments'] = 0;
|
|
$stats['comments'] = 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $message = t('wordpress_connection_success') . ': ' .
|
|
|
|
|
- t('posts') . ': ' . $stats['posts'] . ', ' .
|
|
|
|
|
- t('categories') . ': ' . $stats['categories'] . ', ' .
|
|
|
|
|
- t('users') . ': ' . $stats['users'] . ', ' .
|
|
|
|
|
- t('comments') . ': ' . $stats['comments'];
|
|
|
|
|
|
|
+ $message = "WordPress connection successful: " .
|
|
|
|
|
+ "Posts: " . $stats['posts'] . ", " .
|
|
|
|
|
+ "Categories: " . $stats['categories'] . ", " .
|
|
|
|
|
+ "Users: " . $stats['users'] . ", " .
|
|
|
|
|
+ "Comments: " . $stats['comments'];
|
|
|
}
|
|
}
|
|
|
} catch (Exception $e) {
|
|
} catch (Exception $e) {
|
|
|
throw new Exception("WordPress connection failed: " . $e->getMessage());
|
|
throw new Exception("WordPress connection failed: " . $e->getMessage());
|
|
@@ -303,33 +303,33 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
|
|
|
|
|
|
<!-- Information Section -->
|
|
<!-- Information Section -->
|
|
|
<div class="info-section">
|
|
<div class="info-section">
|
|
|
- <h3><?php echo t('wordpress_import_info'); ?></h3>
|
|
|
|
|
|
|
+ <h3>WordPress Import Information</h3>
|
|
|
<div class="info-content">
|
|
<div class="info-content">
|
|
|
<div class="info-item">
|
|
<div class="info-item">
|
|
|
- <h4><?php echo t('what_gets_imported'); ?></h4>
|
|
|
|
|
|
|
+ <h4>What Gets Imported</h4>
|
|
|
<ul>
|
|
<ul>
|
|
|
- <li><?php echo t('import_posts_info'); ?></li>
|
|
|
|
|
- <li><?php echo t('import_categories_info'); ?></li>
|
|
|
|
|
- <li><?php echo t('import_users_info'); ?></li>
|
|
|
|
|
- <li><?php echo t('import_comments_info'); ?></li>
|
|
|
|
|
|
|
+ <li>Posts (title, content, author, publication date)</li>
|
|
|
|
|
+ <li>Categories (name and description)</li>
|
|
|
|
|
+ <li>Users (username, email, display name)</li>
|
|
|
|
|
+ <li>Comments (content, author, date, threading)</li>
|
|
|
</ul>
|
|
</ul>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="info-item">
|
|
<div class="info-item">
|
|
|
- <h4><?php echo t('import_requirements'); ?></h4>
|
|
|
|
|
|
|
+ <h4>Requirements</h4>
|
|
|
<ul>
|
|
<ul>
|
|
|
- <li><?php echo t('import_db_access'); ?></li>
|
|
|
|
|
- <li><?php echo t('import_wp_structure'); ?></li>
|
|
|
|
|
- <li><?php echo t('import_backup'); ?></li>
|
|
|
|
|
|
|
+ <li>Database access to WordPress database</li>
|
|
|
|
|
+ <li>WordPress database with standard structure</li>
|
|
|
|
|
+ <li>Backup of your current data (recommended)</li>
|
|
|
</ul>
|
|
</ul>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="info-item">
|
|
<div class="info-item">
|
|
|
- <h4><?php echo t('import_notes'); ?></h4>
|
|
|
|
|
|
|
+ <h4>Important Notes</h4>
|
|
|
<ul>
|
|
<ul>
|
|
|
- <li><?php echo t('import_existing_data'); ?></li>
|
|
|
|
|
- <li><?php echo t('import_content_processing'); ?></li>
|
|
|
|
|
- <li><?php echo t('import_user_mapping'); ?></li>
|
|
|
|
|
|
|
+ <li>Existing data with same identifiers will be skipped</li>
|
|
|
|
|
+ <li>WordPress content is processed for compatibility</li>
|
|
|
|
|
+ <li>WordPress users are mapped to your user system</li>
|
|
|
</ul>
|
|
</ul>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -349,7 +349,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
|
if (loading) {
|
|
if (loading) {
|
|
|
button.disabled = true;
|
|
button.disabled = true;
|
|
|
button.dataset.originalText = button.textContent;
|
|
button.dataset.originalText = button.textContent;
|
|
|
- button.textContent = button.dataset.loadingText || '<?php echo t('loading'); ?>...';
|
|
|
|
|
|
|
+ button.textContent = button.dataset.loadingText || 'Loading...';
|
|
|
} else {
|
|
} else {
|
|
|
button.disabled = false;
|
|
button.disabled = false;
|
|
|
button.textContent = button.dataset.originalText;
|
|
button.textContent = button.dataset.originalText;
|
|
@@ -359,13 +359,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
|
// Test connection loading
|
|
// Test connection loading
|
|
|
testBtn.addEventListener('click', function() {
|
|
testBtn.addEventListener('click', function() {
|
|
|
setLoading(this, true);
|
|
setLoading(this, true);
|
|
|
- this.dataset.loadingText = '<?php echo t('testing_connection'); ?>';
|
|
|
|
|
|
|
+ this.dataset.loadingText = 'Testing connection...';
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
// Import loading
|
|
// Import loading
|
|
|
importBtn.addEventListener('click', function() {
|
|
importBtn.addEventListener('click', function() {
|
|
|
setLoading(this, true);
|
|
setLoading(this, true);
|
|
|
- this.dataset.loadingText = '<?php echo t('importing'); ?>...';
|
|
|
|
|
|
|
+ this.dataset.loadingText = 'Importing...';
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
// Reset loading on form submit
|
|
// Reset loading on form submit
|