Automattic / vip-scanner

Deprecated: Scan all sorts of themes and files and things! Use PHPCS and the VIP coding standards instead
https://automattic.com
140 stars 51 forks source link
deprecated php vip-scanner vip-theme-review wordpress

VIP Scanner Build Status

DEPRECATED: This plugin is no longer used by VIP, instead, use PHP Code Sniffer with the VIP Coding standards available here

A WordPress plugin that enables you to scan all sorts of themes and files and things.

Contributors: Mohammad Jangda, Automattic, Thorsten Ott, Michael Fields, Filipe Varela, Josh Betz, Mike Blouin, Nick Daugherty and Fränk Klein.

Requires WordPress version 3.4 or greater and PHP >= 5.4.

About

The plugin itself is simply a UI for the VIP Scanner library, which does all the heavy lifting. The library allows you to create arbitrary "Checks" (e.g. UndefinedFunctionCheck), group them together as Reviews (e.g. WP.com Theme Review), and run them against themes, plugins, directories, single files, and even diffs.

This plugin is based on code from the Theme Check (written by Pross and Otto42) and Exploit Scanner (written by donncha) plugins.

Requirements

For parsing PHP files, VIP Scanner uses PHP-Parser, which it includes as a git submodule. When cloning VIP Scanner's git repo, use the --recursive parameter to include PHP-Parser, i.e. git clone --recursive git@github.com:Automattic/vip-scanner.git If you have already cloned the repo without the --recursive parameter and find yourself with an empty vendor/PHP-Parser directory, run git submodule update --init --recursive.

Installation

  1. Upload the plugin folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the 'Plugins' menu in WordPress

or

Install using the Plugin Installer.

Usage

You can find the tool under Tools > VIP Scanner. There, you can choose what type of scan you'd like to perform -- there's a dropdown list on the right hand side, just next to the "Scan" button.

The dropdown allows you to choose between three types of scan:

  1. Undefined Function Check
  2. WP.com Theme Review
  3. VIP Theme Review

Once you have selected a scan type, you can hit the "Scan" button and see the results in the tabbed view below.

WP-CLI

If you prefer to use the wp-cli tool for your check, there's a vip-scanner command with two main actions:

  1. analyze-theme
  2. scan-theme
$ wp vip-scanner
usage: wp vip-scanner analyze-theme [--theme=<theme>] [--scan_type=<scan-type>] [--depth=<depth>]
   or: wp vip-scanner scan-theme [--theme=<theme>] [--scan_type=<scan_type>] [--summary] [--format=<format>]

Changelog

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1