-
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathstatify.php
More file actions
71 lines (64 loc) · 1.96 KB
/
Copy pathstatify.php
File metadata and controls
71 lines (64 loc) · 1.96 KB
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
<?php
/**
* Plugin Name: Statify
* Plugin URI: https://statify.pluginkollektiv.org/
* Description: Compact, easy-to-use and privacy-compliant stats plugin for WordPress.
* Version: 2.0.2
* Requires at least: 5.1
* Requires PHP: 7.4
* Author: pluginkollektiv
* Author URI: https://pluginkollektiv.org/
* License: GPLv3 or later
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
* Text Domain: statify
*
* @package WordPress
*/
/* Quit */
defined( 'ABSPATH' ) || exit;
/* Constants */
define( 'STATIFY_FILE', __FILE__ );
define( 'STATIFY_DIR', __DIR__ );
define( 'STATIFY_BASE', plugin_basename( __FILE__ ) );
define( 'STATIFY_VERSION', '2.0.2' );
/* 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 Name of an class-file name, without file extension.
*/
function statify_autoload( string $class_name ): void {
$plugin_classes = array(
'Statify',
'Statify_Api',
'Statify_Backend',
'Statify_Evaluation',
'Statify_Frontend',
'Statify_Dashboard',
'Statify_Install',
'Statify_Uninstall',
'Statify_Deactivate',
'Statify_Settings',
'Statify_Table',
'Statify_Cron',
);
if ( in_array( $class_name, $plugin_classes, true ) ) {
require_once sprintf(
'%s/inc/class-%s.php',
STATIFY_DIR,
strtolower( str_replace( '_', '-', $class_name ) )
);
} elseif ( 0 === strncmp( $class_name, 'Jaybizzle\\CrawlerDetect\\', 24 ) && ! class_exists( $class_name, false ) ) {
require_once sprintf(
'%s/lib/%s.php',
STATIFY_DIR,
str_replace( '\\', DIRECTORY_SEPARATOR, $class_name )
);
}
}