PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / trunk
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder vtrunk
2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.2.0 1.2.1 All 78 releases
ablocks / vendor / storeengine / wordpress-sdk / init.php

init.php in aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder trunk, at vendor/storeengine/wordpress-sdk/init.php

75 lines 3.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * StoreEngine License Management Client SDK.
4 *
5 * Copyright (c) 2025, KodeZen. (https://kodezen.com/contact-us/)
6 * Portions copyright (c) 2019 Automattic, Inc. (https://automattic.com/contact/)
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 *
21 * @package StoreEngine\LicenseManagementClientSDK
22 */
23
24 declare( strict_types=1 );
25
26 // IMPORTANT — loading order with multiple bundled copies:
27 // The "newest version wins" election below only counts copies whose init.php
28 // actually runs. Composer's autoload_files de-dupes this file by a
29 // package-stable hash, so when several active plugins each bundle this SDK only
30 // the first plugin's vendor/autoload.php includes it — the rest are skipped and
31 // never register their version. To be immune to load order, require this file
32 // DIRECTLY (require_once '.../vendor/storeengine/wordpress-sdk/init.php') rather
33 // than relying solely on Composer autoload. See README "loading order".
34
35 if ( ! function_exists( 'se_license_manager_register_1_dot_5_dot_7' ) && function_exists( 'add_action' ) ) { // WRCS: DEFINED_VERSION.
36
37 if ( ! class_exists( 'SE_License_SDK_Version_Manager', false ) ) {
38 require_once __DIR__ . '/classes/SE_License_SDK_Version_Manager.php';
39 add_action( 'plugins_loaded', [ 'SE_License_SDK_Version_Manager', 'initialize_latest_version' ], 1, 0 );
40 }
41
42 add_action( 'plugins_loaded', 'se_license_manager_register_1_dot_5_dot_7', 0, 0 ); // WRCS: DEFINED_VERSION.
43
44 // phpcs:disable Generic.Functions.OpeningFunctionBraceKernighanRitchie.ContentAfterBrace
45 /**
46 * Registers this version of SE_License_SDK.
47 */
48 function se_license_manager_register_1_dot_5_dot_7() { // WRCS: DEFINED_VERSION.
49 $versions = SE_License_SDK_Version_Manager::instance();
50 $versions->register( '1.5.7', 'se_license_manager_initialize_1_dot_5_dot_7' ); // WRCS: DEFINED_VERSION.
51 }
52
53 // phpcs:disable Generic.Functions.OpeningFunctionBraceKernighanRitchie.ContentAfterBrace
54 /**
55 * Initializes this version of Action Scheduler.
56 */
57 function se_license_manager_initialize_1_dot_5_dot_7() { // WRCS: DEFINED_VERSION.
58 // A final safety check is required even here, because historic versions of Action Scheduler
59 // followed a different pattern. (In some unusual cases, we could reach this point and the
60 // SE_License_SDK class is already defined—so we need to guard against that.)
61 if ( ! class_exists( 'SE_License_SDK', false ) ) {
62 require_once __DIR__ . '/classes/abstracts/SE_License_SDK.php';
63 SE_License_SDK::init( __FILE__, '1.5.7' );
64 }
65 }
66
67 // Support usage in themes - load this version if no plugin has loaded a version yet.
68 if ( did_action( 'plugins_loaded' ) && ! doing_action( 'plugins_loaded' ) && ! class_exists( 'SE_License_SDK', false ) ) {
69 se_license_manager_initialize_1_dot_5_dot_7(); // WRCS: DEFINED_VERSION.
70 do_action( 'action_scheduler_pre_theme_init' );
71 SE_License_SDK_Version_Manager::initialize_latest_version();
72 }
73 }
74
75 // End of file init.php.