PluginProbe
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment / 2.1.39
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment v2.1.39
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.1.39, at Inc/Core/Admin/Forms/Settings.php

402 lines 9.4 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.1.39 Free
5 *
6 * @author FirePlugins <info@fireplugins.com>
7 * @link https://www.fireplugins.com
8 * @copyright Copyright © 2025 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 'tabs_menu_sticky' => true,
31 'mobile_menu' => true,
32 'data' => [
33 'general' => self::getGeneralSettings(),
34 'advanced' => self::getAdvancedSettings(),
35 'geolocation' => self::getGeolocationSettings(),
36 'captcha' => self::getCaptchaSettings(),
37 'data' => self::getDataSettings(),
38 'license_key' => self::getLicenseKeySettings(),
39 ]
40 ];
41
42 return apply_filters('firebox/forms/settings/edit', $settings);
43 }
44
45 /**
46 * Holds the General Settings
47 *
48 * @retun array
49 */
50 private static function getGeneralSettings()
51 {
52 return [
53 'title' => 'FPF_GENERAL',
54 'content' => [
55 // Media
56 'media' => [
57 'title' => [
58 'title' => 'FPF_MEDIA',
59 'description' => firebox()->_('FB_SETTINGS_MEDIA_DESC')
60 ],
61 'fields' => [
62 [
63 'name' => 'loadCSS',
64 'type' => 'FPToggle',
65 'label' => firebox()->_('FB_SETTINGS_LOAD_CSS'),
66 'description' => firebox()->_('FB_SETTINGS_LOAD_CSS_DESC'),
67 'checked' => true
68 ],
69 [
70 'name' => 'loadVelocity',
71 'type' => 'FPToggle',
72 'label' => firebox()->_('FB_SETTINGS_LOAD_VELOCITY'),
73 'description' => firebox()->_('FB_SETTINGS_LOAD_VELOCITY_DESC'),
74 'checked' => true
75 ]
76 ]
77 ],
78 // Other
79 'other' => [
80 'title' => [
81 'title' => 'FPF_OTHER',
82 'description' => firebox()->_('FB_SETTINGS_OTHER_DESC')
83 ],
84 'fields' => [
85 [
86 'name' => 'show_admin_bar_menu_item',
87 'type' => 'FPToggle',
88 'label' => firebox()->_('FB_SETTINGS_SHOW_ADMIN_BAR_MENU_ITEM'),
89 'description' => firebox()->_('FB_SETTINGS_SHOW_ADMIN_BAR_MENU_ITEM_DESC'),
90 'checked' => true
91 ],
92 [
93 'name' => 'showcopyright',
94 'type' => 'FPToggle',
95 'label' => firebox()->_('FB_SETTINGS_SHOW_COPYRIGHT'),
96 'description' => firebox()->_('FB_SETTINGS_SHOW_COPYRIGHT_DESC'),
97 'checked' => true
98 ],
99 [
100 'name' => 'debug',
101 'type' => 'FPToggle',
102 'label' => firebox()->_('FB_SETTINGS_DEBUG'),
103 'description' => firebox()->_('FB_SETTINGS_DEBUG_DESC'),
104 ]
105 ]
106 ]
107 ]
108 ];
109 }
110
111 /**
112 * Holds the Advanced settings
113 *
114 * @return array
115 */
116 private static function getAdvancedSettings()
117 {
118 return [
119 'title' => 'FPF_ADVANCED',
120 'content' => [
121 // Analytics
122 'analytics' => [
123 'title' => [
124 'title' => firebox()->_('FB_SETTINGS_ANALYTICS'),
125 'description' => firebox()->_('FB_SETTINGS_ANALYTICS_DESC')
126 ],
127 'fields' => [
128 [
129 'name' => 'statsdays',
130 'type' => 'Dropdown',
131 'label' => firebox()->_('FB_SETTINGS_STATS_PERIOD'),
132 'description' => firebox()->_('FB_SETTINGS_STATS_PERIOD_DESC'),
133 'showon' => '[stats]:1',
134 'default' => 730,
135 'choices' => [
136 365 => fpframework()->_('FPF_1_YEAR'),
137 365 * 2 => fpframework()->_('FPF_2_YEARS'),
138 365 * 5 => fpframework()->_('FPF_5_YEARS'),
139 365 * 99 => fpframework()->_('FPF_KEEP_FOREVER'),
140 ]
141 ]
142 ]
143 ],
144 // PHP Scripts
145 'phpscripts' => [
146 'title' => [
147 'title' => firebox()->_('FB_PHPSCRIPTS'),
148 'description' => firebox()->_('FB_PHPSCRIPTS_SETTINGS_DESC')
149 ],
150 'fields' => [
151
152
153 [
154 'type' => 'Pro',
155 'plugin' => 'FireBox',
156 'feature_label' => firebox()->_('FB_PHPSCRIPTS'),
157 ]
158
159 ]
160 ],
161 // Google Analytics
162 'google_analytics' => [
163 'title' => [
164 'title' => firebox()->_('FB_SETTINGS_GAT'),
165 'description' => firebox()->_('FB_SETTINGS_GAT_DESC')
166 ],
167 'fields' => [
168
169
170 [
171 'type' => 'Pro',
172 'plugin' => 'FireBox',
173 'feature_label' => firebox()->_('FB_SETTINGS_GAT')
174 ]
175
176 ]
177 ],
178 // API Key
179 'api' => [
180 'title' => [
181 'title' => firebox()->_('FB_JSON_API'),
182 'description' => firebox()->_('FB_JSON_API_DESC')
183 ],
184 'fields' => [
185
186
187 [
188 'type' => 'Pro',
189 'plugin' => 'FireBox',
190 'feature_label' => firebox()->_('FB_JSON_API')
191 ]
192
193 ]
194 ]
195 ]
196 ];
197 }
198
199 /**
200 * Holds the Geolocation settings
201 *
202 * @return array
203 */
204 private static function getGeolocationSettings()
205 {
206 return [
207 'title' => 'FPF_GEOLOCATION',
208 'content' => [
209 // Database
210 'database' => [
211 'title' => [
212 'title' => 'FPF_GEOLOCATION_SERVICES',
213 'description' => 'FPF_GEOIP_GEOLOCATION_SERVICES_HEADING_DESC'
214 ],
215 'fields' => [
216
217
218 [
219 'type' => 'Pro',
220 'plugin' => 'FireBox',
221 'feature_label' => 'FPF_GEOLOCATION_SERVICES'
222 ]
223
224 ]
225 ],
226 // Lookup IP Address
227 'geo_lookup' => [
228 'title' => [
229 'title' => 'FPF_GEOIP_LOOKUP',
230 'description' => 'FPF_GEOIP_LOOKUP_DESC'
231 ],
232 'fields' => [
233
234
235 [
236 'type' => 'Pro',
237 'plugin' => 'FireBox',
238 'feature_label' => 'FPF_GEOIP_LOOKUP'
239 ]
240
241 ]
242 ]
243 ]
244 ];
245 }
246
247 /**
248 * Holds the Captcha settings
249 *
250 * @return array
251 */
252 private static function getCaptchaSettings()
253 {
254 $turnstile_url = 'https://www.fireplugins.com/docs/security/cloudflare-turnstile-captcha/';
255 $turnstile_url = \FPFramework\Base\Functions::getUTMURL($turnstile_url, '', 'notice', 'cloudflare-turnstile-captcha');
256
257 $hcaptcha_url = 'https://www.fireplugins.com/docs/security/hcaptcha/';
258 $hcaptcha_url = \FPFramework\Base\Functions::getUTMURL($hcaptcha_url, '', 'notice', 'hcaptcha');
259
260 return [
261 'title' => 'FPF_CAPTCHA',
262 'content' => [
263 // Cloudflare Turnstile
264 'turnstile' => [
265 'title' => [
266 'title' => 'FPF_CLOUDFLARE_TURNSTILE',
267 'description' => sprintf(firebox()->_('FB_CLOUDFLARE_TURNSTILE_DESC'), $turnstile_url)
268 ],
269 'fields' => [
270 [
271 'name' => 'cloudflare_turnstile_site_key',
272 'type' => 'Text',
273 'label' => firebox()->_('FB_SITE_KEY'),
274 'description' => firebox()->_('FB_CLOUDFLARE_TURNSTILE_SITE_KEY_DESC'),
275 'input_class' => ['xlarge'],
276 ],
277 [
278 'name' => 'cloudflare_turnstile_secret_key',
279 'type' => 'Text',
280 'label' => firebox()->_('FB_SECRET_KEY'),
281 'description' => firebox()->_('FB_CLOUDFLARE_TURNSTILE_SECRET_KEY_DESC'),
282 'input_class' => ['xlarge'],
283 ],
284 ]
285 ],
286 // hCaptcha
287 'hcaptcha' => [
288 'title' => [
289 'title' => 'FPF_HCAPTCHA',
290 'description' => sprintf(firebox()->_('FB_HCAPTCHA_DESC'), $hcaptcha_url)
291 ],
292 'fields' => [
293 [
294 'name' => 'hcaptcha_site_key',
295 'type' => 'Text',
296 'label' => firebox()->_('FB_SITE_KEY'),
297 'description' => firebox()->_('FB_HCAPTCHA_SITE_KEY_DESC'),
298 'input_class' => ['xlarge'],
299 ],
300 [
301 'name' => 'hcaptcha_secret_key',
302 'type' => 'Text',
303 'label' => firebox()->_('FB_SECRET_KEY'),
304 'description' => firebox()->_('FB_HCAPTCHA_SECRET_KEY_DESC'),
305 'input_class' => ['xlarge'],
306 ],
307 ]
308 ]
309 ]
310 ];
311 }
312
313 /**
314 * Holds the Data settings
315 *
316 * @return array
317 */
318 private static function getDataSettings()
319 {
320 $url = 'https://www.fireplugins.com/docs/troubleshoot/usage-tracking/';
321 $url = \FPFramework\Base\Functions::getUTMURL($url, '', 'notice', 'usage-tracking');
322
323 return [
324 'title' => 'FPF_DATA',
325 'content' => [
326 // Uninstall
327 'keep_data_on_uninstall' => [
328 'title' => [
329 'title' => 'FPF_UNINSTALL',
330 'description' => 'FPF_SETTINGS_UNINSTALL_DESC'
331 ],
332 'fields' => [
333 [
334 'name' => 'keep_data_on_uninstall',
335 'type' => 'FPToggle',
336 'label' => 'FPF_KEEP_DATA_ON_UNINSTALL',
337 'description' => 'FPF_KEEP_DATA_ON_UNINSTALL_DESC',
338 'checked' => true
339 ],
340 ]
341 ],
342 'usage_tracking' => [
343 'title' => [
344 'title' => firebox()->_('FB_USAGE_TRACKING'),
345 'description' => firebox()->_('FB_USAGE_TRACKING_DESC')
346 ],
347 'fields' => [
348 [
349 'name' => 'usage_tracking',
350 'type' => 'FPToggle',
351 'label' => firebox()->_('FB_ALLOW_USAGE_TRACKING'),
352 'description' => sprintf(firebox()->_('FB_ALLOW_USAGE_TRACKING_DESC'), $url)
353 ]
354 ]
355 ]
356 ]
357 ];
358 }
359
360 /**
361 * Holds the License Key settings
362 *
363 * @return array
364 */
365 private static function getLicenseKeySettings()
366 {
367 $plugin_name = firebox()->_(firebox()->_('FB_PLUGIN_NAME'));
368
369 $status = '';
370 $status_prefix = 'You\'re using ' . $plugin_name . ' ' . ucfirst(FBOX_LICENSE_TYPE) . ' - ';
371 $enjoy = fpframework()->_('FPF_ENJOY') . '! 🙂';
372
373
374 $status = $status_prefix . fpframework()->_('FPF_NO_LICENSE_NEEDED') . ' ' . $enjoy;
375
376
377
378
379 return [
380 'title' => 'FPF_LICENSE_KEY',
381 'content' => [
382 // License
383 'license_key' => [
384 'title' => [
385 'title' => 'FPF_LICENSE',
386 'description' => 'FPF_SETTINGS_LICENSE_DESC'
387 ],
388 'fields' => [
389
390
391 [
392 'type' => 'Pro',
393 'plugin' => 'FireBox',
394 'feature_label' => 'FPF_ACTIVATE_LICENSE'
395 ]
396
397 ]
398 ]
399 ]
400 ];
401 }
402 }