-
Notifications
You must be signed in to change notification settings - Fork 5
/
host-analyticsjs-local.php
61 lines (49 loc) · 1.28 KB
/
host-analyticsjs-local.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
<?php
/**
* Plugin Name: CAOS
* Plugin URI: https://daan.dev/wordpress/caos/
* Description: Completely optimize Google Analytics 4 for your WordPress Website - host gtag.js locally or use Minimal Analytics and much more!
* Version: 4.8.2
* Author: Daan from Daan.dev
* Author URI: https://daan.dev/
* License: GPL2v2 or later
* Text Domain: host-analyticsjs-local
*/
defined( 'ABSPATH' ) || exit;
define( 'CAOS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'CAOS_PLUGIN_FILE', __FILE__ );
define( 'CAOS_PLUGIN_BASENAME', plugin_basename( CAOS_PLUGIN_FILE ) );
define( 'CAOS_STATIC_VERSION', '4.8.0' );
define( 'CAOS_DB_VERSION', '4.8.0' );
/**
* Takes care of loading classes on demand.
*
* @param $class
*
* @return mixed|void
*/
function caos_autoload( $class ) {
$path = explode( '_', $class );
if ( $path[ 0 ] != 'CAOS' ) {
return;
}
if ( ! class_exists( 'FFWP_Autoloader' ) ) {
require_once CAOS_PLUGIN_DIR . 'ffwp-autoload.php';
}
$autoload = new FFWP_Autoloader( $class );
return include CAOS_PLUGIN_DIR . 'includes/' . $autoload->load();
}
spl_autoload_register( 'caos_autoload' );
/**
* All systems GO!!!
*
* @return CAOS
*/
function caos_init() {
static $caos = null;
if ( $caos === null ) {
$caos = new CAOS();
}
return $caos;
}
caos_init();