ERROR CRÍTICO corregido: - El sitio estaba caído porque init.php intentaba cargar sanitizers eliminados - Eliminadas líneas 30-36 que cargaban class-topbar-sanitizer.php y otros - Sitio ahora funcional nuevamente Ref: admin/init.php línea 33
60 lines
1.9 KiB
PHP
60 lines
1.9 KiB
PHP
<?php
|
|
/**
|
|
* Admin Panel Module - Initialization
|
|
*
|
|
* Sistema de configuración por componentes
|
|
* Cada componente del tema es configurable desde el admin panel
|
|
*
|
|
* @package Apus_Theme
|
|
* @since 2.0.0
|
|
*/
|
|
|
|
// Prevent direct access
|
|
if (!defined('ABSPATH')) {
|
|
exit;
|
|
}
|
|
|
|
// Module constants
|
|
define('APUS_ADMIN_PANEL_VERSION', '2.1.4');
|
|
define('APUS_ADMIN_PANEL_PATH', get_template_directory() . '/admin/');
|
|
define('APUS_ADMIN_PANEL_URL', get_template_directory_uri() . '/admin/');
|
|
|
|
// Load classes
|
|
require_once APUS_ADMIN_PANEL_PATH . 'includes/class-admin-menu.php';
|
|
require_once APUS_ADMIN_PANEL_PATH . 'includes/class-db-manager.php';
|
|
require_once APUS_ADMIN_PANEL_PATH . 'includes/class-data-migrator.php';
|
|
require_once APUS_ADMIN_PANEL_PATH . 'includes/class-validator.php';
|
|
require_once APUS_ADMIN_PANEL_PATH . 'includes/class-theme-options-migrator.php';
|
|
|
|
// Settings Manager
|
|
require_once APUS_ADMIN_PANEL_PATH . 'includes/class-settings-manager.php';
|
|
|
|
// Initialize Database Manager
|
|
new APUS_DB_Manager();
|
|
|
|
// Execute data migration (one-time operation)
|
|
add_action('admin_init', function() {
|
|
$migrator = new APUS_Data_Migrator();
|
|
$result = $migrator->maybe_migrate();
|
|
|
|
if ($result['success'] && isset($result['total_migrated'])) {
|
|
error_log('APUS Theme: Migración completada - ' . $result['total_migrated'] . ' registros migrados');
|
|
}
|
|
});
|
|
|
|
// Execute Theme Options migration (one-time operation)
|
|
add_action('admin_init', function() {
|
|
$theme_options_migrator = new APUS_Theme_Options_Migrator();
|
|
|
|
// Solo ejecutar si no se ha migrado ya
|
|
if (!$theme_options_migrator->is_migrated()) {
|
|
$result = $theme_options_migrator->migrate();
|
|
|
|
if ($result['success']) {
|
|
error_log('APUS Theme: Theme Options migradas exitosamente - ' . $result['migrated'] . ' configuraciones');
|
|
} else {
|
|
error_log('APUS Theme: Error en migración de Theme Options - ' . $result['message']);
|
|
}
|
|
}
|
|
});
|