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