PluginProbe
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment / 2.0.12
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment v2.0.12
3.1.13 3.1.12 3.1.11 3.1.10 3.1.9 3.1.8 3.1.7 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 All 122 releases
firebox / Inc / Core / Admin / Forms / Settings.php

Settings.php in FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment 2.0.12, at Inc/Core/Admin/Forms/Settings.php

322 lines 7.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package FireBox
4 * @version 2.0.12 Free
5 *
6 * @author FirePlugins <info@fireplugins.com>
7 * @link https://www.fireplugins.com
8 * @copyright Copyright © 2023 FirePlugins All Rights Reserved
9 * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
10 */
11
12 namespace FireBox\Core\Admin\Forms;
13
14 if (!defined('ABSPATH'))
15 {
16 exit; // Exit if accessed directly.
17 }
18
19 class Settings
20 {
21 /**
22 * All Settings for the FireBox Global Settings Page
23 *
24 * @return array
25 */
26 public static function getSettings()
27 {
28 $settings = [
29 'id' => 'FireBoxSettings',
30 'vertical' => true,
31 'tabs_menu_sticky' => true,
32 'mobile_menu' => true,
33 'show_tab_title' => true,
34 'data' => [
35 'general' => self::getGeneralSettings(),
36 'advanced' => self::getAdvancedSettings(),
37 'geolocation' => self::getGeolocationSettings(),
38 'data' => self::getDataSettings(),
39 'license_key' => self::getLicenseKeySettings(),
40 ]
41 ];
42
43 return apply_filters('firebox/forms/settings/edit', $settings);
44 }
45
46 /**
47 * Holds the General Settings
48 *
49 * @retun array
50 */
51 private static function getGeneralSettings()
52 {
53 return [
54 'title' => 'FPF_GENERAL',
55 'content' => [
56 // Media
57 'media' => [
58 'title' => [
59 'title' => 'FPF_MEDIA',
60 'description' => firebox()->_('FB_SETTINGS_MEDIA_DESC')
61 ],
62 'fields' => [
63 [
64 'name' => 'loadCSS',
65 'type' => 'FPToggle',
66 'label' => firebox()->_('FB_SETTINGS_LOAD_CSS'),
67 'description' => firebox()->_('FB_SETTINGS_LOAD_CSS_DESC'),
68 'checked' => true
69 ],
70 [
71 'name' => 'loadVelocity',
72 'type' => 'FPToggle',
73 'label' => firebox()->_('FB_SETTINGS_LOAD_VELOCITY'),
74 'description' => firebox()->_('FB_SETTINGS_LOAD_VELOCITY_DESC'),
75 'checked' => true
76 ]
77 ]
78 ],
79 // Other
80 'other' => [
81 'title' => [
82 'title' => 'FPF_OTHER',
83 'description' => firebox()->_('FB_SETTINGS_OTHER_DESC')
84 ],
85 'fields' => [
86 [
87 'name' => 'show_admin_bar_menu_item',
88 'type' => 'FPToggle',
89 'label' => firebox()->_('FB_SETTINGS_SHOW_ADMIN_BAR_MENU_ITEM'),
90 'description' => firebox()->_('FB_SETTINGS_SHOW_ADMIN_BAR_MENU_ITEM_DESC'),
91 'checked' => true
92 ],
93 [
94 'name' => 'showcopyright',
95 'type' => 'FPToggle',
96 'label' => firebox()->_('FB_SETTINGS_SHOW_COPYRIGHT'),
97 'description' => firebox()->_('FB_SETTINGS_SHOW_COPYRIGHT_DESC'),
98 'checked' => true
99 ],
100 [
101 'name' => 'debug',
102 'type' => 'FPToggle',
103 'label' => firebox()->_('FB_SETTINGS_DEBUG'),
104 'description' => firebox()->_('FB_SETTINGS_DEBUG_DESC'),
105 ]
106 ]
107 ]
108 ]
109 ];
110 }
111
112 /**
113 * Holds the Advanced settings
114 *
115 * @return array
116 */
117 private static function getAdvancedSettings()
118 {
119 return [
120 'title' => 'FPF_ADVANCED',
121 'content' => [
122 // Analytics
123 'analytics' => [
124 'title' => [
125 'title' => firebox()->_('FB_SETTINGS_ANALYTICS'),
126 'description' => firebox()->_('FB_SETTINGS_ANALYTICS_DESC')
127 ],
128 'fields' => [
129 [
130 'name' => 'stats',
131 'type' => 'FPToggle',
132 'checked' => true
133 ],
134 [
135 'name' => 'statsdays',
136 'type' => 'Dropdown',
137 'label' => firebox()->_('FB_SETTINGS_STATS_PERIOD'),
138 'description' => firebox()->_('FB_SETTINGS_STATS_PERIOD_DESC'),
139 'showon' => '[stats]:1',
140 'input_class' => ['small'],
141 'default' => 180,
142 'choices' => [
143 180 => fpframework()->_('FPF_6_MONTHS'),
144 365 => fpframework()->_('FPF_1_YEAR'),
145 365 * 2 => fpframework()->_('FPF_2_YEARS'),
146 365 * 3 => fpframework()->_('FPF_3_YEARS'),
147 'custom' => fpframework()->_('FPF_CUSTOM'),
148 ]
149 ],
150 [
151 'name' => 'statsdays_custom',
152 'type' => 'Number',
153 'label' => firebox()->_('FB_SETTINGS_STATS_DAYS_CUSTOM'),
154 'description' => firebox()->_('FB_SETTINGS_STATS_DAYS_CUSTOM_DESC'),
155 'placeholder' => 1,
156 'min' => 1,
157 'step' => 1,
158 'addon' => 'days',
159 'input_class' => ['small'],
160 'showon' => '[stats]:1[AND][statsdays]:custom',
161 ]
162 ]
163 ],
164 // Google Analytics
165 'google_analytics' => [
166 'title' => [
167 'title' => firebox()->_('FB_SETTINGS_GAT'),
168 'description' => firebox()->_('FB_SETTINGS_GAT_DESC')
169 ],
170 'fields' => [
171
172
173 [
174 'type' => 'Pro',
175 'plugin' => 'FireBox',
176 'feature_label' => firebox()->_('FB_SETTINGS_GAT')
177 ]
178
179 ]
180 ],
181 // API Key
182 'api' => [
183 'title' => [
184 'title' => firebox()->_('FB_JSON_API'),
185 'description' => firebox()->_('FB_JSON_API_DESC')
186 ],
187 'fields' => [
188
189
190 [
191 'type' => 'Pro',
192 'plugin' => 'FireBox',
193 'feature_label' => firebox()->_('FB_JSON_API')
194 ]
195
196 ]
197 ]
198 ]
199 ];
200 }
201
202 /**
203 * Holds the Geolocation settings
204 *
205 * @return array
206 */
207 private static function getGeolocationSettings()
208 {
209 return [
210 'title' => 'FPF_GEOLOCATION',
211 'content' => [
212 // Database
213 'database' => [
214 'title' => [
215 'title' => 'FPF_GEOLOCATION_SERVICES',
216 'description' => 'FPF_GEOIP_GEOLOCATION_SERVICES_HEADING_DESC'
217 ],
218 'fields' => [
219
220
221 [
222 'type' => 'Pro',
223 'plugin' => 'FireBox',
224 'feature_label' => 'FPF_GEOLOCATION_SERVICES'
225 ]
226
227 ]
228 ],
229 // Lookup IP Address
230 'geo_lookup' => [
231 'title' => [
232 'title' => 'FPF_GEOIP_LOOKUP',
233 'description' => 'FPF_GEOIP_LOOKUP_DESC'
234 ],
235 'fields' => [
236
237
238 [
239 'type' => 'Pro',
240 'plugin' => 'FireBox',
241 'feature_label' => 'FPF_GEOIP_LOOKUP'
242 ]
243
244 ]
245 ]
246 ]
247 ];
248 }
249
250 /**
251 * Holds the Data settings
252 *
253 * @return array
254 */
255 private static function getDataSettings()
256 {
257 return [
258 'title' => 'FPF_DATA',
259 'content' => [
260 // Uninstall
261 'keep_data_on_uninstall' => [
262 'title' => [
263 'title' => 'FPF_UNINSTALL',
264 'description' => 'FPF_SETTINGS_UNINSTALL_DESC'
265 ],
266 'fields' => [
267 [
268 'name' => 'keep_data_on_uninstall',
269 'type' => 'FPToggle',
270 'label' => 'FPF_KEEP_DATA_ON_UNINSTALL',
271 'description' => 'FPF_KEEP_DATA_ON_UNINSTALL_DESC',
272 'checked' => true
273 ],
274 ]
275 ]
276 ]
277 ];
278 }
279
280 /**
281 * Holds the License Key settings
282 *
283 * @return array
284 */
285 private static function getLicenseKeySettings()
286 {
287 $plugin_name = firebox()->_(firebox()->_('FB_PLUGIN_NAME'));
288
289 $status = '';
290 $status_prefix = 'You\'re using ' . $plugin_name . ' ' . ucfirst(FBOX_LICENSE_TYPE) . ' - ';
291 $enjoy = fpframework()->_('FPF_ENJOY') . '! <img role="img" class="emoji" alt="🙂" src="https://s.w.org/images/core/emoji/13.0.0/svg/1f642.svg" />';
292
293
294 $status = $status_prefix . fpframework()->_('FPF_NO_LICENSE_NEEDED') . ' ' . $enjoy;
295
296
297
298
299 return [
300 'title' => 'FPF_LICENSE_KEY',
301 'content' => [
302 // License
303 'license_key' => [
304 'title' => [
305 'title' => 'FPF_LICENSE',
306 'description' => 'FPF_SETTINGS_LICENSE_DESC'
307 ],
308 'fields' => [
309
310
311 [
312 'type' => 'Pro',
313 'plugin' => 'FireBox',
314 'feature_label' => 'FPF_ACTIVATE_LICENSE'
315 ]
316
317 ]
318 ]
319 ]
320 ];
321 }
322 }