), E_USER_WARNING ); return array(); } if ( !function_exists('get_plugin_data') ) { /** @noinspection PhpIncludeInspection */ 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 = Puc_v4p11_Factory::normalizePath(WPMU_PLUGIN_DIR); $pluginPath = Puc_v4p11_Factory::normalizePath($this->pluginAbsolutePath); } $cachedResult = (strpos($pluginPath, $muPluginDir) === 0); } return $cachedResult; } } endif;