PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.7.9
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.7.9
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 3.10.4 All 148 releases
visualizer / vendor / codeinwp / themeisle-sdk / load.php

load.php in Visualizer – Tables & Charts Manager with Built-in AI Generator 3.7.9, at vendor/codeinwp/themeisle-sdk/load.php

74 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Loader for the ThemeIsleSDK
4 *
5 * Logic for loading always the latest SDK from the installed themes/plugins.
6 *
7 * @package ThemeIsleSDK
8 * @copyright Copyright (c) 2017, Marius Cristea
9 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
10 * @since 1.1.0
11 */
12
13 if ( ! defined( 'ABSPATH' ) ) {
14 return;
15 }
16 // Current SDK version and path.
17 $themeisle_sdk_version = '3.2.26';
18 $themeisle_sdk_path = dirname( __FILE__ );
19
20 global $themeisle_sdk_max_version;
21 global $themeisle_sdk_max_path;
22
23 // If this is the latest SDK and it comes from a theme, we should load licenser separately.
24 $themeisle_sdk_relative_licenser_path = '/src/Modules/Licenser.php';
25
26 global $themeisle_sdk_abs_licenser_path;
27 if ( ! is_file( $themeisle_sdk_path . $themeisle_sdk_relative_licenser_path ) && ! empty( $themeisle_sdk_max_path ) && is_file( $themeisle_sdk_max_path . $themeisle_sdk_relative_licenser_path ) ) {
28 $themeisle_sdk_abs_licenser_path = $themeisle_sdk_max_path . $themeisle_sdk_relative_licenser_path;
29 add_filter( 'themeisle_sdk_required_files', 'themeisle_sdk_load_licenser_if_present' );
30 }
31
32 if ( ( is_null( $themeisle_sdk_max_path ) || version_compare( $themeisle_sdk_version, $themeisle_sdk_max_path ) == 0 ) &&
33 apply_filters( 'themeisle_sdk_should_overwrite_path', false, $themeisle_sdk_path, $themeisle_sdk_max_path ) ) {
34 $themeisle_sdk_max_path = $themeisle_sdk_path;
35 }
36
37 if ( is_null( $themeisle_sdk_max_version ) || version_compare( $themeisle_sdk_version, $themeisle_sdk_max_version ) > 0 ) {
38 $themeisle_sdk_max_version = $themeisle_sdk_version;
39 $themeisle_sdk_max_path = $themeisle_sdk_path;
40 }
41
42 // load the latest sdk version from the active Themeisle products.
43 if ( ! function_exists( 'themeisle_sdk_load_licenser_if_present' ) ) :
44 /**
45 * Always load the licenser, if present.
46 *
47 * @param array $to_load Previously files to load.
48 */
49 function themeisle_sdk_load_licenser_if_present( $to_load ) {
50 global $themeisle_sdk_abs_licenser_path;
51 $to_load[] = $themeisle_sdk_abs_licenser_path;
52
53 return $to_load;
54 }
55 endif;
56
57 // load the latest sdk version from the active Themeisle products.
58 if ( ! function_exists( 'themeisle_sdk_load_latest' ) ) :
59 /**
60 * Always load the latest sdk version.
61 */
62 function themeisle_sdk_load_latest() {
63 /**
64 * Don't load the library if we are on < 5.4.
65 */
66 if ( version_compare( PHP_VERSION, '5.4.32', '<' ) ) {
67 return;
68 }
69 global $themeisle_sdk_max_path;
70 require_once $themeisle_sdk_max_path . '/start.php';
71 }
72 endif;
73 add_action( 'init', 'themeisle_sdk_load_latest' );
74