forked from starterblocks/starterblocks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
starterblocks.php
107 lines (90 loc) · 3.78 KB
/
starterblocks.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
<?php
/*
* Plugin Name: StarterBlocks
* Plugin URI: https://starterblocks.io/
* Description: Who wants to start with just blocks? Implement templates immediately with our design library. Shortcut your design process!
* Version: 1.0.6
* Author: Redux.io
* Author URI: https://redux.io/
* Text Domain: starterblocks
* Requires at least: 5.0
* Tested up to: 5.3
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*/
require_once __DIR__ . '/vendor/autoload.php';
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
if ( function_exists( 'starterblocks_fs' ) ) {
sta_fs()->set_basename( true, __FILE__ );
} else {
if ( ! function_exists( 'starterblocks_fs' ) ) {
// Create a helper function for easy SDK access.
function starterblocks_fs() {
global $starterblocks_fs;
if ( ! isset( $starterblocks_fs ) ) {
// Activate multisite network integration.
// if ( ! defined( 'WP_FS__PRODUCT_5632_MULTISITE' ) ) {
// define( 'WP_FS__PRODUCT_5632_MULTISITE', true );
// }
// Include Freemius SDK.
require_once dirname( __FILE__ ) . '/core/freemius/start.php';
$starterblocks_fs = fs_dynamic_init(
array(
'id' => '5632',
'slug' => 'starterblocks',
'type' => 'plugin',
'public_key' => 'pk_d1cff5ec542f0e8f2446afbcfca5f',
'is_premium' => false,
// If your plugin is a serviceware, set this option to false.
'has_premium_version' => false,
'has_addons' => false,
'has_paid_plans' => true,
'has_affiliation' => 'selected',
'menu' => array(
'slug' => 'starterblocks',
'first-path' => 'admin.php?page=starterblocks',
'account' => true,
'pricing' => true,
'contact' => true,
'support' => true,
),
)
);
}
return $starterblocks_fs;
}
// Init Freemius.
starterblocks_fs();
// Signal that SDK was initiated.
do_action( 'starterblocks_fs_loaded' );
//
// $fs_options = FS_Options::instance( WP_FS__ACCOUNTS_OPTION_NAME, true );
// $modules = fs_get_entities( $fs_options->get_option( WP_FS__MODULE_TYPE_PLUGIN . 's' ), FS_Plugin::get_class_name() );
// print_r($modules);
//// $fs_options = FS_Options::instance( WP_FS__ACCOUNTS_OPTION_NAME, true );
//// print_r($fs_options->sites);
//
// exit();
}
// Define Version
define( 'STARTERBLOCKS_VERSION', '1.0.6' );
// Define File DIR
define( 'STARTERBLOCKS_FILE', __FILE__ );
// Define Dir URL
define( 'STARTERBLOCKS_DIR_URL', plugin_dir_url( __FILE__ ) );
// Define Physical Path
define( 'STARTERBLOCKS_DIR_PATH', plugin_dir_path( __FILE__ ) );
// Version Check & Include Core
if ( ! version_compare( PHP_VERSION, '5.4', '>=' ) ) {
add_action( 'admin_notices', 'StarterBlocks\Notices\Notices::php_error_notice' ); // PHP Version Check
} elseif ( ! version_compare( get_bloginfo( 'version' ), '4.5', '>=' ) ) {
add_action(
'admin_notices', 'StarterBlocks\Notices\Notices::wordpress_error_notice'
); // WordPress Version Check
} else {
// $class = 'StarterBlocks\Init\Init';
new StarterBlocks\Init();
}
}