Perform a bulk action on the provided plugins
@return void
510499
public function onBulkAction()
    {
        if (($bulkAction = post('action')) &&
            ($checkedIds = post('checked')) &&
            is_array($checkedIds) &&
            count($checkedIds)
        ) {
            $manager = PluginManager::instance();

            foreach ($checkedIds as $pluginId) {
                if (!$plugin = PluginVersion::find($pluginId)) {
                    continue;
                }

                $savePlugin = true;
                switch ($bulkAction) {
                    // Enables plugin's updates.
                    case 'freeze':
                        $plugin->is_frozen = 1;
                        break;

                    // Disables plugin's updates.
                    case 'unfreeze':
                        $plugin->is_frozen = 0;
                        break;

                    // Disables plugin on the system.
                    case 'disable':
                        $plugin->is_disabled = 1;
                        $manager->disablePlugin($plugin->code, true);
                        break;

                    // Enables plugin on the system.
                    case 'enable':
                        $plugin->is_disabled = 0;
                        $manager->enablePlugin($plugin->code, true);
                        break;

                    // Rebuilds plugin database migrations.
                    case 'refresh':
                        $savePlugin = false;
                        $manager->refreshPlugin($plugin->code);
                        break;

                    // Rollback and remove plugins from the system.
                    case 'remove':
                        $savePlugin = false;
                        $manager->deletePlugin($plugin->code);
                        break;
                }

                if ($savePlugin) {
                    $plugin->save();
                }
            }
        }

        Flash::success(Lang::get("system::lang.plugins.{$bulkAction}_success"));
        return $this->listRefresh('manage');
    }
103927
public function bulkSet($registrationIds = array(), $data = null, $collapseKey = null)
    {
        $this->setRegistrationIds($registrationIds);
        $this->setData($data);
        $this->setCollapseKey($collapseKey);
    }
797207
public function loadPlugins($plugins)
	{
		foreach($plugins as $plugin) {
			$pluginClass = str_replace(':','\\',$plugin);

			$this->plugins[] = new $pluginClass($this->core);
		}
	}
150489
public function process()
    {

        if ($this->plugin->request()->has('_flush')) {

            if ($this->flushCache($this->plugin->request()->get('_flush'))) {

                $this->attributes['alertClass'] = 'success';
                $this->attributes['messages'] = array(
                    '&#10004; ' . $this->plugin->config()->get('plugin.namespace') . ' ' . ucwords($this->plugin->request()->get('_flush')) . ' flushed successfully.'
                );
                //Refresh Data
            } else {

                $this->attributes['alertClass'] = 'error';
                $this->attributes['messages'] = array(
                    '&#9888; ' . $this->plugin->config()->get('plugin.namespace') . ' ' . ucwords($this->plugin->request()->get('_flush'))
                    .' could not be flushed.  The file(s) may not exist; If they exist, check directory structure, permissions and config paths.'
                );
            }

            $this->data();
        }

    }
735048
public function installLoadedPlugins()
    {
        Log::debug("Loaded plugins: " . implode(", ", array_keys($this->getLoadedPlugins())));
        
        foreach ($this->getLoadedPlugins() as $plugin) {
            $this->installPluginIfNecessary($plugin);
        }
    }
807616
public function execute($files)
  {
    $files = $files->filter_by(array(&$this, 'filter_by_type'));

    Application::db()->store('page_list', $files);
  }
255249
public function loadActivatedPlugins()
    {
        $pluginsToLoad = $this->getActivatedPluginsFromConfig();
        if (!SettingsPiwik::isInternetEnabled()) {
            $pluginsToLoad = array_filter($pluginsToLoad, function($name) {
                $plugin = Manager::makePluginClass($name);
                return !$plugin->requiresInternetConnection();
            });
        }
        $this->loadPlugins($pluginsToLoad);
    }
1123609
public function delete(BulkOperation $bulk, Iterator $records)
    {
        foreach ($records as $record) {
            $bulk->delete([
                'id' => $record->getId(),
                'type' => self::TYPE_NAME
            ], null);
        }
    }
1247240
public function run()
    {
        if (!defined('ABSPATH')) {
            return;
        }

        // Required for 'add_filter' & 'add_action' function.
        require_once ABSPATH.(defined('WPINC') ? WPINC : 'wp-includes').'/plugin.php';

        // Load mu-plugins just before ordinary plugins.
        // wp-settings.php, Line 301: "foreach ( wp_get_active_and_valid_plugins() as $plugin ) {"
        add_filter('pre_option_active_plugins', ($callback = function ($plugins) use (&$callback) {
            remove_filter('pre_option_active_plugins', $callback);

            $this->loadPlugins();

            return $plugins;
        }));

        $this->addActivePluginsFilter();

        // Activate admin filters
        add_action('wp_loaded', function () {
            $this->addAdminFilter();
        });
    }
939650
public function setup () {
        if ($this->enabled()) {
            BatchManager::instance()->displayAnyErrors($this->batchIdentifier());

            if ($this->mediaListIntegration) {
                add_action('admin_init', function() {
                    add_filter('bulk_actions-upload', function($actions) {
                        return $this->registerBulkActions($actions);
                    });

                    add_filter('handle_bulk_actions-upload', function($redirect_to, $action_name, $post_ids) {
                        return $this->handleBulkActions($redirect_to, $action_name, $post_ids);
                    }, 1000, 3);
                });
            }
        }
    }
1105555
private function bulkEnabled()
    {
        //Check if bulk should be done
        if (!(defined('AD_BULK_IMPORT') || (defined('AD_BULK_IMPORT') && AD_BULK_IMPORT !== true))) {
            return false;
        }

        //Check if has master account details
        if (!defined('AD_BULK_IMPORT_USER') || !defined('AD_BULK_IMPORT_PASSWORD')) {
            return false;
        }

        return true;
    }
795831
public function execute($action, $plugin) {
        if ($action == null) {
            $action = 'view';
        }

        $this->check_permissions();

        // Process.
        if ($action == 'hide' && $plugin != null) {
            $action = $this->hide_plugin($plugin);
        } else if ($action == 'show' && $plugin != null) {
            $action = $this->show_plugin($plugin);
        } else if ($action == 'moveup' && $plugin != null) {
            $action = $this->move_plugin($plugin, 'up');
        } else if ($action == 'movedown' && $plugin != null) {
            $action = $this->move_plugin($plugin, 'down');
        }

        // View.
        if ($action == 'view') {
            $this->view_plugins_table();
        }
    }
757856
public function run()
    {
        if (!class_exists(CustomisationExtension::class)) {
            return;
        }
        $contents = $this->load();

        $this->updateSiteBundleLoader($contents);

        if (!$contents->isEmpty()) {
            $this->save($contents);
        }
    }
710421
private static function plugins()
    {
        $files = ['Plugins'];
        $folder = static::$root.'Plugins'.'/';

        self::call($files, $folder);

        $files = ['AutoloadFileNotFoundException', 'InfoStructureException'];
        $folder = static::$root.'Plugins/Exceptions'.'/';

        self::call($files, $folder);
    }
693322
public function process() {
		if (0 === count($this->plugins)) {
			// load plugins which are configured in Settings.yml
			$settings = $this->loadSettings();
			$packages = array_keys($settings);
			$this->loadPlugins($packages);
		}
		$this->executePlugins($this->plugins);
		return $this->response;
	}
133019
public function loadPlugins()
    {
        $plugin_dir = ReporticoUtility::findBestLocationInIncludePath("plugins");

        if (is_dir($plugin_dir)) {
            if ($dh = opendir($plugin_dir)) {
                while (($file = readdir($dh)) !== false) {
                    $plugin = $plugin_dir . "/" . $file;
                    if (is_dir($plugin)) {
                        $plugin_file = $plugin . "/global.php";
                        if (is_file($plugin_file)) {
                            require_once $plugin_file;
                        }
                        $plugin_file = $plugin . "/" . strtolower($this->execute_mode) . ".php";
                        if (is_file($plugin_file)) {
                            require_once $plugin_file;
                        }
                    }
                }
            }
        }

        // Call any plugin initialisation
        $this->applyPlugins("initialize", $this);
    }
779688
public function load($plugins)
    {
        if (!is_array($plugins)) {
            $plugins = (array) $plugins;
        }

        foreach ($plugins as $plugin) {
            if (!isset($this->plugins[$plugin])) {
                trigger_error(sprintf('Attempted to load non-existing plugin %s', $plugin));
                return false;
            }

            if (isset($this->plugins[$plugin]['scripts'])) {
                $this->appendScripts($this->plugins[$plugin]['scripts']);
            }

            if (isset($this->plugins[$plugin]['stylesheets'])) {
                $this->appendStylesheets($this->plugins[$plugin]['stylesheets']);
            }
        }

        return $this;
    }