-
Notifications
You must be signed in to change notification settings - Fork 3
/
blog-tutor-support.php
110 lines (92 loc) · 2.78 KB
/
blog-tutor-support.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?php
/**
* Plugin Name: NerdPress Support
* Description: Helps your site work with our custom Cloudflare Enterprise setup or the Sucuri Firewall, and adds the "NerdPress Help" button in your dashboard.
* Version: 2.4
* Author: NerdPress
* Author URI: https://www.nerdpress.net
* GitHub URI: blogtutor/blog-tutor-support
* License: GPLv2
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// GitHub updater
include( dirname( __FILE__ ) . '/github-updater.php' );
// Load Admin menu
include( dirname( __FILE__ ) . '/includes/admin-menu.php' );
if ( ! defined( 'BT_PLUGIN_VERSION' ) ) {
define( 'BT_PLUGIN_VERSION', '2.4' );
}
if ( ! class_exists( 'NerdPress' ) ) {
/**
* NerdPress main class.
*
* @package NerdPress
* @category Core
* @author Fernando Acosta, Andrew Wilder, Sergio Scabuzzo
*/
class NerdPress {
/**
* Instance of this class.
*
* @var object
*/
protected static $instance = null;
/**
* NerdPress plugin root URL.
*/
public static $plugin_dir_url = '';
/**
* Initialize the plugin.
*/
private function __construct() {
// Include classes.
$this->includes();
if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
$this->admin_includes();
}
self::$plugin_dir_url = plugin_dir_url( __FILE__ );
}
/**
* Return an instance of this class.
*
* @return object A single instance of this class.
*/
public static function get_instance() {
if ( null == self::$instance ) {
self::$instance = new self;
}
return self::$instance;
}
/**
* Include admin actions.
*/
protected function admin_includes() {
include dirname( __FILE__ ) . '/includes/admin/class-support-admin.php';
}
/**
* Include plugin functions.
*/
protected function includes() {
include_once dirname( __FILE__ ) . '/includes/class-support-helpers.php';
include_once dirname( __FILE__ ) . '/includes/class-support-widget.php';
include_once dirname( __FILE__ ) . '/includes/class-support-overrides.php';
include_once dirname( __FILE__ ) . '/includes/class-support-shortpixel.php';
if ( NerdPress_Helpers::is_relay_server_configured() ) {
include_once dirname( __FILE__ ) . '/includes/class-support-snapshot.php';
}
if ( NerdPress_Helpers::is_sucuri_header_set() || NerdPress_Helpers::is_sucuri_firewall_selected() ) {
include_once dirname( __FILE__ ) . '/includes/class-support-cloudproxy.php';
include_once dirname( __FILE__ ) . '/includes/class-support-clearcache.php';
}
if ( NerdPress_Helpers::is_cloudflare_firewall_selected() ) {
include_once dirname( __FILE__ ) . '/includes/class-support-cloudflare.php';
}
}
}
/**
* Init the plugin.
*/
add_action( 'plugins_loaded', array( 'NerdPress', 'get_instance' ) );
}