PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.4
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.4
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 trunk 1.2.0 All 47 releases
fluent-cart / app / Events / FirstTimePluginActivation.php

FirstTimePluginActivation.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.6.4, at app/Events/FirstTimePluginActivation.php

51 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentCart\App\Events;
4
5 use FluentCart\Api\StoreSettings;
6 use FluentCart\App\Listeners\FirstTimePluginActivation as FirstTimeEvents;
7
8 class FirstTimePluginActivation extends EventDispatcher
9 {
10 protected array $listeners = [
11 //FirstTimeEvents\CreatePages::class,
12 FirstTimeEvents\ManagePayments::class,
13 FirstTimeEvents\SetupStore::class
14 ];
15 public StoreSettings $storeSettings;
16
17 public function __construct()
18 {
19 $this->storeSettings = new StoreSettings();
20 }
21
22 public function toArray(): array
23 {
24 return [
25 'settings' => $this->storeSettings->toArray()
26 ];
27 }
28
29 public function getActivityEventModel()
30 {
31 return null;
32 }
33
34 public function shouldCreateActivity(): bool
35 {
36 return false;
37 }
38
39 public static function handle()
40 {
41 if (get_option('fluent_cart_do_activation_redirect', false)) {
42 delete_option('fluent_cart_do_activation_redirect');
43 if (get_option('fluent_cart_plugin_once_activated') !== '1') {
44 update_option('fluent_cart_plugin_once_activated', true);
45 (new static())->dispatch();
46 wp_redirect(admin_url('admin.php?page=fluent-cart#/onboarding'));
47 }
48 }
49 }
50 }
51