/
home
/
vianto5
/
heredit.mx
/
wp-content
/
plugins
/
hm-site-monitor-supabase
/
admin
/
/home/vianto5/heredit.mx/wp-content/plugins/hm-site-monitor-supabase/admin
mkdir
upload
Name
Size
Mode
Actions
css/
-
0777
rm
settings-page.php
9101
0644
edit
dl
rm
Edit:
/home/vianto5/heredit.mx/wp-content/plugins/hm-site-monitor-supabase/admin/settings-page.php
(9101B)
<?php /** * Vista de la página de configuración del plugin (Supabase) */ if (!defined('ABSPATH')) { exit; } $admin_settings = HMSMSB_Admin_Settings::get_instance(); $sync_status = $admin_settings->get_sync_status(); ?> <div class="wrap hmsmsb-admin-wrap"> <h1> <span class="dashicons dashicons-chart-area"></span> <?php esc_html_e('HM Site Monitor - Supabase', 'hm-site-monitor-supabase'); ?> </h1> <div class="hmsmsb-admin-container"> <!-- Panel de estado --> <div class="hmsmsb-status-panel"> <h2><?php esc_html_e('Estado del Monitoreo', 'hm-site-monitor-supabase'); ?></h2> <div class="hmsmsb-status-cards"> <!-- Estado de configuración --> <div class="hmsmsb-status-card <?php echo $sync_status['configured'] ? 'success' : 'warning'; ?>"> <span class="dashicons <?php echo $sync_status['configured'] ? 'dashicons-yes-alt' : 'dashicons-warning'; ?>"></span> <div class="hmsmsb-status-info"> <strong><?php esc_html_e('Supabase', 'hm-site-monitor-supabase'); ?></strong> <span><?php echo $sync_status['configured'] ? esc_html__('Configurado', 'hm-site-monitor-supabase') : esc_html__('No configurado', 'hm-site-monitor-supabase'); ?></span> </div> </div> <!-- Última sincronización --> <div class="hmsmsb-status-card <?php echo $sync_status['status'] === 'success' ? 'success' : ($sync_status['status'] === 'error' ? 'error' : 'neutral'); ?>"> <span class="dashicons dashicons-update"></span> <div class="hmsmsb-status-info"> <strong><?php esc_html_e('Última sincronización', 'hm-site-monitor-supabase'); ?></strong> <span> <?php if ($sync_status['last_sync']) { echo esc_html($sync_status['last_sync']); } else { esc_html_e('Nunca', 'hm-site-monitor-supabase'); } ?> </span> </div> </div> <!-- Próxima sincronización --> <div class="hmsmsb-status-card neutral"> <span class="dashicons dashicons-clock"></span> <div class="hmsmsb-status-info"> <strong><?php esc_html_e('Próxima sincronización', 'hm-site-monitor-supabase'); ?></strong> <span> <?php if ($sync_status['next_sync']) { $next_sync_time = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $sync_status['next_sync']); echo esc_html($next_sync_time); } else { esc_html_e('No programada', 'hm-site-monitor-supabase'); } ?> </span> </div> </div> </div> <!-- Botones de acción --> <div class="hmsmsb-action-buttons"> <button type="button" id="hmsmsb-sync-now" class="button button-primary" <?php echo !$sync_status['configured'] ? 'disabled' : ''; ?>> <span class="dashicons dashicons-update"></span> <?php esc_html_e('Sincronizar ahora', 'hm-site-monitor-supabase'); ?> </button> <button type="button" id="hmsmsb-test-connection" class="button button-secondary" <?php echo !$sync_status['configured'] ? 'disabled' : ''; ?>> <span class="dashicons dashicons-admin-plugins"></span> <?php esc_html_e('Probar conexión', 'hm-site-monitor-supabase'); ?> </button> </div> <div id="hmsmsb-sync-result" class="hmsmsb-notice hidden"></div> </div> <!-- Panel de información del sitio --> <div class="hmsmsb-info-panel"> <h2><?php esc_html_e('Información del Sitio', 'hm-site-monitor-supabase'); ?></h2> <?php $collector = new HMSMSB_Data_Collector(); $site_data = $collector->collect_all(); ?> <table class="hmsmsb-info-table"> <tr> <th><?php esc_html_e('ID del Sitio', 'hm-site-monitor-supabase'); ?></th> <td><code><?php echo esc_html($site_data['site_id']); ?></code></td> </tr> <tr> <th><?php esc_html_e('URL', 'hm-site-monitor-supabase'); ?></th> <td><?php echo esc_html($site_data['site_url']); ?></td> </tr> <tr> <th><?php esc_html_e('WordPress', 'hm-site-monitor-supabase'); ?></th> <td> <?php echo esc_html($site_data['wp_version']['current']); ?> <?php if ($site_data['wp_version']['update_available']) : ?> <span class="hmsmsb-badge warning"><?php echo esc_html(sprintf(__('Actualización: %s', 'hm-site-monitor-supabase'), $site_data['wp_version']['new_version'])); ?></span> <?php endif; ?> </td> </tr> <tr> <th><?php esc_html_e('PHP', 'hm-site-monitor-supabase'); ?></th> <td><?php echo esc_html($site_data['php_version']['version']); ?></td> </tr> <tr> <th><?php esc_html_e('Tema activo', 'hm-site-monitor-supabase'); ?></th> <td> <?php echo esc_html($site_data['theme']['name'] . ' v' . $site_data['theme']['version']); ?> <?php if ($site_data['theme']['update_available']) : ?> <span class="hmsmsb-badge warning"><?php esc_html_e('Actualización disponible', 'hm-site-monitor-supabase'); ?></span> <?php endif; ?> </td> </tr> <tr> <th><?php esc_html_e('Plugins instalados', 'hm-site-monitor-supabase'); ?></th> <td> <?php $total_plugins = count($site_data['plugins']); $plugins_with_updates = count(array_filter($site_data['plugins'], function($p) { return $p['update_available']; })); echo esc_html($total_plugins); if ($plugins_with_updates > 0) { echo ' <span class="hmsmsb-badge warning">' . esc_html(sprintf(__('%d con actualizaciones', 'hm-site-monitor-supabase'), $plugins_with_updates)) . '</span>'; } ?> </td> </tr> <tr> <th><?php esc_html_e('SSL', 'hm-site-monitor-supabase'); ?></th> <td> <?php if ($site_data['ssl_status']['enabled']) : ?> <span class="hmsmsb-badge <?php echo $site_data['ssl_status']['valid'] ? 'success' : 'error'; ?>"> <?php echo $site_data['ssl_status']['valid'] ? esc_html__('Activo y válido', 'hm-site-monitor-supabase') : esc_html__('Certificado expirado', 'hm-site-monitor-supabase'); ?> </span> <?php if ($site_data['ssl_status']['expiry']) : ?> <small>(<?php echo esc_html(sprintf(__('Expira: %s', 'hm-site-monitor-supabase'), $site_data['ssl_status']['expiry'])); ?>)</small> <?php endif; ?> <?php else : ?> <span class="hmsmsb-badge error"><?php esc_html_e('No activo', 'hm-site-monitor-supabase'); ?></span> <?php endif; ?> </td> </tr> <tr> <th><?php esc_html_e('Espacio en uploads', 'hm-site-monitor-supabase'); ?></th> <td><?php echo esc_html($site_data['disk_space']['uploads_size']); ?></td> </tr> </table> </div> <!-- Formulario de configuración --> <div class="hmsmsb-settings-panel"> <h2><?php esc_html_e('Configuración', 'hm-site-monitor-supabase'); ?></h2> <form method="post" action="options.php"> <?php settings_fields('hmsmsb_settings_group'); do_settings_sections('hm-site-monitor-supabase'); submit_button(__('Guardar configuración', 'hm-site-monitor-supabase')); ?> </form> </div> </div> </div>
Save
cmd:
run