This repository has been archived by the owner on Jul 20, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #296 from Automattic/clean-up-vip-scanner-class-file
Clean up VIP Scanner class file.
- Loading branch information
Showing
3 changed files
with
118 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
/** | ||
* Go Go VIP Scanner! | ||
* Scan all sorts of themes and files and things. | ||
*/ | ||
|
||
class VIP_Scanner { | ||
private static $instance; | ||
var $reviews = array(); | ||
|
||
static function get_instance() { | ||
if ( ! isset( self::$instance ) ) { | ||
$class_name = __CLASS__; | ||
self::$instance = new $class_name; | ||
} | ||
return self::$instance; | ||
} | ||
|
||
function get_review_types() { | ||
return array_keys( $this->reviews ); | ||
} | ||
|
||
function get_review( $name ) { | ||
if ( isset( $this->reviews[ $name ] ) ) | ||
return $this->reviews[ $name ]; | ||
return false; | ||
} | ||
|
||
function register_review( $name, $checks, $analyzers = array() ) { | ||
$this->reviews[ $name ] = array( | ||
'checks' => (array) $checks, | ||
'analyzers' => (array) $analyzers, | ||
); | ||
} | ||
|
||
function run_theme_review( $theme, $review_type, $scanners = array( 'checks', 'analyzers' ) ) { | ||
$review = $this->get_review( $review_type ); | ||
if ( ! $review ) | ||
return false; | ||
|
||
do_action( 'vip_scanner_pre_theme_review', $theme, $review_type ); | ||
|
||
$scanner = new ThemeScanner( $theme, $review ); | ||
$scanner->scan( $scanners ); | ||
|
||
do_action( 'vip_scanner_post_theme_review', $theme, $review_type, $scanner ); | ||
return $scanner; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.