Automator_System_Report::get_inactive_plugins()

Get a list of inplugins active on the site.


Return Return

(array)


Source Source

File: src/core/lib/utilities/class-automator-system-report.php

	public function get_inactive_plugins() {
		require_once ABSPATH . 'wp-admin/includes/plugin.php';
		if ( ! function_exists( 'get_plugins' ) ) {
			return array();
		}
		$plugins        = get_plugins();
		$active_plugins = (array) get_option( 'active_plugins', array() );
		if ( is_multisite() ) {
			$network_activated_plugins = array_keys( get_site_option( 'active_sitewide_plugins', array() ) );
			$active_plugins            = array_merge( $active_plugins, $network_activated_plugins );
		}
		$plugins_data = array();
		foreach ( $plugins as $plugin => $data ) {
			if ( in_array( $plugin, $active_plugins, true ) ) {
				continue;
			}
			$plugins_data[] = $this->format_plugin_data( $plugin, $data );
		}
		return $plugins_data;
	}