Airplane_Mode_Core::last_checked_plugins PHP Method

last_checked_plugins() public method

Always send back that the latest version of our plugins are the one we're running
public last_checked_plugins ( ) : object
return object the modified output with our information
        public function last_checked_plugins()
        {
            // Bail if disabled.
            if (!$this->enabled()) {
                return false;
            }
            // Call the global WP version.
            global $wp_version;
            // Set a blank data array.
            $data = array();
            // Add our plugin file if we don't have it.
            if (!function_exists('get_plugins')) {
                require_once ABSPATH . 'wp-admin/includes/plugin.php';
            }
            // Build my plugin data array.
            foreach (get_plugins() as $file => $pl) {
                $data[$file] = $pl['Version'];
            }
            // Return our object.
            return (object) array('last_checked' => time(), 'updates' => array(), 'version_checked' => $wp_version, 'checked' => $data);
        }