/
home
/
altere25
/
.trash
/
wp-to-sanity-companion-1.2
/
/home/altere25/.trash/wp-to-sanity-companion-1.2
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
4269
0644
edit
dl
rm
Edit:
/home/altere25/.trash/wp-to-sanity-companion-1.2/templates\admin\log.php
(10849B)
<?php /** * Migration Log Template * * @package WPtoSanity */ if (!defined('ABSPATH')) { exit; } // Handle bulk actions if (isset($_POST['bulk_action']) && isset($_POST['log_ids']) && is_array($_POST['log_ids'])) { check_admin_referer('wp_to_sanity_bulk_action'); global $wpdb; $log_table = $wpdb->prefix . 'ad_migration_log'; $log_ids = array_map('intval', $_POST['log_ids']); switch ($_POST['bulk_action']) { case 'delete': $placeholders = implode(',', array_fill(0, count($log_ids), '%d')); $wpdb->query($wpdb->prepare("DELETE FROM {$log_table} WHERE id IN ($placeholders)", ...$log_ids)); echo '<div class="notice notice-success"><p>' . esc_html__('Selected logs deleted.', 'wp-to-sanity') . '</p></div>'; break; case 'retry': // v2: re-trigger the webhook for each failed post by marking it // pending so the next publish/edit re-fires. The v1 queue table // no longer exists; queueing lives on the Worker Durable Object. $placeholders = implode(',', array_fill(0, count($log_ids), '%d')); $wpdb->query($wpdb->prepare( "UPDATE {$log_table} SET status = 'pending', error_message = NULL WHERE id IN ($placeholders)", ...$log_ids )); echo '<div class="notice notice-success"><p>' . esc_html__('Selected logs reset to pending. Re-publish the posts to re-trigger migration.', 'wp-to-sanity') . '</p></div>'; break; } } // Filter handling $filter_status = $_GET['status'] ?? 'all'; $filter_post_type = $_GET['post_type'] ?? 'all'; $search = $_GET['s'] ?? ''; $where_clauses = ['1=1']; if ($filter_status !== 'all') { $where_clauses[] = $wpdb->prepare('status = %s', $filter_status); } if ($search) { $where_clauses[] = $wpdb->prepare('(post_id = %d OR sanity_id LIKE %s)', intval($search), '%' . $wpdb->esc_like($search) . '%'); } $where = implode(' AND ', $where_clauses); ?> <div class="wrap wp-to-sanity-log"> <h1><?php echo esc_html(get_admin_page_title()); ?></h1> <form method="get" class="wp-to-sanity-filters"> <input type="hidden" name="page" value="wp-to-sanity-log"> <label> <?php esc_html_e('Status:', 'wp-to-sanity'); ?> <select name="status" onchange="this.form.submit()"> <option value="all" <?php selected($filter_status, 'all'); ?>><?php esc_html_e('All', 'wp-to-sanity'); ?></option> <option value="pending" <?php selected($filter_status, 'pending'); ?>><?php esc_html_e('Pending', 'wp-to-sanity'); ?></option> <option value="success" <?php selected($filter_status, 'success'); ?>><?php esc_html_e('Success', 'wp-to-sanity'); ?></option> <option value="failed" <?php selected($filter_status, 'failed'); ?>><?php esc_html_e('Failed', 'wp-to-sanity'); ?></option> </select> </label> <label> <?php esc_html_e('Search:', 'wp-to-sanity'); ?> <input type="search" name="s" value="<?php echo esc_attr($search); ?>" placeholder="<?php esc_attr_e('Post ID or Sanity ID', 'wp-to-sanity'); ?>"> </label> <button type="submit" class="button"><?php esc_html_e('Filter', 'wp-to-sanity'); ?></button> <a href="<?php echo admin_url('admin.php?page=wp-to-sanity-log'); ?>" class="button"><?php esc_html_e('Reset', 'wp-to-sanity'); ?></a> </form> <form method="post"> <?php wp_nonce_field('wp_to_sanity_bulk_action'); ?> <div class="tablenav top"> <div class="alignleft actions bulkactions"> <select name="bulk_action"> <option value=""><?php esc_html_e('Bulk Actions', 'wp-to-sanity'); ?></option> <option value="delete"><?php esc_html_e('Delete', 'wp-to-sanity'); ?></option> <option value="retry"><?php esc_html_e('Retry Failed', 'wp-to-sanity'); ?></option> </select> <button type="submit" class="button action"><?php esc_html_e('Apply', 'wp-to-sanity'); ?></button> </div> <div class="tablenav-pages one-page"> <span class="displaying-num"> <?php printf(esc_html('%s items', 'wp-to-sanity'), number_format_i18n($total)); ?> </span> </div> <br class="clear"> </div> <table class="wp-list-table widefat fixed striped"> <thead> <tr> <td class="manage-column column-cb check-column"> <input type="checkbox" id="cb-select-all"> </td> <th><?php esc_html_e('ID', 'wp-to-sanity'); ?></th> <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('Sanity ID', 'wp-to-sanity'); ?></th> <th><?php esc_html_e('Transaction ID', 'wp-to-sanity'); ?></th> <th><?php esc_html_e('Status', 'wp-to-sanity'); ?></th> <th><?php esc_html_e('Error', 'wp-to-sanity'); ?></th> <th><?php esc_html_e('Date', 'wp-to-sanity'); ?></th> </tr> </thead> <tbody> <?php if (empty($logs)) : ?> <tr> <td colspan="9"><?php esc_html_e('No logs found.', 'wp-to-sanity'); ?></td> </tr> <?php else : foreach ($logs as $log) : $status_class = 'status-' . esc_attr($log['status']); ?> <tr class="<?php echo esc_attr($status_class); ?>"> <th scope="row" class="check-column"> <input type="checkbox" name="log_ids[]" value="<?php echo esc_attr($log['id']); ?>"> </th> <td><?php echo esc_html($log['id']); ?></td> <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> <?php if ($log['sanity_id']) : ?> <code><?php echo esc_html($log['sanity_id']); ?></code> <?php else : ?> — <?php endif; ?> </td> <td> <?php if ($log['transaction_id']) : ?> <code><?php echo esc_html(substr($log['transaction_id'], 0, 12)); ?>...</code> <?php else : ?> — <?php endif; ?> </td> <td> <span class="status-badge <?php echo esc_attr($log['status']); ?>"> <?php echo esc_html(ucfirst($log['status'])); ?> </span> </td> <td class="error-message"> <?php if ($log['error_message']) : ?> <span title="<?php echo esc_attr($log['error_message']); ?>"> <?php echo esc_html(substr($log['error_message'], 0, 50)); ?> <?php if (strlen($log['error_message']) > 50) : ?> ... <?php endif; ?> </span> <?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> <div class="tablenav bottom"> <div class="alignleft actions bulkactions"> <select name="bulk_action"> <option value=""><?php esc_html_e('Bulk Actions', 'wp-to-sanity'); ?></option> <option value="delete"><?php esc_html_e('Delete', 'wp-to-sanity'); ?></option> <option value="retry"><?php esc_html_e('Retry Failed', 'wp-to-sanity'); ?></option> </select> <button type="submit" class="button action"><?php esc_html_e('Apply', 'wp-to-sanity'); ?></button> </div> <div class="tablenav-pages"> <?php echo paginate_links([ 'base' => add_query_arg('paged', '%#%'), 'format' => '', 'prev_text' => __('«'), 'next_text' => __('»'), 'total' => $total_pages, 'current' => $paged, ]); ?> </div> <br class="clear"> </div> </form> </div> <style> .wp-to-sanity-log .wp-to-sanity-filters { margin: 20px 0; padding: 15px; background: #f0f0f1; border-radius: 4px; } .wp-to-sanity-filters label { margin-right: 20px; } .wp-to-sanity-filters select, .wp-to-sanity-filters input[type="search"] { margin-left: 5px; } .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.failed, .status-badge.error { background: #fee2e2; color: #991b1b; } tr.status-success { background: #f0fff4; } tr.status-pending { background: #fffbeb; } tr.status-failed, tr.status-error { background: #fef2f2; } .error-message { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #d63638; } code { background: #f0f0f1; padding: 2px 5px; border-radius: 3px; font-size: 0.9em; } </style> <script> jQuery(document).ready(function($) { // Select all checkbox $('#cb-select-all').on('change', function() { $('input[name="log_ids[]"]').prop('checked', this.checked); }); }); </script>
Save
cmd:
run