芝麻web文件管理V1.00
编辑当前文件:/home/freeclou/optimyar/wp-content/plugins/wp-statistics/src/Core/AbstractCore.php
latestVersion = WP_STATISTICS_VERSION; $this->networkWide = (bool)$networkWide; $this->setWpdb(); } /** * Initialize the wpdb property from the global $wpdb. */ private function setWpdb() { global $wpdb; $this->wpdb = $wpdb; } /** * Initialize default options. * * @return void */ protected function initializeDefaultOptions() { $this->loadRequiredFiles(); $options = get_option(Option::$opt_name); if (empty($options) || !is_array($options)) { update_option(Option::$opt_name, Option::defaultOption()); } } /** * Load required files. * * @return void */ private function loadRequiredFiles() { require_once WP_STATISTICS_DIR . 'includes/admin/class-wp-statistics-admin-template.php'; require_once WP_STATISTICS_DIR . 'includes/class-wp-statistics-option.php'; require_once WP_STATISTICS_DIR . 'includes/class-wp-statistics-helper.php'; require_once WP_STATISTICS_DIR . 'includes/class-wp-statistics-user-online.php'; require_once WP_STATISTICS_DIR . 'includes/class-wp-statistics-visitor.php'; } /** * Checks whether the plugin is a fresh installation. * * @return void */ protected function checkIsFresh() { $version = get_option('wp_statistics_plugin_version'); if (empty($version)) { update_option('wp_statistics_is_fresh', true); } else { update_option('wp_statistics_is_fresh', false); } $installationTime = get_option('wp_statistics_installation_time'); if (empty($installationTime)) { update_option('wp_statistics_installation_time', time()); } } /** * Checks whether the plugin is updated. * * @return bool */ protected function isUpdated() { $this->currentVersion = get_option('wp_statistics_plugin_version', WP_STATISTICS_VERSION); return $this->currentVersion != $this->latestVersion; } /** * Update the plugin version. * * @return void */ protected function updateVersion() { update_option('wp_statistics_plugin_version', $this->latestVersion); } /** * Execute the core function. * * @return void */ abstract public function execute(); }