<?php
/*
Plugin Name: TimThumb Vulnerability Scanner
Plugin URI: http://codegarage.com/blog/plugins/timthumb-vulnerability-scanner
Description: Keep your instances of Timthumb up to date and free from vulnerabilities simply.  Bonus - checks for obvious signs of compromised sites.
Author: Peter Butler
Version: 1.54
Author URI: http://peterbutler.me/
*/

if ( ! defined('ABSPATH') ) {
	die('Please do not load this file directly.');
}

include_once 'class-cg-tvs-plugin.php';
  $CG_TVS_Plugin = new CG_TVS_Plugin();
if(is_admin()){
  $CG_TVS_Plugin->init();
}
add_action( 'admin_menu', array($CG_TVS_Plugin, 'add_menus' ) );
register_activation_hook( __FILE__,   array($CG_TVS_Plugin, 'activate' ) );
register_deactivation_hook( __FILE__, array($CG_TVS_Plugin, 'deactivate' ) );

// For automatic daily scans
add_action('cg_tvs_daily_scan', 'cg_tvs_daily_scan');

function cg_tvs_daily_scan() {
  global $CG_TVS_Plugin;
  $CG_TVS_Plugin->init();
  $CG_TVS_Plugin->scan();
}
