<?php
/**
 * Plugin Name:       10up WP-CLI Vulnerability Scanner
 * Plugin URI:        https://github.com/10up/wpcli-vulnerability-scanner
 * Description:       WP-CLI command only. Check WordPress code, installed plugins and themes for vulnerabilities.
 * Version:           1.2.2
 * Requires at least: 5.7
 * Requires PHP:      7.0
 * Tested up to:      6.1
 * Author:            10up
 * Author URI:        https://10up.com
 * License:           MIT
 * License URI:       https://spdx.org/licenses/MIT.html
 * Update URI:        https://github.com/10up/wpcli-vulnerability-scanner
 */

if ( ! defined( 'WP_CLI' ) ) {
	return;
}

// Handle installed as a plugin.
if ( ! class_exists( 'Vulnerability_CLI' ) ) {
	/**
	 * Composer check.
	 */
	if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
		require_once __DIR__ . '/vendor/autoload.php';
	} else {
		WP_CLI::error( 'You appear to be running a development version of 10up WP-CLI Vulnerability Scanner. Please run `composer install` in order for things to work properly.' );
	}
}

WP_CLI::add_command( 'vuln', 'Vulnerability_CLI' );
