/** * @return MainManager instance */ public static function getInstance() { if (is_null(self::$_instance)) { self::$_instance = new MainManager(); } return self::$_instance; }
<?php /** * This file remove tables and options of WSI. */ // if(!defined(WP_UNINSTALL_PLUGIN)) exit(); if (!defined('ABSPATH') && !defined('WP_UNINSTALL_PLUGIN')) { exit; } include 'wsi/DAO/MainManager.class.php'; include 'wsi/DAO/ConfigManager.class.php'; include 'wsi/DAO/SplashImageManager.class.php'; include 'wsi/WsiCommons.class.php'; // Liste des tables qui seront supprimées $list_tables = WsiCommons::getWsiTablesList(); foreach ($list_tables as $table) { MainManager::getInstance()->drop_wsi_table($table); } // Liste des options qui seront supprimées $list_options = WsiCommons::getWsiOptionsList(); foreach ($list_options as $option) { MainManager::getInstance()->delete_wsi_option($option); }
/** * Retourne un maximum d'infos pour aider à la * correction du problème rencontré par l'utilisateur (format HTML). */ private function get_system_info() { $systemInfos = "<pre style='background-color: #FFFF99;padding: 10px;width: 98%;border: 1px black dashed;'>"; $systemInfos .= "-----------------------\n"; $systemInfos .= "-- WSI - System Info --\n"; $systemInfos .= "-----------------------\n\n"; $systemInfos .= get_bloginfo('name') . " -> " . get_bloginfo('url') . "\n"; $systemInfos .= get_bloginfo('description') . "\n\n"; $systemInfos .= "-- Wordpress Info --\n"; $systemInfos .= "Version: " . get_bloginfo('version') . "\n\n"; $systemInfos .= "-- Plugins actifs --\n"; foreach (get_plugins() as $plugin_file => $plugin_data) { if (is_plugin_active($plugin_file)) { $systemInfos .= $plugin_data['Name']; $systemInfos .= " (" . $plugin_data['Version'] . ")"; $systemInfos .= " - " . $plugin_data['PluginURI']; $systemInfos .= "\n"; } } $systemInfos .= "\n"; $systemInfos .= "-- Plugins inactifs --\n"; foreach (get_plugins() as $plugin_file => $plugin_data) { if (is_plugin_inactive($plugin_file)) { $systemInfos .= $plugin_data['Name']; $systemInfos .= " (" . $plugin_data['Version'] . ")"; $systemInfos .= " - " . $plugin_data['PluginURI']; $systemInfos .= "\n"; } } $systemInfos .= "\n"; $systemInfos .= "-- Paramétrage WSI --\n"; $systemInfos .= MainManager::getInstance()->getInfos(); $systemInfos .= "</pre>"; return $systemInfos; }
<?php // Vérification du token de sécurité. check_admin_referer('reset', 'nonce_reset_field'); // Remise de toutes les options aux valeurs par défaut MainManager::getInstance()->reset();