/** * Find and load core and pro features. * * @access public * @since 0.1 * @return array Files to include */ protected function load_features() { $found = []; $path = $this->properties->plugin_dir_path() . '/src/inc'; if (!is_readable($path)) { return $found; } $files = glob("{$path}/feature.*.php"); if (empty($files)) { return $found; } foreach ($files as $file) { $found[] = $file; require $file; } // We need the return value for tests. return $found; }
/** * Checks if MultilingualPress has been activated network-wide, and collects potential error messages. * * @return void */ private function check_plugin_activation() { $plugin_file_path = wp_normalize_path(realpath($this->plugin_properties->plugin_file_path())); foreach (wp_get_active_network_plugins() as $plugin) { if ($plugin_file_path === wp_normalize_path(realpath($plugin))) { return; } } /* translators: %s: link to network plugin screen */ $message = __('This plugin must be activated for the network. Please use the <a href="%s">network plugin administration</a>.', 'multilingual-press'); $this->errors[] = sprintf($message, esc_url(network_admin_url('plugins.php'))); }