PluginProbe ʕ •ᴥ•ʔ
Superb Addons: Blocks, Patterns, Pre-built Pages, Sliders, Popups, Free Forms, Animations & More / 3.0.5
Superb Addons: Blocks, Patterns, Pre-built Pages, Sliders, Popups, Free Forms, Animations & More v3.0.5
4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 4.0.0 trunk 1.0.0 2.0.0 2.0.1 2.0.2 2.0.3 3.0 3.0.1 3.0.2 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.2 3.1.3 3.2.0 3.2.1 3.2.2 3.2.4 3.2.5 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.4.5 3.4.6 3.5.0 3.5.1 3.5.2 3.5.3 3.5.4 3.5.6 3.5.7 3.5.8 3.5.9 3.6.0 3.6.1 3.6.2 3.7.0 3.7.1
superb-blocks / src / class-plugin.php
superb-blocks / src Last commit date
admin 2 years ago components 2 years ago data 2 years ago elementor 2 years ago gutenberg 2 years ago library 2 years ago tours 2 years ago class-config.php 2 years ago class-plugin.php 2 years ago
class-plugin.php
196 lines
1 <?php
2
3 namespace SuperbAddons;
4
5 defined('ABSPATH') || exit();
6
7 use Exception;
8 use SuperbAddons\Elementor\Controllers\ElementorController;
9 use SuperbAddons\Admin\Controllers\DashboardController;
10 use SuperbAddons\Data\Controllers\LogController;
11 use SuperbAddons\Data\Controllers\RestController;
12 use SuperbAddons\Gutenberg\Controllers\GutenbergController;
13 use SuperbAddons\Library\Controllers\LibraryRequestController;
14 use SuperbAddons\Tours\Controllers\TourController;
15
16 class SuperbAddonsPlugin
17 {
18 private static $instance;
19
20 public static function GetInstance()
21 {
22 if (!isset(self::$instance)) {
23 self::$instance = new self();
24 }
25 return self::$instance;
26 }
27
28 public function __construct()
29 {
30 register_activation_hook(SUPERBADDONS_BASE_PATH, array($this, 'ActivationHookFunction'));
31 register_deactivation_hook(SUPERBADDONS_BASE_PATH, array($this, 'DeactivationHookFunction'));
32 new DashboardController();
33 new GutenbergController();
34 new ElementorController();
35 new LibraryRequestController();
36 new TourController();
37 LogController::AddCronAction();
38 RestController::RegisterRoutes();
39 add_filter('wp_theme_json_data_default', array($this, 'UpdateThemeJsonDefaults'));
40 }
41
42 public function UpdateThemeJsonDefaults($theme_json)
43 {
44 $defaults = array(
45 'version' => '2',
46 'settings' => array(
47 "appearanceTools" => true,
48 "spacing" => [
49 "spacingScale" => [
50 "steps" => 0
51 ],
52 "spacingSizes" => [
53 [
54 "name" => "xxSmall",
55 "size" => "clamp(5px, 1vw, 10px)",
56 "slug" => "superbspacing-xxsmall"
57 ],
58 [
59 "name" => "xSmall",
60 "size" => "clamp(10px, 2vw, 20px)",
61 "slug" => "superbspacing-xsmall"
62 ],
63 [
64 "name" => "Small",
65 "size" => "clamp(20px, 4vw, 40px)",
66 "slug" => "superbspacing-small"
67 ],
68 [
69 "name" => "Medium",
70 "size" => "clamp(30px, 6vw, 60px)",
71 "slug" => "superbspacing-medium"
72 ],
73 [
74 "name" => "Large",
75 "size" => "clamp(40px, 8vw, 80px)",
76 "slug" => "superbspacing-large"
77 ],
78 [
79 "name" => "xLarge",
80 "size" => "clamp(50px, 10vw, 100px)",
81 "slug" => "superbspacing-xlarge"
82 ],
83 [
84 "name" => "xxLarge",
85 "size" => "clamp(60px, 12vw, 120px)",
86 "slug" => "superbspacing-xxlarge"
87 ]
88 ],
89 "units" => [
90 "%",
91 "px",
92 "em",
93 "rem",
94 "vh",
95 "vw"
96 ]
97 ],
98 "typography" => [
99 "dropCap" => false,
100 "fluid" => true,
101 "fontSizes" => [
102 [
103 "name" => "Tiny",
104 "slug" => "superbfont-tiny",
105 "size" => "0.9rem",
106 "fluid" => [
107 "min" => "0.8rem",
108 "max" => "0.9rem"
109 ]
110 ],
111 [
112 "name" => "xxSmall",
113 "slug" => "superbfont-xxsmall",
114 "size" => "1rem",
115 "fluid" => [
116 "min" => "0.9rem",
117 "max" => "1rem"
118 ]
119 ],
120 [
121 "name" => "xSmall",
122 "slug" => "superbfont-xsmall",
123 "size" => "1.1rem",
124 "fluid" => [
125 "min" => "1rem",
126 "max" => "1.1rem"
127 ]
128 ],
129 [
130 "name" => "Small",
131 "slug" => "superbfont-small",
132 "size" => "1.5rem",
133 "fluid" => [
134 "min" => "1rem",
135 "max" => "1.5rem"
136 ]
137 ],
138 [
139 "name" => "Medium",
140 "slug" => "superbfont-medium",
141 "size" => "2rem",
142 "fluid" => [
143 "min" => "1.2rem",
144 "max" => "2rem"
145 ]
146 ],
147 [
148 "name" => "Large",
149 "slug" => "superbfont-large",
150 "size" => "3rem",
151 "fluid" => [
152 "min" => "1.5rem",
153 "max" => "3rem"
154 ]
155 ],
156 [
157 "name" => "xLarge",
158 "slug" => "superbfont-xlarge",
159 "size" => "4rem",
160 "fluid" => [
161 "min" => "2rem",
162 "max" => "4rem"
163 ]
164 ],
165 [
166 "name" => "xxLarge",
167 "slug" => "superbfont-xxlarge",
168 "size" => "5rem",
169 "fluid" => [
170 "min" => "2.5rem",
171 "max" => "5rem"
172 ]
173 ]
174 ]
175 ]
176 ),
177 );
178
179 return $theme_json->update_with($defaults);
180 }
181
182 public function ActivationHookFunction()
183 {
184 try {
185 add_option('superbaddons_pre_activation', time(), false);
186 } catch (Exception $e) {
187 LogController::HandleException($e);
188 }
189 }
190
191 public function DeactivationHookFunction()
192 {
193 LogController::MaybeUnsubscribeCron();
194 }
195 }
196