-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathblockera.php
More file actions
197 lines (168 loc) · 5.74 KB
/
Copy pathblockera.php
File metadata and controls
197 lines (168 loc) · 5.74 KB
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<?php
/**
* Plugin Name: Blockera Site Builder – Responsive blocks, block states, and more...
* Plugin URI: https://blockera.ai/products/site-builder/
* Description: Blockera Site Builder is transforming the block editor into a powerful page builder by adding responsive blocks, block states, and more.
* Requires at least: 6.6
* Tested up to: 7.0
* Requires PHP: 7.4
* Requires at least blockera-pro: 1.1.1
* Author: Blockera AI
* Author URI: https://blockera.ai/about/
* Version: 1.12.2
* Text Domain: blockera
* Domain Path: /languages
* License: GPLv3 or later
*
* @package Blockera
*/
// direct access is not allowed.
if (! defined('ABSPATH')) {
exit;
}
### BEGIN AUTO-GENERATED AUTOLOADER
require_once __DIR__ . '/packages/autoloader-coordinator/bootstrap.php';
blockera_bootstrap_shared_autoloader(
'blockera',
__DIR__,
[
'priority' => 10,
'default' => ! defined('BLOCKERA_SB_FILE') || BLOCKERA_SB_FILE === __FILE__,
'file' => __FILE__,
'entry_constant' => 'BLOCKERA_SB_FILE',
'companions' => [
[
'slug' => 'blockera-pro',
'plugin_file' => 'blockera-pro/blockera-pro.php',
'entry_constant' => 'BLOCKERA_PRO_FILE',
],
[
'slug' => 'blockera-one',
'type' => 'theme',
'theme_stylesheet' => 'blockera-one',
],
],
]
);
### END AUTO-GENERATED AUTOLOADER
if (file_exists(__DIR__ . '/.env')) {
// Env Loading ...
$blockera_dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
$blockera_dotenv->safeLoad();
}
if (! defined('BLOCKERA_SB_FILE')) {
define('BLOCKERA_SB_FILE', __FILE__);
}
if (! defined('BLOCKERA_SB_URI')) {
define('BLOCKERA_SB_URI', plugin_dir_url(__FILE__));
}
if (! defined('BLOCKERA_SB_PATH')) {
define('BLOCKERA_SB_PATH', plugin_dir_path(__FILE__));
}
### BEGIN AUTO-GENERATED DEFINES
if (! defined('BLOCKERA_SB_MODE')) {
define('BLOCKERA_SB_MODE', 'development');
}
if (! defined('BLOCKERA_SB_VERSION')) {
// Loads current version for development in the development environment.
// this code will be replaced by string version of plugin version pulled from header
// in production build.
if (! function_exists('get_plugin_data')) {
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
}
define('BLOCKERA_SB_VERSION', get_plugin_data(__FILE__, false, false)['Version']);
}
### END AUTO-GENERATED DEFINES
global $blockera_env_mode, $blockera_mode, $blockera_block_supports;
// Set the blockera environment mode.
$blockera_env_mode = 'development' === ( isset($_ENV['APP_MODE']) ? sanitize_text_field($_ENV['APP_MODE']) : 'production' );
// Set the blockera mode.
$blockera_mode = defined('BLOCKERA_SB_MODE') && 'development' === BLOCKERA_SB_MODE && $blockera_env_mode;
global $blockera_compat_free_with_pro;
$blockera_compat_free_with_pro = new \Blockera\PluginCompatibility\CompatibilityCheck(
[
'file' => __FILE__,
'slug' => 'blockera',
'version' => BLOCKERA_SB_VERSION,
'plugin_path' => BLOCKERA_SB_PATH,
'compatible_with_slug' => 'blockera-pro',
'transient_key' => 'blockera-compat-redirect',
'mode' => $blockera_mode ? 'development' : 'production',
],
new Blockera\Utils\Utils()
);
add_action('plugins_loaded', 'blockera_load_compatibility_check', 5);
/**
* Blockera is loading ...
*
* @return void
*/
function blockera_load_compatibility_check(): void{
global $blockera_compat_free_with_pro, $blockera_is_compatible_with_pro;
$blockera_is_compatible_with_pro = $blockera_compat_free_with_pro->load();
}
/**
* Filter the block supports.
*
* @hook 'blockera.block.supports'
* @since 1.12.2
* @param array $block_supports The block supports.
*
* @return array The filtered block supports.
*/
$blockera_block_supports = apply_filters(
'blockera.block.supports',
blockera_get_available_block_supports()
);
// Initialize hooks on Front Controller when this product owns the bootstrap.
if ( BLOCKERA_SB_FILE === __FILE__ ) {
blockera_load('bootstrap.hooks', __DIR__);
}
add_action('init', 'blockera_init', 10);
function blockera_init(): void {
blockera_load('bootstrap.init', __DIR__);
/**
* This hook for extendable setup process from internal or third-party developers.
*
* @hook 'blockera/before/setup'
* @since 1.3.0
*/
do_action('blockera/before/setup');
global $blockera_compat_free_with_pro, $blockera_is_compatible_with_pro;
if (! $blockera_is_compatible_with_pro) {
// Add compatibility check hooks.
add_action('admin_init', [ $blockera_compat_free_with_pro, 'adminInitialize' ]);
add_action('admin_menu', [ $blockera_compat_free_with_pro, 'adminMenus' ]);
}
new \Blockera\Telemetry\Jobs(
new \Blockera\WordPress\Sender(),
blockera_core_config('telemetry')
);
### BEGIN AUTO-GENERATED FRONT CONTROLLERS
/**
* For developers: Blockera debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that internal developers use of "APP_MODE" env variable with "development" value
* in their development environments.
*
* For information on other constants that can be used for debugging,
* visit the documentation.
*
* @link TODO: please insert link of docs.
*/
if (blockera_core_config('app.debug') && class_exists(\Whoops\Run::class)) {
$whoops = new \Whoops\Run();
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
$whoops->register();
}
require BLOCKERA_SB_PATH . 'packages/blockera/php/app.php';
### END AUTO-GENERATED FRONT CONTROLLERS
/**
* This hook for extendable setup process from internal or third-party developers.
*
* @hook 'blockera/after/setup'
* @since 1.3.0
*/
do_action('blockera/after/setup');
}