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/Http/Controllers/ModuleSettingsController.php +73 -8 1.3.19 → 1.6.5 View file →
@@ -48,18 +48,21 @@
48 48
49 49 foreach ($data as $moduleKey => $moduleData) {
50 50 $prevStatus = Arr::get($prevSettings, $moduleKey . '.active', 'no');
51 51 $newStatus = Arr::get($moduleData, 'active', 'no');
52 - if ($newStatus === $prevStatus) {
53 - continue;
54 - }
55 52
56 53 if ($prevStatus === 'yes' && $newStatus === 'no') {
57 54 // Module deactivated
58 - do_action('fluent_cart/module/deactivated/' . $moduleKey, $moduleData, $prevSettings[$moduleKey]);
55 + do_action('fluent_cart/module/deactivated/' . $moduleKey, $moduleData, $prevSettings[$moduleKey] ?? []);
59 56 } elseif ($prevStatus === 'no' && $newStatus === 'yes') {
60 57 // Module activated
61 - do_action('fluent_cart/module/activated/' . $moduleKey, $moduleData, $prevSettings[$moduleKey]);
58 + do_action('fluent_cart/module/activated/' . $moduleKey, $moduleData, $prevSettings[$moduleKey] ?? []);
59 + } elseif ($newStatus === 'yes') {
60 + // Module is active — fire activation hook if any child settings changed
61 + $hasChanged = $this->hasModuleSettingsChanged($moduleData, $prevSettings[$moduleKey] ?? []);
62 + if ($hasChanged) {
63 + do_action('fluent_cart/module/activated/' . $moduleKey, $moduleData, $prevSettings[$moduleKey] ?? []);
64 + }
62 65 }
63 66 }
64 67
65 68 return $this->sendSuccess([
@@ -66,8 +69,28 @@
66 69 'message' => __('Settings saved successfully', 'fluent-cart')
67 70 ]);
68 71 }
69 72
73 + private function hasModuleSettingsChanged($newData, $oldData)
74 + {
75 + if (!is_array($newData) || !is_array($oldData)) {
76 + return true;
77 + }
78 +
79 + foreach ($newData as $key => $value) {
80 + if ($key === 'active') {
81 + continue;
82 + }
83 +
84 + $oldValue = Arr::get($oldData, $key);
85 + if ($oldValue !== $value) {
86 + return true;
87 + }
88 + }
89 +
90 + return false;
91 + }
92 +
70 93 public function getPluginAddons(): \WP_REST_Response
71 94 {
72 95 $addons = $this->getRegisteredPluginAddons();
73 96
@@ -77,9 +100,8 @@
77 100 if($isUpcoming){
78 101 $addon['is_installed'] = false;
79 102 $addon['is_active'] = false;
80 103 $addon['plugin_file'] = '';
81 - $addon['plugin_file'] = '';
82 104 $addon['source_link'] = '';
83 105 $addon['source_type'] = '';
84 106 continue;
85 107 }
@@ -244,10 +266,32 @@
244 266 'plugin_file' => 'fluent-cart-elementor-blocks/fluent-cart-elementor-blocks.php',
245 267 'source_type' => 'cdn',
246 268 'source_link' => 'https://addons-cdn.fluentcart.com/fluent-cart-elementor-blocks.zip',
247 269 'upcoming' => false,
248 - 'repo_link' => 'https://github.com/WPManageNinja/fluent-cart-elementor-blocks'
270 + 'repo_link' => 'https://fluentcart.com/fluentcart-addons/'
249 271 ],
272 + 'fluent-cart-bricks-blocks' => [
273 + 'title' => __('FluentCart Bricks Blocks', 'fluent-cart'),
274 + 'description' => __('Enable to get Bricks Builder elements for FluentCart. Requires the Bricks theme.', 'fluent-cart'),
275 + 'logo' => Vite::getAssetUrl('images/bricks/logo.png'),
276 + 'plugin_slug' => 'fluent-cart-bricks-blocks',
277 + 'plugin_file' => 'fluent-cart-bricks-blocks/fluent-cart-bricks-blocks.php',
278 + 'source_type' => 'cdn',
279 + 'upcoming' => false,
280 + 'repo_link' => 'https://fluentcart.com/fluentcart-addons/'
281 + ],
282 + 'fluent-cart-divi-modules' => [
283 + 'title' => __('FluentCart Divi Modules', 'fluent-cart'),
284 + 'description' => __('Native Divi 5 modules for FluentCart products, cart, and checkout. Requires Divi 5.0+ and FluentCart 1.3.4+.', 'fluent-cart'),
285 + 'logo' => Vite::getAssetUrl('images/divi/black.svg'),
286 + 'dark_logo' => Vite::getAssetUrl('images/divi/white.svg'),
287 + 'plugin_slug' => 'fluent-cart-divi-modules',
288 + 'plugin_file' => 'fluent-cart-divi-modules/fluent-cart-divi-modules.php',
289 + 'source_type' => 'cdn',
290 + 'source_link' => 'https://addons-cdn.fluentcart.com/fluent-cart-divi-modules.zip',
291 + 'upcoming' => false,
292 + 'repo_link' => 'https://fluentcart.com/fluentcart-addons/'
293 + ],
250 294 'fluent-pdf' => [
251 295 'title' => __('Fluent PDF', 'fluent-cart'),
252 296 'description' => __('Generate PDF receipts and attach them to email notifications.', 'fluent-cart'),
253 297 'logo' => Vite::getAssetUrl('images/fluent-pdf/black.svg'),
@@ -255,9 +299,30 @@
255 299 'plugin_slug' => 'fluentforms-pdf',
256 300 'plugin_file' => 'fluentforms-pdf/fluentforms-pdf.php',
257 301 'source_type' => 'wordpress',
258 302 'upcoming' => false,
259 - ]
303 + ],
304 + 'fluent-cart-migrator' => [
305 + 'title' => __('FluentCart Migrator', 'fluent-cart'),
306 + 'description' => __('Migrate your store data to FluentCart from other eCommerce platforms.', 'fluent-cart'),
307 + 'logo' => Vite::getAssetUrl('images/logo.svg'),
308 + 'plugin_slug' => 'fluent-cart-migrator',
309 + 'plugin_file' => 'fluent-cart-migrator/fluent-cart-migrator.php',
310 + 'source_type' => 'cdn',
311 + 'source_link' => 'https://addons-cdn.fluentcart.com/fluent-cart-migrator.zip',
312 + 'upcoming' => false,
313 + 'repo_link' => 'https://fluentcart.com/fluentcart-addons/?3181_search=Migrator'
314 + ],
315 + 'fluent-cart-customer-rights' => [
316 + 'title' => __('FluentCart Customer Rights', 'fluent-cart'),
317 + 'description' => __('Manage customer withdrawal, refund, return, and cancellation requests with dedicated forms, workflows, notifications, and admin tools. Includes support for the German Withdrawal Button requirement under § 356a BGB.', 'fluent-cart'),
318 + 'logo' => Vite::getAssetUrl('images/fluent-cart-resolution/logo.svg'),
319 + 'plugin_slug' => 'fluent-cart-customer-rights',
320 + 'plugin_file' => 'fluent-cart-customer-rights/fluent-cart-customer-rights.php',
321 + 'source_type' => 'cdn',
322 + 'upcoming' => false,
323 + 'repo_link' => 'https://fluentcart.com/fluentcart-addons/'
324 + ],
260 325 ];
261 326
262 327 // Allow other modules/plugins to register their addons
263 328 return apply_filters('fluent_cart/module_settings/plugin_addons', $addons);