PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.2.2
ShopBuilder – WooCommerce Builder For Elementor v2.2.2
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
← All changes | app/Modules/ModuleManager.php +4 -15 2.1.22.2.2 View file →
@@ -1,7 +1,8 @@
1 1 <?php
2 2
3 3 namespace RadiusTheme\SB\Modules;
4 +
4 5 defined( 'ABSPATH' ) || exit();
5 6
6 7 use RadiusTheme\SB\Models\ModuleList;
7 8
@@ -12,9 +13,9 @@
12 13 use SingletonTrait;
13 14
14 15 private $module_list;
15 16
16 - private $module_instances = array();
17 + private $module_instances = [];
17 18 private function __construct() {
18 19 add_action( 'init', [ $this, 'load_modules' ], 15 );
19 20 }
20 21
@@ -43,21 +44,9 @@
43 44 if ( ! class_exists( $module['base_class'] ) ) {
44 45 continue;
45 46 }
46 47
47 - // Check if the instance is already in the cache
48 - $cached_instance = wp_cache_get( $module['base_class'], 'module_instances' );
49 - if ( false === $cached_instance ) {
50 - // Create an instance and store it in the cache
51 - $this->module_instances[ $module['base_class'] ] = $module['base_class']::instance();
52 - wp_cache_set( $module['base_class'], $this->module_instances[ $module['base_class'] ], 'module_instances' );
53 - } else {
54 - // Use the cached instance
55 - $this->module_instances[ $module['base_class'] ] = $cached_instance;
56 - }
48 + $module['base_class']::instance();
57 49
58 50 }
59 -
60 51 }
61 -
62 -
63 -}
52 +}