| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: Plugin-Check |
| 4 |
Plugin URI: http://pross.org.uk/plugins |
| 5 |
Description: Plugin-Check BETA |
| 6 |
Author: Pross |
| 7 |
Author URI: http://pross.org.uk |
| 8 |
Version: 0.1 |
| 9 |
*/ |
| 10 |
|
| 11 |
|
| 12 |
function plugincheck_load_styles() { |
| 13 |
wp_enqueue_style('style', WP_PLUGIN_URL . '/theme-check/style.css', null, null, 'screen'); |
| 14 |
} |
| 15 |
|
| 16 |
add_action( 'admin_menu', 'plugincheck_add_page' ); |
| 17 |
function plugincheck_add_page() { |
| 18 |
$page = add_plugins_page( 'Plugin Check', 'Plugin Check', 'manage_options', 'plugincheck', 'plugincheck_do_page' ); |
| 19 |
add_action('admin_print_styles-' . $page, 'plugincheck_load_styles'); |
| 20 |
} |
| 21 |
|
| 22 |
function plugincheck_add_headers( $extra_headers ) { |
| 23 |
$extra_headers = array( 'License', 'License URI', 'Template Version' ); |
| 24 |
return $extra_headers; |
| 25 |
} |
| 26 |
|
| 27 |
function plugincheck_do_page() { |
| 28 |
if ( !current_user_can( 'manage_options' ) ) { |
| 29 |
wp_die( __( 'You do not have sufficient permissions to access this page.', 'themecheck' ) ); |
| 30 |
} |
| 31 |
|
| 32 |
add_filter( 'extra_theme_headers', 'tc_add_headers' ); |
| 33 |
|
| 34 |
include 'checkbase.php'; |
| 35 |
include 'main.php'; |
| 36 |
|
| 37 |
echo '<div id="theme-check" class="wrap">'; |
| 38 |
echo '<div id="icon-themes" class="icon32"><br /></div><h2>Plugin-Check</h2>'; |
| 39 |
echo '<div class="theme-check">'; |
| 40 |
tc_form(); |
| 41 |
if ( !isset( $_POST[ 'plugincheck' ] ) ) { |
| 42 |
tc_intro(); |
| 43 |
|
| 44 |
} |
| 45 |
|
| 46 |
if ( isset( $_POST[ 'plugincheck' ] ) ) { |
| 47 |
if ( isset( $_POST[ 'trac' ] ) ) define( 'TC_TRAC', true ); |
| 48 |
plugin_check_main( ); |
| 49 |
} |
| 50 |
echo '</div> <!-- .theme-check-->'; |
| 51 |
echo '</div>'; |
| 52 |
} |
| 53 |
|