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

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