-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathplugin-wordpress.php
136 lines (122 loc) · 3.64 KB
/
plugin-wordpress.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?php
/**
* Plugin Name: Visual Composer
* Plugin URI: https://visualcomposer.com/premium/?utm_source=vcwb&utm_medium=wpplugins&utm_campaign=vcbrand&utm_content=text
* Description: Create your WordPress website with the fast and easy-to-use drag-and-drop builder for experts and beginners.
* Version: dev
* Author: visualcomposer.com
* Author URI: https://visualcomposer.com/?utm_source=vcwb&utm_medium=wpplugins&utm_campaign=vcbrand&utm_content=text
* Copyright: (c) 2017 TechMill Ltd.
* License: GPLv3
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
* Requires at least: 5.5
* Text Domain: visualcomposer
* Domain Path: /languages/
*/
/**
* Check for direct call file.
*/
if (!defined('ABSPATH')) {
header('Status: 403 Forbidden');
header('HTTP/1.1 403 Forbidden');
exit;
}
/**
* Skip loading when installing.
*
* @see wp_installing
*/
if (defined('WP_INSTALLING') && WP_INSTALLING) {
return;
}
/**
* Check for plugin conflict.
*/
if (defined('VCV_VERSION')) {
wp_die(
'It seems that another version of Visual Composer Website Builder is active. Please deactivate it before use this version.'
);
}
/**
* Plugin version constant
*/
define('VCV_VERSION', 'dev');
/**
* Plugin url: 'http://web/wp-content/plugins/plugin_dir/'
*/
define('VCV_PLUGIN_URL', rtrim(plugin_dir_url(__FILE__), '/') . '/');
/**
* Plugin directory full path: 'server/web/wp-content/plugins/plugin_dir/'
* @internal - please try to use vcapp()->path() instead
*/
define('VCV_PLUGIN_DIR_PATH', rtrim(plugin_dir_path(__FILE__), '/') . '/');
/**
* Plugin "basename" - directoryName/PluginFileName.php: 'vc-five/plugin-wordpress.php'
*/
define('VCV_PLUGIN_BASE_NAME', plugin_basename(__FILE__));
/**
* Plugin core file full path: '/server/web/wp-content/plugins/vc-five/plugin-wordpress.php'
*/
define('VCV_PLUGIN_FULL_PATH', __FILE__);
/**
* Plugin directory name: 'visualcomposer'
*/
define('VCV_PLUGIN_DIRNAME', basename(dirname(VCV_PLUGIN_BASE_NAME)));
define('VCV_PLUGIN_ASSETS_DIRNAME', 'visualcomposer-assets');
/**
* Plugin core prefix for options/meta and etc.
*/
define('VCV_PREFIX', 'vcv-');
// Used in requirements.php
/**
* Minimal required PHP version.
*/
define('VCV_REQUIRED_PHP_VERSION', '5.6');
/**
* Minimal required WordPress version.
*/
define('VCV_REQUIRED_BLOG_VERSION', '5.5');
if (!defined('VCV_AJAX_REQUEST')) {
define('VCV_AJAX_REQUEST', 'vcv-ajax');
}
if (!defined('VCV_ADMIN_AJAX_REQUEST')) {
define('VCV_ADMIN_AJAX_REQUEST', 'vcv-admin-ajax');
}
if (!defined('VCV_LAZY_LOAD')) {
define('VCV_LAZY_LOAD', false);
}
/**
* Check PHP version.
* Check WordPress version.
* PHP 5.1 parse-able (no parse error).
*/
$dir = dirname(__FILE__);
require_once $dir . '/visualcomposer/Env.php';
if (file_exists($dir . '/env-dev.php')) {
require_once $dir . '/env-dev.php';
} else {
require_once $dir . '/env.php';
}
$uploadDir = wp_upload_dir();
define('VCV_PLUGIN_ASSETS_DIR_PATH', $uploadDir['basedir'] . '/' . VCV_PLUGIN_ASSETS_DIRNAME);
require_once $dir . '/visualcomposer/Requirements.php';
$errorMessages = false;
if (!defined('DOING_AJAX') || !DOING_AJAX) {
$requirements = new VcvCoreRequirements();
$errorMessages = $requirements->getCoreRequirementsErrorMessages();
}
// !! PHP 5.4 Required under this line (parse error otherwise).
if ($errorMessages) {
add_action('admin_notices', function () use ($errorMessages) {
echo wp_kses($errorMessages, [
'div' => ['class' => []],
'ul' => ['class' => []],
'li' => [],
'p' => [],
'b' => [],
]);
});
} else {
// Bootstrap the system.
require $dir . '/bootstrap/autoload.php';
}