forked from bluehost/bluehost-wordpress-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bluehost-wordpress-plugin.php
87 lines (73 loc) · 3.06 KB
/
bluehost-wordpress-plugin.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
<?php
/**
* Bluehost WordPress Plugin
*
* @package WPPluginBluehost
* @author Newfold Digital
* @copyright Copyright 2023 by Newfold Digital - All rights reserved.
* @license GPL-2.0-or-later
*
* @wordpress-plugin
* Plugin Name: The Bluehost Plugin
* Plugin URI: https://bluehost.com
* Update URI: https://github.com/bluehost/bluehost-wordpress-plugin
* Description: WordPress plugin that integrates a WordPress site with the Bluehost control panel, including performance, security, and update features.
* Version: 3.8.4
* Requires at least: 6.0
* Requires PHP: 7.1
* Tested up to: 6.4.3
* Author: Bluehost
* Author URI: https://bluehost.com
* Text Domain: wp-plugin-bluehost
* Domain Path: /languages
* License: GPL 2.0 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
namespace Bluehost;
// Do not allow multiple copies of the Bluehost Plugin to be active
if ( defined( 'BLUEHOST_PLUGIN_VERSION' ) ) {
exit;
}
// Define constants
define( 'BLUEHOST_PLUGIN_VERSION', '3.8.4' );
define( 'BLUEHOST_PLUGIN_FILE', __FILE__ );
define( 'BLUEHOST_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'BLUEHOST_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
if ( ! defined( 'NFD_HIIVE_URL' ) ) {
define( 'NFD_HIIVE_URL', 'https://hiive.cloud/api' );
}
if ( defined( 'BURST_SAFETY_MODE' ) && BURST_SAFETY_MODE ) {
// Load alternate experience
require __DIR__ . '/inc/alt-experience/init.php';
// Short-circuit all plugin functionality
return;
}
define( 'BLUEHOST_BUILD_DIR', BLUEHOST_PLUGIN_DIR . 'build/' . BLUEHOST_PLUGIN_VERSION );
define( 'BLUEHOST_BUILD_URL', BLUEHOST_PLUGIN_URL . 'build/' . BLUEHOST_PLUGIN_VERSION );
global $pagenow;
if ( 'plugins.php' === $pagenow ) {
require BLUEHOST_PLUGIN_DIR . '/inc/plugin-php-compat-check.php';
$plugin_check = new Plugin_PHP_Compat_Check( __FILE__ );
$plugin_check->min_php_version = '7.1';
$plugin_check->min_wp_version = '6.0';
$plugin_check->check_plugin_requirements();
}
// Check NFD plugin incompatibilities
require_once BLUEHOST_PLUGIN_DIR . '/inc/plugin-nfd-compat-check.php';
$nfd_plugins_check = new NFD_Plugin_Compat_Check( BLUEHOST_PLUGIN_FILE );
// Defer to Incompatible plugin, self-deactivate
$nfd_plugins_check->incompatible_plugins = array();
// Deactivate legacy plugin
$nfd_plugins_check->legacy_plugins = array(
'The MOJO Marketplace' => 'mojo-marketplace-wp-plugin/mojo-marketplace.php',
'The MOJO Plugin' => 'wp-plugin-mojo/wp-plugin-mojo.php',
'The HostGator Plugin' => 'wp-plugin-hostgator/wp-plugin-hostgator.php',
'The Web.com Plugin' => 'wp-plugin-web/wp-plugin-web.php',
'The Crazy Domains Plugin' => 'wp-plugin-web/wp-plugin-crazy-domains.php',
);
// Check plugin requirements
$pass_nfd_check = $nfd_plugins_check->check_plugin_requirements();
// Check PHP version before initializing to prevent errors if plugin is incompatible.
if ( $pass_nfd_check && version_compare( PHP_VERSION, '7.1', '>=' ) ) {
require __DIR__ . '/bootstrap.php';
}