-
Notifications
You must be signed in to change notification settings - Fork 24
/
clef-require.php
54 lines (41 loc) · 1.9 KB
/
clef-require.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
<?php if (!class_exists('Clef')) {
class Clef {
private static $instance = null;
private function __construct() {
$this->define_constants();
if (CLEF_IS_BASE_PLUGIN) {
require_once(CLEF_PATH . 'includes/class.clef-setup.php');
ClefSetup::register_plugin_hooks();
}
// Load translations
load_plugin_textdomain( 'wpclef', false, dirname(plugin_basename(__FILE__)) .'/languages' );
require_once(CLEF_PATH . 'includes/class.clef-core.php');
add_action('plugins_loaded', array('ClefCore', 'manage_wp_fix'), 0);
add_action('plugins_loaded', array('ClefCore', 'start'));
require_once(CLEF_PATH . 'includes/class.clef-wind-down.php');
add_action( 'init', array( 'ClefWindDown', 'init' ), 1 );
}
private function define_constants() {
define('CLEF_VERSION', '2.6.3');
if (!defined('CLEF_IS_BASE_PLUGIN')) define('CLEF_IS_BASE_PLUGIN', false);
if (!defined('CLEF_DEBUG')) define('CLEF_DEBUG', false);
define('CLEF_PATH', plugin_dir_path(__FILE__));
define('CLEF_URL', plugin_dir_url(__FILE__));
define('CLEF_TEMPLATE_PATH', CLEF_PATH . 'templates/');
define('CLEF_OPTIONS_NAME', 'wpclef');
if (!defined('CLEF_BASE')) define( 'CLEF_BASE', 'https://clef.io');
if (!defined('CLEF_JS_URL')) define( 'CLEF_JS_URL', CLEF_BASE . '/v3/clef.js');
if (!defined('CLEF_API_BASE')) define( 'CLEF_API_BASE', CLEF_BASE . '/api/v1/');
// Accommodate WP Engine's throttle on the Heartbeat API
if ( class_exists('WPE_Heartbeat_Throttle') ) {
if (!defined('WPE_HEARTBEAT_INTERVAL')) define('WPE_HEARTBEAT_INTERVAL', 5);
}
}
public static function start() {
if (!isset(self::$instance) || self::$instance === null) {
self::$instance = new self;
}
return self::$instance;
}
}
} ?>