| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Statify |
| 4 |
* Description: Compact, easy-to-use and privacy-compliant stats plugin for WordPress. |
| 5 |
* Text Domain: statify |
| 6 |
* Author: pluginkollektiv |
| 7 |
* Author URI: https://pluginkollektiv.org |
| 8 |
* Plugin URI: https://wordpress.org/plugins/statify/ |
| 9 |
* License: GPLv3 or later |
| 10 |
* Version: 1.7.1 |
| 11 |
* |
| 12 |
* @package WordPress |
| 13 |
*/ |
| 14 |
|
| 15 |
/* Quit */ |
| 16 |
defined( 'ABSPATH' ) || exit; |
| 17 |
|
| 18 |
|
| 19 |
/* Constants */ |
| 20 |
define( 'STATIFY_FILE', __FILE__ ); |
| 21 |
define( 'STATIFY_DIR', dirname( __FILE__ ) ); |
| 22 |
define( 'STATIFY_BASE', plugin_basename( __FILE__ ) ); |
| 23 |
define( 'STATIFY_VERSION', '1.7.0' ); |
| 24 |
|
| 25 |
|
| 26 |
/* Hooks */ |
| 27 |
add_action( |
| 28 |
'plugins_loaded', |
| 29 |
array( |
| 30 |
'Statify', |
| 31 |
'init', |
| 32 |
) |
| 33 |
); |
| 34 |
register_activation_hook( |
| 35 |
STATIFY_FILE, |
| 36 |
array( |
| 37 |
'Statify_Install', |
| 38 |
'init', |
| 39 |
) |
| 40 |
); |
| 41 |
register_deactivation_hook( |
| 42 |
STATIFY_FILE, |
| 43 |
array( |
| 44 |
'Statify_Deactivate', |
| 45 |
'init', |
| 46 |
) |
| 47 |
); |
| 48 |
register_uninstall_hook( |
| 49 |
STATIFY_FILE, |
| 50 |
array( |
| 51 |
'Statify_Uninstall', |
| 52 |
'init', |
| 53 |
) |
| 54 |
); |
| 55 |
|
| 56 |
|
| 57 |
/* Autoload */ |
| 58 |
spl_autoload_register( 'statify_autoload' ); |
| 59 |
|
| 60 |
/** |
| 61 |
* Include classes via autoload. |
| 62 |
* |
| 63 |
* @param string $class Name of an class-file name, without file extension. |
| 64 |
*/ |
| 65 |
function statify_autoload( $class ) { |
| 66 |
|
| 67 |
$plugin_classes = array( |
| 68 |
'Statify', |
| 69 |
'Statify_Backend', |
| 70 |
'Statify_Frontend', |
| 71 |
'Statify_Dashboard', |
| 72 |
'Statify_Install', |
| 73 |
'Statify_Uninstall', |
| 74 |
'Statify_Deactivate', |
| 75 |
'Statify_Settings', |
| 76 |
'Statify_Table', |
| 77 |
'Statify_XMLRPC', |
| 78 |
'Statify_Cron', |
| 79 |
); |
| 80 |
|
| 81 |
if ( in_array( $class, $plugin_classes, true ) ) { |
| 82 |
require_once sprintf( |
| 83 |
'%s/inc/class-%s.php', |
| 84 |
STATIFY_DIR, |
| 85 |
strtolower( str_replace( '_', '-', $class ) ) |
| 86 |
); |
| 87 |
} |
| 88 |
} |
| 89 |
|