-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathload.php
95 lines (78 loc) · 2.96 KB
/
load.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
94
95
<?php
/**
* Load the SI application
* (function called at the bottom of this page)
*
* @package EDD_Segment
* @return void
*/
function edd_segment_load() {
if ( class_exists( 'EDD_Segment' ) ) {
edd_segment_deactivate_plugin();
return; // already loaded, or a name collision
}
do_action( 'edd_segment_preload' );
//////////
// Load //
//////////
// Master class
require_once EDD_SEGMENT_PATH.'/Segment.php';
// controllers
require_once EDD_SEGMENT_PATH.'/controllers/_Controller.php';
EDD_Segment_Controller::init();
if ( ! class_exists( 'SA_Settings_API' ) ) {
require_once EDD_SEGMENT_PATH.'/controllers/_Settings.php';
SA_Settings_API::init();
}
require_once EDD_SEGMENT_PATH.'/controllers/Settings.php';
EDD_Segment_Settings::init();
require_once EDD_SEGMENT_PATH.'/controllers/Identity.php';
EDD_Segment_Identity::init();
require_once EDD_SEGMENT_PATH.'/controllers/integrations/Segment_API.php';
EDD_Segment_Tracker::init();
require_once EDD_SEGMENT_PATH.'/controllers/integrations/CustomerIO_API.php';
EDD_CustomerIO_Tracker::init();
if ( file_exists( EDD_SEGMENT_PATH.'/controllers/add-ons/AJAX_Callbacks.php' ) ) {
require_once EDD_SEGMENT_PATH.'/controllers/add-ons/AJAX_Callbacks.php';
EDD_Segment_AJAX_Callbacks::init();
}
if ( file_exists( EDD_SEGMENT_PATH.'/controllers/add-ons/Freemius_Webhook.php' ) ) {
require_once EDD_SEGMENT_PATH.'/controllers/add-ons/Freemius_Webhook.php';
EDD_Segment_Freemius_Webhook::init();
}
require_once EDD_SEGMENT_PATH.'/controllers/add-ons/EDD_Hooks.php';
EDD_Segment_Hooks::init();
require_once EDD_SEGMENT_PATH.'/controllers/Updates.php';
EDD_Segment_Updates::init();
require_once EDD_SEGMENT_PATH.'/template-tags/edd-segment.php';
do_action( 'edd_segment_loaded' );
}
/**
* Minimum supported version of WordPress
*/
define( 'EDD_SEGMENT_SUPPORTED_WP_VERSION', version_compare( get_bloginfo( 'version' ), '3.7', '>=' ) );
/**
* Minimum supported version of PHP
*/
define( 'EDD_SEGMENT_SUPPORTED_PHP_VERSION', version_compare( phpversion(), '5.2.4', '>=' ) );
/**
* Compatibility check
*/
if ( EDD_SEGMENT_SUPPORTED_WP_VERSION && EDD_SEGMENT_SUPPORTED_PHP_VERSION ) {
edd_segment_load();
} else {
/**
* Disable SI and add fail notices if compatibility check fails
* @return string inserted within the WP dashboard
*/
edd_segment_deactivate_plugin();
add_action( 'admin_head', 'edd_segment_fail_notices' );
function edd_segment_fail_notices() {
if ( ! EDD_SEGMENT_SUPPORTED_WP_VERSION ) {
printf( '<div class="error"><p><strong>EDD Segment</strong> requires WordPress %s or higher. Please upgrade WordPress and activate the EDD Segment Plugin again.</p></div>', EDD_SEGMENT_SUPPORTED_WP_VERSION );
}
if ( ! EDD_SEGMENT_SUPPORTED_PHP_VERSION ) {
printf( '<div class="error"><p><strong>EDD Segment</strong> requires PHP version %s or higher to be installed on your server. Talk to your web host about using a secure version of PHP.</p></div>', EDD_SEGMENT_SUPPORTED_PHP_VERSION );
}
}
}