-
Notifications
You must be signed in to change notification settings - Fork 3
/
wp-plugin-crazy-domains.php
78 lines (67 loc) · 2.95 KB
/
wp-plugin-crazy-domains.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
<?php
/**
* Crazy Domains WordPress Plugin
*
* @package WPPluginCrazyDomains
* @author Newfold Digital
* @copyright Copyright 2023 by Newfold Digital - All rights reserved.
* @license GPL-2.0-or-later
*
* @wordpress-plugin
* Plugin Name: The Crazy Domains Plugin
* Plugin URI: https://crazydomains.com
* Update URI: https://github.com/newfold-labs/wp-plugin-crazy-domains/
* Description: WordPress plugin that integrates a WordPress site with the Crazy Domains control panel, including performance, security, and update features.
* Version: 2.1.4
* Requires at least: 6.3
* Requires PHP: 7.3
* Tested up to: 6.6.2
* Author: Crazy Domains
* Author URI: https://crazydomains.com
* Text Domain: wp-plugin-crazy-domains
* Domain Path: /languages
* License: GPL 2.0 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
namespace CrazyDomains;
// Do not allow multiple copies of the Crazy Domains Plugin to be active
if ( defined( 'CRAZYDOMAINS_PLUGIN_VERSION' ) ) {
exit;
}
// Define constants
define( 'CRAZYDOMAINS_PLUGIN_VERSION', '2.1.4' );
define( 'CRAZYDOMAINS_PLUGIN_FILE', __FILE__ );
define( 'CRAZYDOMAINS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'CRAZYDOMAINS_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
if ( ! defined( 'NFD_HIIVE_URL' ) ) {
define( 'NFD_HIIVE_URL', 'https://hiive.cloud/api' );
}
define( 'CRAZYDOMAINS_BUILD_DIR', CRAZYDOMAINS_PLUGIN_DIR . 'build/' . CRAZYDOMAINS_PLUGIN_VERSION );
define( 'CRAZYDOMAINS_BUILD_URL', CRAZYDOMAINS_PLUGIN_URL . 'build/' . CRAZYDOMAINS_PLUGIN_VERSION );
global $pagenow;
if ( 'plugins.php' === $pagenow ) {
require CRAZYDOMAINS_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 CRAZYDOMAINS_PLUGIN_DIR . '/inc/NFD_Plugin_Compat_Check.php';
$nfd_plugins_check = new NFD_Plugin_Compat_Check( CRAZYDOMAINS_PLUGIN_FILE );
// Defer to Incompatible plugin, self-deactivate
$nfd_plugins_check->incompatible_plugins = array(
'The Bluehost Plugin' => 'bluehost-wordpress-plugin/bluehost-wordpress-plugin.php',
);
// 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',
);
$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';
}