/** * Get the plugins and mu-plugins from the mu-plugin path and remove duplicates. * Check cache against current plugins for newly activated plugins. * After that, we can update the cache. */ private function updateCache() { require_once ABSPATH . 'wp-admin/includes/plugin.php'; self::$auto_plugins = get_plugins(self::$relative_path); self::$mu_plugins = get_mu_plugins(); $plugins = array_diff_key(self::$auto_plugins, self::$mu_plugins); $rebuild = !is_array(self::$cache['plugins']); self::$activated = $rebuild ? $plugins : array_diff_key($plugins, self::$cache['plugins']); self::$cache = array('plugins' => $plugins, 'count' => $this->countPlugins()); update_site_option('mu_autoloader', self::$cache); }