/
home
/
altere25
/
.trash
/
wp-to-sanity-companion.1
/
/home/altere25/.trash/wp-to-sanity-companion.1
mkdir
upload
Name
Size
Mode
Actions
assets/
-
0755
rm
includes/
-
0755
rm
templates/
-
0755
rm
assets\css\admin.css
7611
0644
edit
dl
rm
assets\js\admin.js
8534
0644
edit
dl
rm
assets\js\claude-connect.js
6502
0644
edit
dl
rm
includes\class-ad-admin.php
26374
0644
edit
dl
rm
includes\class-ad-ai-client.php
8153
0644
edit
dl
rm
includes\class-ad-auth.php
9189
0644
edit
dl
rm
includes\class-ad-cli.php
8669
0644
edit
dl
rm
includes\class-ad-extractor.php
12210
0644
edit
dl
rm
includes\class-ad-mcp.php
6429
0644
edit
dl
rm
includes\class-ad-plugin-core.php
7947
0644
edit
dl
rm
includes\class-ad-progress.php
8022
0644
edit
dl
rm
includes\class-ad-rest.php
31008
0644
edit
dl
rm
includes\class-ad-uninstall.php
1924
0644
edit
dl
rm
includes\class-ad-webhook.php
14854
0644
edit
dl
rm
templates\admin\claude-connect.php
5152
0644
edit
dl
rm
templates\admin\dashboard.php
10457
0644
edit
dl
rm
templates\admin\export.php
16570
0644
edit
dl
rm
templates\admin\log.php
10849
0644
edit
dl
rm
templates\admin\onboarding-v2.php
3827
0644
edit
dl
rm
templates\admin\onboarding.php
10714
0644
edit
dl
rm
templates\admin\progress.php
2443
0644
edit
dl
rm
templates\admin\schema-preview.php
5213
0644
edit
dl
rm
uninstall.php
365
0644
edit
dl
rm
wp-to-sanity-companion.php
4467
0644
edit
dl
rm
Edit:
/home/altere25/.trash/wp-to-sanity-companion.1/templates\admin\dashboard.php
(10457B)
<?php /** * Admin Dashboard Template * * @package WPtoSanity */ if (!defined('ABSPATH')) { exit; } $plugin = WP_to_Sanity_Plugin::get_instance(); $settings = $plugin->settings(); // Get migration stats global $wpdb; $log_table = $wpdb->prefix . 'ad_migration_log'; $stats = $wpdb->get_row(" SELECT COUNT(*) as total, SUM(CASE WHEN status = 'success' THEN 1 ELSE 0 END) as success, SUM(CASE WHEN status = 'pending' THEN 1 ELSE 0 END) as pending, SUM(CASE WHEN status = 'failed' THEN 1 ELSE 0 END) as failed FROM {$log_table} ", ARRAY_A); $queue_count = 0; // Get content counts $content_stats = [ 'posts' => wp_count_posts('post'), 'pages' => wp_count_posts('page'), 'media' => wp_count_attachments(), ]; $total_posts = $content_stats['posts']->publish + $content_stats['posts']->draft + $content_stats['posts']->pending; $total_pages = $content_stats['pages']->publish + $content_stats['pages']->draft; $total_media = array_sum((array) $content_stats['media']); ?> <div class="wrap wp-to-sanity-dashboard"> <h1><?php echo esc_html(get_admin_page_title()); ?></h1> <div class="wp-to-sanity-welcome"> <h2><?php esc_html_e('Welcome to WP-to-Sanity Migration', 'wp-to-sanity'); ?></h2> <p class="description"> <?php esc_html_e('This plugin helps you migrate your WordPress content to Sanity.io CMS. Follow the steps below to get started.', 'wp-to-sanity'); ?> </p> </div> <div class="wp-to-sanity-steps"> <div class="step-card <?php echo empty($settings['webhook_url']) ? 'active' : 'completed'; ?>"> <div class="step-number">1</div> <h3><?php esc_html_e('Configure Webhook', 'wp-to-sanity'); ?></h3> <p><?php esc_html_e('Set up the webhook URL to connect to your Cloudflare Worker.', 'wp-to-sanity'); ?></p> <?php if (empty($settings['webhook_url'])) : ?> <a href="<?php echo admin_url('admin.php?page=wp-to-sanity-settings'); ?>" class="button button-primary"> <?php esc_html_e('Configure Now', 'wp-to-sanity'); ?> </a> <?php else : ?> <span class="dashicons dashicons-yes"></span> <?php endif; ?> </div> <div class="step-card"> <div class="step-number">2</div> <h3><?php esc_html_e('Review Content', 'wp-to-sanity'); ?></h3> <p><?php esc_html_e('Check which content types will be migrated.', 'wp-to-sanity'); ?></p> <a href="<?php echo admin_url('admin.php?page=wp-to-sanity-export'); ?>" class="button"> <?php esc_html_e('View Content', 'wp-to-sanity'); ?> </a> </div> <div class="step-card"> <div class="step-number">3</div> <h3><?php esc_html_e('Start Migration', 'wp-to-sanity'); ?></h3> <p><?php esc_html_e('Begin the migration process.', 'wp-to-sanity'); ?></p> <a href="<?php echo admin_url('admin.php?page=wp-to-sanity-export'); ?>" class="button button-primary"> <?php esc_html_e('Export & Migrate', 'wp-to-sanity'); ?> </a> </div> </div> <h2><?php esc_html_e('Migration Statistics', 'wp-to-sanity'); ?></h2> <div class="wp-to-sanity-stats-grid"> <div class="stat-card"> <div class="stat-value"><?php echo esc_html($stats['total'] ?? 0); ?></div> <div class="stat-label"><?php esc_html_e('Total Migrations', 'wp-to-sanity'); ?></div> </div> <div class="stat-card success"> <div class="stat-value"><?php echo esc_html($stats['success'] ?? 0); ?></div> <div class="stat-label"><?php esc_html_e('Successful', 'wp-to-sanity'); ?></div> </div> <div class="stat-card pending"> <div class="stat-value"><?php echo esc_html($stats['pending'] ?? 0); ?></div> <div class="stat-label"><?php esc_html_e('Pending', 'wp-to-sanity'); ?></div> </div> <div class="stat-card error"> <div class="stat-value"><?php echo esc_html($stats['failed'] ?? 0); ?></div> <div class="stat-label"><?php esc_html_e('Failed', 'wp-to-sanity'); ?></div> </div> <div class="stat-card"> <div class="stat-value"><?php echo esc_html($queue_count ?? 0); ?></div> <div class="stat-label"><?php esc_html_e('Queue', 'wp-to-sanity'); ?></div> </div> </div> <h2><?php esc_html_e('Content Overview', 'wp-to-sanity'); ?></h2> <div class="wp-to-sanity-stats-grid"> <div class="stat-card"> <div class="stat-value"><?php echo esc_html($total_posts); ?></div> <div class="stat-label"><?php esc_html_e('Posts', 'wp-to-sanity'); ?></div> <div class="stat-detail"> <?php echo esc_html($content_stats['posts']->publish); ?> <?php esc_html_e('published', 'wp-to-sanity'); ?>, <?php echo esc_html($content_stats['posts']->draft); ?> <?php esc_html_e('drafts', 'wp-to-sanity'); ?> </div> </div> <div class="stat-card"> <div class="stat-value"><?php echo esc_html($total_pages); ?></div> <div class="stat-label"><?php esc_html_e('Pages', 'wp-to-sanity'); ?></div> <div class="stat-detail"> <?php echo esc_html($content_stats['pages']->publish); ?> <?php esc_html_e('published', 'wp-to-sanity'); ?> </div> </div> <div class="stat-card"> <div class="stat-value"><?php echo esc_html($total_media); ?></div> <div class="stat-label"><?php esc_html_e('Media Files', 'wp-to-sanity'); ?></div> </div> </div> <h2><?php esc_html_e('Recent Activity', 'wp-to-sanity'); ?></h2> <table class="wp-list-table widefat fixed striped"> <thead> <tr> <th><?php esc_html_e('Post ID', 'wp-to-sanity'); ?></th> <th><?php esc_html_e('Action', 'wp-to-sanity'); ?></th> <th><?php esc_html_e('Status', 'wp-to-sanity'); ?></th> <th><?php esc_html_e('Sanity ID', 'wp-to-sanity'); ?></th> <th><?php esc_html_e('Date', 'wp-to-sanity'); ?></th> </tr> </thead> <tbody> <?php $recent_logs = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$log_table} ORDER BY created_at DESC LIMIT %d", 10), ARRAY_A); if (empty($recent_logs)) : ?> <tr> <td colspan="5"><?php esc_html_e('No migration activity yet.', 'wp-to-sanity'); ?></td> </tr> <?php else : foreach ($recent_logs as $log) : $status_class = 'status-' . esc_attr($log['status']); ?> <tr class="<?php echo esc_attr($status_class); ?>"> <td> <a href="<?php echo esc_url(get_edit_post_link($log['post_id'])); ?>"> #<?php echo esc_html($log['post_id']); ?> </a> </td> <td><?php echo esc_html(ucfirst($log['action'])); ?></td> <td> <span class="status-badge <?php echo esc_attr($log['status']); ?>"> <?php echo esc_html(ucfirst($log['status'])); ?> </span> </td> <td> <?php if ($log['sanity_id']) : ?> <code><?php echo esc_html($log['sanity_id']); ?></code> <?php else : ?> — <?php endif; ?> </td> <td><?php echo esc_html(date_i18n(get_option('date_format') . ' ' . get_option('time_format'), strtotime($log['created_at']))); ?></td> </tr> <?php endforeach; endif; ?> </tbody> </table> <p> <a href="<?php echo admin_url('admin.php?page=wp-to-sanity-log'); ?>" class="button"> <?php esc_html_e('View Full Log', 'wp-to-sanity'); ?> </a> </p> </div> <style> .wp-to-sanity-dashboard { max-width: 1200px; } .wp-to-sanity-welcome { background: #f0f0f1; padding: 20px; border-radius: 8px; margin-bottom: 30px; } .wp-to-sanity-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; } .step-card { background: #fff; border: 1px solid #c3c4c7; border-radius: 8px; padding: 20px; text-align: center; } .step-card.active { border-color: #2271b1; box-shadow: 0 0 0 1px #2271b1; } .step-card.completed { border-color: #00a32a; background: #f0fff4; } .step-number { width: 40px; height: 40px; background: #2271b1; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 15px; font-weight: bold; } .step-card.completed .step-number { background: #00a32a; } .wp-to-sanity-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; margin-bottom: 30px; } .stat-card { background: #fff; border: 1px solid #c3c4c7; border-radius: 8px; padding: 20px; text-align: center; } .stat-value { font-size: 2.5em; font-weight: bold; color: #2271b1; } .stat-label { color: #646970; margin-top: 5px; } .stat-detail { font-size: 0.9em; color: #646970; margin-top: 10px; } .stat-card.success .stat-value { color: #00a32a; } .stat-card.error .stat-value { color: #d63638; } .stat-card.pending .stat-value { color: #dba617; } .status-badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 0.85em; font-weight: 500; } .status-badge.success { background: #d1fae5; color: #065f46; } .status-badge.pending { background: #fef3c7; color: #92400e; } .status-badge.error, .status-badge.failed { background: #fee2e2; color: #991b1b; } tr.status-success { background: #f0fff4; } tr.status-pending { background: #fffbeb; } tr.status-failed, tr.status-error { background: #fef2f2; } </style>
Save
cmd:
run