-
Notifications
You must be signed in to change notification settings - Fork 1
/
blockify.php
70 lines (61 loc) · 2.04 KB
/
blockify.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
<?php
/**
* Plugin Name: Blockify
* Plugin URI: https://blockifywp.com/
* Description: Blockify full site editing theme toolkit.
* Author: Blockify
* Author URI: https://blockifywp.com/
* Version: 1.5.0
* License: GPLv2-or-Later
* Requires WP: 6.3
* Requires PHP: 7.4
* Tested up to: 6.5
* Text Domain: blockify
*/
declare( strict_types=1 );
namespace Blockify\Plugin;
use function add_action;
use function esc_html__;
use function file_exists;
use function get_template;
use function get_template_directory;
use function printf;
use function version_compare;
use function wp_get_theme;
use const DIRECTORY_SEPARATOR;
const DIR = __DIR__ . DIRECTORY_SEPARATOR;
const FILE = __FILE__;
( static function (): void {
$theme = get_template();
$theme_version = wp_get_theme( $theme )->get( 'Version' );
$has_framework = file_exists( get_template_directory() . '/vendor/blockify/framework' );
$min_version = '1.5.0';
if ( ( $theme === 'blockify' || $has_framework ) && version_compare( $theme_version, $min_version, '<' ) ) {
add_action(
'admin_notices',
static function () use ( $min_version ): void {
printf(
'<div class="notice notice-warning is-dismissible"><p>%s <strong>%s</strong> %s</p></div>',
esc_html__( 'Blockify Pro requires Blockify theme version', 'blockify-pro'
),
$min_version,
esc_html__( 'or higher. Please update to the latest version to enable Pro features.', 'blockify-pro' )
);
}
);
return;
}
require_once DIR . 'vendor/autoload.php';
require_once DIR . 'includes/utility.php';
require_once DIR . 'includes/blocks.php';
require_once DIR . 'includes/code.php';
require_once DIR . 'includes/fields.php';
require_once DIR . 'includes/fonts.php';
require_once DIR . 'includes/framework.php';
require_once DIR . 'includes/icons.php';
require_once DIR . 'includes/license.php';
require_once DIR . 'includes/maps.php';
require_once DIR . 'includes/patterns.php';
require_once DIR . 'includes/seo.php';
require_once DIR . 'includes/settings.php';
} )();