| 1 |
<?php |
| 2 |
/** |
| 3 |
* Loads WPBrigade SDK core classes (single runtime). |
| 4 |
* |
| 5 |
* @package wpbrigade_sdk |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; |
| 10 |
} |
| 11 |
|
| 12 |
require_once __DIR__ . '/config.php'; |
| 13 |
|
| 14 |
$incoming_sdk_version = defined( 'WPBRIGADE_SDK_VERSION' ) ? WPBRIGADE_SDK_VERSION : '3.2.0'; |
| 15 |
|
| 16 |
if ( ! defined( 'WP_WPBRIGADE_SDK_VERSION' ) ) { |
| 17 |
define( 'WP_WPBRIGADE_SDK_VERSION', $incoming_sdk_version ); |
| 18 |
} |
| 19 |
|
| 20 |
$wpb_sdk_runtime_includes = __DIR__ . '/includes'; |
| 21 |
|
| 22 |
// Always merge helpers from this bundle (function_exists guards). |
| 23 |
require_once $wpb_sdk_runtime_includes . '/wpb-sdk-essential-functions.php'; |
| 24 |
|
| 25 |
if ( ! class_exists( 'WPBRIGADE_Optin_Verification', false ) ) { |
| 26 |
require_once $wpb_sdk_runtime_includes . '/class-wpb-sdk-optin-verification.php'; |
| 27 |
} |
| 28 |
|
| 29 |
if ( ! class_exists( 'WPBRIGADE_Opt_Manager', false ) ) { |
| 30 |
require_once $wpb_sdk_runtime_includes . '/class-wpb-opt-manager.php'; |
| 31 |
} |
| 32 |
|
| 33 |
if ( class_exists( 'WPBRIGADE_Logger', false ) ) { |
| 34 |
$loaded_sdk_version = defined( 'WP_WPBRIGADE_SDK_VERSION' ) ? WP_WPBRIGADE_SDK_VERSION : '0'; |
| 35 |
if ( |
| 36 |
version_compare( $loaded_sdk_version, $incoming_sdk_version, '<' ) |
| 37 |
|| version_compare( $loaded_sdk_version, '3.2.0', '<' ) |
| 38 |
) { |
| 39 |
if ( ! isset( $GLOBALS['wpb_sdk_registry'] ) || ! is_array( $GLOBALS['wpb_sdk_registry'] ) ) { |
| 40 |
$GLOBALS['wpb_sdk_registry'] = array(); |
| 41 |
} |
| 42 |
$GLOBALS['wpb_sdk_registry']['legacy_logger_conflict'] = true; |
| 43 |
} |
| 44 |
return; |
| 45 |
} |
| 46 |
|
| 47 |
require_once $wpb_sdk_runtime_includes . '/class-wpb-sdk-logger.php'; |
| 48 |
|