75 lines
1.4 KiB
PHP
75 lines
1.4 KiB
PHP
<?php
|
|
/*
|
|
Plugin Name: Statify Blacklist
|
|
Description: Extension for the statify plugin to add a customizable blacklists.
|
|
Text Domain: statify-blacklist
|
|
Domain Path: /lang
|
|
Author: stklcode
|
|
Author URI: https://stklcode.de
|
|
Plugin URI: https://wordpress.org/plugins/statifyRefererBlacklist
|
|
License: GPLv3 or later
|
|
Version: 1.0.0
|
|
*/
|
|
|
|
/* Quit */
|
|
defined('ABSPATH') OR exit;
|
|
|
|
/* Constants */
|
|
define('STATIFYBLACKLIST_FILE', __FILE__);
|
|
define('STATIFYBLACKLIST_DIR', dirname(__FILE__));
|
|
define('STATIFYBLACKLIST_BASE', plugin_basename(__FILE__));
|
|
|
|
/* System Hooks */
|
|
add_action(
|
|
'plugins_loaded',
|
|
array(
|
|
'StatifyBlacklist',
|
|
'instance'
|
|
)
|
|
);
|
|
|
|
register_activation_hook(
|
|
STATIFYBLACKLIST_FILE,
|
|
array(
|
|
'StatifyBlacklist_System',
|
|
'install'
|
|
)
|
|
);
|
|
|
|
register_deactivation_hook(
|
|
STATIFYBLACKLIST_FILE,
|
|
array(
|
|
'StatifyBlacklist_System',
|
|
'deactivate'
|
|
)
|
|
);
|
|
|
|
register_uninstall_hook(
|
|
STATIFYBLACKLIST_FILE,
|
|
array(
|
|
'StatifyBlacklist_System',
|
|
'uninstall'
|
|
)
|
|
);
|
|
|
|
/* Autoload */
|
|
spl_autoload_register('statifyBlacklist_autoload');
|
|
|
|
function statifyBlacklist_autoload($class) {
|
|
$plugin_classes = array(
|
|
'StatifyBlacklist',
|
|
'StatifyBlacklist_Admin',
|
|
'StatifyBlacklist_System'
|
|
);
|
|
|
|
if ( in_array($class, $plugin_classes) ) {
|
|
require_once(
|
|
sprintf(
|
|
'%s/inc/%s.class.php',
|
|
STATIFYBLACKLIST_DIR,
|
|
strtolower($class)
|
|
)
|
|
);
|
|
}
|
|
}
|