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

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