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

294 lines 6.3 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 1.0.4 Free
5 *
6 * @author FirePlugins <info@fireplugins.com>
7 * @link https://www.fireplugins.com
8 * @copyright Copyright © 2021 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' => 'FB_SETTINGS_MEDIA_DESC'
61 ],
62 'fields' => [
63 [
64 'name' => 'loadCSS',
65 'type' => 'FPToggle',
66 'label' => 'FB_SETTINGS_LOAD_CSS',
67 'description' => 'FB_SETTINGS_LOAD_CSS_DESC',
68 'checked' => true
69 ],
70 [
71 'name' => 'loadVelocity',
72 'type' => 'FPToggle',
73 'label' => 'FB_SETTINGS_LOAD_VELOCITY',
74 'description' => 'FB_SETTINGS_LOAD_VELOCITY_DESC',
75 'checked' => true
76 ]
77 ]
78 ],
79 // Other
80 'other' => [
81 'title' => [
82 'title' => 'FPF_OTHER',
83 'description' => 'FB_SETTINGS_OTHER_DESC'
84 ],
85 'fields' => [
86 [
87 'name' => 'showcopyright',
88 'type' => 'FPToggle',
89 'label' => 'FB_SETTINGS_SHOW_COPYRIGHT',
90 'description' => 'FB_SETTINGS_SHOW_COPYRIGHT_DESC',
91 'checked' => true
92 ],
93 [
94 'name' => 'debug',
95 'type' => 'FPToggle',
96 'label' => 'FB_SETTINGS_DEBUG',
97 'description' => 'FB_SETTINGS_DEBUG_DESC',
98 ]
99 ]
100 ]
101 ]
102 ];
103 }
104
105 /**
106 * Holds the Advanced settings
107 *
108 * @return array
109 */
110 private static function getAdvancedSettings()
111 {
112 return [
113 'title' => 'FPF_ADVANCED',
114 'content' => [
115 // Analytics
116 'analytics' => [
117 'title' => [
118 'title' => 'FB_SETTINGS_ANALYTICS',
119 'description' => 'FB_SETTINGS_ANALYTICS_DESC'
120 ],
121 'fields' => [
122 [
123 'name' => 'stats',
124 'type' => 'FPToggle',
125 'checked' => true
126 ],
127 [
128 'name' => 'statsdays',
129 'type' => 'Dropdown',
130 'label' => 'FB_SETTINGS_STATS_PERIOD',
131 'description' => 'FB_SETTINGS_STATS_PERIOD_DESC',
132 'showon' => 'firebox_settings[stats]:1',
133 'input_class' => ['small'],
134 'default' => 180,
135 'choices' => [
136 180 => fpframework()->_('FPF_6_MONTHS'),
137 365 => fpframework()->_('FPF_1_YEAR'),
138 365 * 2 => fpframework()->_('FPF_2_YEARS'),
139 365 * 3 => fpframework()->_('FPF_3_YEARS'),
140 'custom' => fpframework()->_('FPF_CUSTOM'),
141 ]
142 ],
143 [
144 'name' => 'statsdays_custom',
145 'type' => 'Number',
146 'label' => 'FB_SETTINGS_STATS_DAYS_CUSTOM',
147 'description' => 'FB_SETTINGS_STATS_DAYS_CUSTOM_DESC',
148 'placeholder' => 1,
149 'min' => 1,
150 'step' => 1,
151 'addon' => 'days',
152 'input_class' => ['small'],
153 'showon' => 'firebox_settings[stats]:1[AND]firebox_settings[statsdays]:custom',
154 ]
155 ]
156 ],
157 // Google Analytics
158 'google_analytics' => [
159 'title' => [
160 'title' => 'FB_SETTINGS_GAT',
161 'description' => 'FB_SETTINGS_GAT_DESC'
162 ],
163 'fields' => [
164
165
166 [
167 'type' => 'Pro',
168 'feature_label' => 'FB_SETTINGS_GAT'
169 ]
170
171 ]
172 ]
173 ]
174 ];
175 }
176
177 /**
178 * Holds the Geolocation settings
179 *
180 * @return array
181 */
182 private static function getGeolocationSettings()
183 {
184 return [
185 'title' => 'FPF_GEOLOCATION',
186 'content' => [
187 // Database
188 'database' => [
189 'title' => [
190 'title' => 'FPF_GEOLOCATION_SERVICES',
191 'description' => 'FPF_GEOIP_GEOLOCATION_SERVICES_HEADING_DESC'
192 ],
193 'fields' => [
194
195
196 [
197 'type' => 'Pro',
198 'feature_label' => 'FPF_GEOLOCATION_SERVICES'
199 ]
200
201 ]
202 ],
203 // Lookup IP Address
204 'geo_lookup' => [
205 'title' => [
206 'title' => 'FPF_GEOIP_LOOKUP',
207 'description' => 'FPF_GEOIP_LOOKUP_DESC'
208 ],
209 'fields' => [
210
211
212 [
213 'type' => 'Pro',
214 'feature_label' => 'FPF_GEOIP_LOOKUP'
215 ]
216
217 ]
218 ]
219 ]
220 ];
221 }
222
223 /**
224 * Holds the Data settings
225 *
226 * @return array
227 */
228 private static function getDataSettings()
229 {
230 return [
231 'title' => 'FPF_DATA',
232 'content' => [
233 // Uninstall
234 'keep_data_on_uninstall' => [
235 'title' => [
236 'title' => 'FPF_UNINSTALL',
237 'description' => 'FPF_SETTINGS_UNINSTALL_DESC'
238 ],
239 'fields' => [
240 [
241 'name' => 'keep_data_on_uninstall',
242 'type' => 'FPToggle',
243 'label' => 'FPF_KEEP_DATA_ON_UNINSTALL',
244 'description' => 'FPF_KEEP_DATA_ON_UNINSTALL_DESC',
245 'checked' => true
246 ],
247 ]
248 ]
249 ]
250 ];
251 }
252
253 /**
254 * Holds the License Key settings
255 *
256 * @return array
257 */
258 private static function getLicenseKeySettings()
259 {
260 $plugin_name = firebox()->_('FB_PLUGIN_NAME');
261
262 $status = '';
263 $status_prefix = 'You\'re using ' . $plugin_name . ' ' . ucfirst(FBOX_LICENSE_TYPE) . ' - ';
264 $enjoy = fpframework()->_('FPF_ENJOY') . '! <img role="img" class="emoji" alt="🙂" src="https://s.w.org/images/core/emoji/13.0.0/svg/1f642.svg" />';
265
266
267 $status = $status_prefix . fpframework()->_('FPF_NO_LICENSE_NEEDED') . ' ' . $enjoy;
268
269
270
271
272 return [
273 'title' => 'FPF_LICENSE_KEY',
274 'content' => [
275 // License
276 'license_key' => [
277 'title' => [
278 'title' => 'FPF_LICENSE',
279 'description' => 'FPF_SETTINGS_LICENSE_DESC'
280 ],
281 'fields' => [
282
283
284 [
285 'type' => 'Pro',
286 'feature_label' => 'FPF_ACTIVATE_LICENSE'
287 ]
288
289 ]
290 ]
291 ]
292 ];
293 }
294 }