PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.5
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.5
1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 All 49 releases
← All changes | app/App.php +9 -4 1.5.1 → 1.6.5 View file →
@@ -4,9 +4,8 @@
4 4
5 5 use FluentCart\Api\StoreSettings;
6 6 use FluentCart\App\Modules\PaymentMethods\Core\GatewayManager;
7 7 use FluentCart\App\Modules\PaymentMethods\Core\PaymentGatewayInterface;
8 -use FluentCart\Framework\Support\Once;
9 8 use FluentCart\Framework\Foundation\App as AppFacade;
10 9
11 10 /**
12 11 * Class App
@@ -44,11 +43,17 @@
44 43 }
45 44
46 45 public static function storeSettings(): StoreSettings
47 46 {
48 - return Once::call(function () {
49 - return new StoreSettings();
50 - });
47 + $cached = wp_cache_get(StoreSettings::CACHE_KEY, StoreSettings::CACHE_GROUP);
48 + if ($cached instanceof StoreSettings) {
49 + return $cached;
50 + }
51 +
52 + $storeSettings = new StoreSettings();
53 + wp_cache_set(StoreSettings::CACHE_KEY, $storeSettings, StoreSettings::CACHE_GROUP);
54 +
55 + return $storeSettings;
51 56 }
52 57
53 58 /**
54 59 * Get the payment gateway manager or a specific gateway