09b`F8b`FP8b`F7b`Fp7b`F7b`F6b`F 6b`F5b`F@5b`F4b`F`4b`F3b`F3b`Fh`F3b`F2b`F02b`F1b`FP1b`F0b`Fp0b`F0b`FP/b`F.b`Fed up to' => 'Tested up to', 'Requires at least' => 'Requires at least', ); } /** * Get the translated plugin title. * * @return string */ public function getPluginTitle() { $title = ''; $header = $this->getPluginHeader(); if ($header && !empty($header['Name']) && isset($header['TextDomain'])) { $title = \translate($header['Name'], $header['TextDomain']); } return $title; } /** * Get plugin's metadata from its file header. * * @return array */ public function getPluginHeader() { if (!\is_file($this->pluginAbsolutePath)) { //This can happen if the plugin filename is wrong. $this->updateChecker->triggerError(\sprintf("Can't to read the plugin header for '%s'. The file does not exist.", $this->updateChecker->pluginFile), \E_USER_WARNING); return array(); } if (!\function_exists('get_plugin_data')) { require_once ABSPATH . '/wp-admin/includes/plugin.php'; } return \get_plugin_data($this->pluginAbsolutePath, \false, \false); } public function removeHooks() { \remove_filter('upgrader_post_install', array($this, 'clearCachedVersion')); \remove_action('delete_site_transient_update_plugins', array($this, 'clearCachedVersion')); } /** * Check if the plugin file is inside the mu-plugins directory. * * @return bool */ public function isMuPlugin() { static $cachedResult = null; if ($cachedResult === null) { if (!\defined('WPMU_PLUGIN_DIR') || !\is_string(WPMU_PLUGIN_DIR)) { $cachedResult = \false; return $cachedResult; } //Convert both paths to the canonical form before comparison. $muPluginDir = \realpath(WPMU_PLUGIN_DIR); $pluginPath = \realpath($this->pluginAbsolutePath); //If realpath() fails, just normalize the syntax instead. if ($muPluginDir === \false || $pluginPath === \false) { $muPluginDir = PucFactory::normalizePath(WPMU_PLUGIN_DIR); $pluginPath = PucFactory::normalizePath($this->pluginAbsolutePath); } $cachedResult = \strpos($pluginPath, $muPluginDir) === 0; } return $cachedResult; } } }