PluginProbe
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment / 2.1.4
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment v2.1.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
← All changes | Inc/Core/Plugin.php +87 -36 3.1.72.1.4 View file →
@@ -1,12 +1,12 @@
1 1 <?php
2 2 /**
3 3 * @package FireBox
4 - * @version 3.1.7 Free
4 + * @version 2.1.4 Free
5 5 *
6 6 * @author FirePlugins <info@fireplugins.com>
7 7 * @link https://www.fireplugins.com
8 - * @copyright Copyright © 2026 FirePlugins All Rights Reserved
8 + * @copyright Copyright © 2024 FirePlugins All Rights Reserved
9 9 * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
10 10 */
11 11
12 12 namespace FireBox\Core
@@ -16,12 +16,14 @@
16 16 exit; // Exit if accessed directly.
17 17 }
18 18
19 19 use FPFramework\Framework;
20 + use FPFramework\Admin\Includes\MetaboxManager;
20 21 use FPFramework\Base\Renderer;
21 22
22 23 use FireBox\Core\Admin\Admin;
23 24 use FireBox\Core\Admin\Includes\Library;
25 + use FireBox\Core\Admin\Includes\Metaboxes as PluginMetaboxes;
24 26 use FireBox\Core\Admin\Includes\Cpts\Cpts;
25 27 use FireBox\Core\Admin\Menu\PluginMenu;
26 28 use FireBox\Core\FB\Box;
27 29 use FireBox\Core\FB\Boxes;
@@ -72,8 +74,22 @@
72 74 */
73 75 public $renderer;
74 76
75 77 /**
78 + * Plugin Metaboxes
79 + *
80 + * @var Metaboxes
81 + */
82 + public $plugin_metaboxes;
83 +
84 + /**
85 + * Metaboxes Manager
86 + *
87 + * @var MetaboxManager
88 + */
89 + public $metaboxes_manager;
90 +
91 + /**
76 92 * Box
77 93 *
78 94 * @var Box
79 95 */
@@ -107,8 +123,15 @@
107 123 */
108 124 public $blocks;
109 125
110 126 /**
127 + * Widgets
128 + *
129 + * @var Widgets
130 + */
131 + public $widgets;
132 +
133 + /**
111 134 * Shortcodes
112 135 *
113 136 * @var Shortcodes
114 137 */
@@ -126,23 +149,16 @@
126 149 *
127 150 * @var Log
128 151 */
129 152 public $log;
130 -
131 - /**
132 - * PHP Scripts
133 - *
134 - * @var PHPScripts
135 - */
136 - public $phpscripts;
137 153 #PRO-END
138 154
139 155 /**
140 - * Translations cache
156 + * Translations
141 157 *
142 - * @var Libs\Translations
158 + * @var Translations
143 159 */
144 - private $translations_cache;
160 + public $translations;
145 161
146 162 /**
147 163 * Tables used by Hook
148 164 *
@@ -206,13 +222,11 @@
206 222 * @return void
207 223 */
208 224 public function admin_init()
209 225 {
226 +
210 227 new \FPFramework\Admin\Includes\UpgradeProModal($this->plugin_slug, $this->plugin_name);
211 -
212 228
213 - new \FireBox\Core\Admin\Includes\UpgradeToPlanModal();
214 -
215 229
216 230 // Admin
217 231 $this->admin = new Admin();
218 232
@@ -217,8 +231,13 @@
217 231 $this->admin = new Admin();
218 232
219 233 // Library
220 234 $this->library = new Library();
235 +
236 + // Metaboxes
237 + $this->metaboxes_manager = new MetaboxManager();
238 + $this->plugin_metaboxes = new PluginMetaboxes();
239 + $this->metaboxes_manager->init();
221 240 }
222 241
223 242 /**
224 243 * Runs at the start of the Plugin
@@ -226,15 +245,40 @@
226 245 * @return void
227 246 */
228 247 public function preFlight()
229 248 {
249 + // set translations
250 + $this->translations = new Libs\Translations();
251 +
230 252 // loads text domain
231 253 add_action('plugins_loaded', [$this, 'loadTextdomain'], 10);
232 254
233 -
255 + // show rate reminder after user has activated the plugin
256 + add_action('activated_plugin', [$this, 'set_rate_reminder']);
257 +
258 + // Widgets
259 + $this->widgets = new Widgets();
234 260 }
235 261
236 262 /**
263 + * Set rate reminder transient on plugin activation.
264 + *
265 + * @return void
266 + */
267 + public function set_rate_reminder()
268 + {
269 + if( get_transient( 'fpf_firebox_rate_reminder_deleted' ) || get_transient( 'fpf_firebox_rate_reminder' ) )
270 + {
271 + return;
272 + }
273 +
274 + // make rate reminder appear 2 days after the plugin has been activated.
275 + $date = new \DateTime();
276 + $date->add( new \DateInterval( 'P2D' ) );
277 + set_transient( 'fpf_firebox_rate_reminder', $date->format( 'Y-m-d' ) );
278 + }
279 +
280 + /**
237 281 * Ensures only one instance of the plugin class is loaded or can be loaded
238 282 *
239 283 * @return Plugin An instance of the class.
240 284 */
@@ -275,14 +319,15 @@
275 319
276 320 // Log
277 321 $this->log = new Log();
278 322
279 - new API\API();
323 + // REST API
324 + new RESTAPI();
280 325
281 -
282 326
283 - // Register Custom Post Type
284 - new \FireBox\Core\Admin\Includes\Cpts\Firebox();
327 + // Custom Post Types
328 + $this->cpts = new Cpts();
329 + $this->cpts->init();
285 330
286 331 // Renderer
287 332 $this->renderer = new Renderer(FBOX_LAYOUTS_DIR);
288 333
@@ -305,16 +350,8 @@
305 350 new \FireBox\Core\Analytics\Ajax();
306 351
307 352 // Track
308 353 $this->track = new Track();
309 -
310 -
311 -
312 - // Usage Tracking
313 - $usageTracking = new \FireBox\Core\UsageTracking\SendUsage();
314 - $usageTracking->maybeStart();
315 -
316 - new FB\Meta();
317 354 }
318 355
319 356 /**
320 357 * Initializes FireBox Plugin with the required components
@@ -333,8 +370,29 @@
333 370 new Frontend();
334 371 }
335 372
336 373 /**
374 + * Append our Plugin translation class to the set of translation classes of the Framework
375 + *
376 + * @param array
377 + *
378 + * @return array
379 + */
380 + public function setTranslationsPaths($paths)
381 + {
382 + if (isset($paths['firebox']))
383 + {
384 + return $paths;
385 + }
386 +
387 + $paths['firebox'] = [
388 + 'prefix' => 'FB_'
389 + ];
390 +
391 + return $paths;
392 + }
393 +
394 + /**
337 395 * Retrieves the translation of $text
338 396 *
339 397 * @param string $text
340 398 * @param string $fallback
@@ -342,16 +400,9 @@
342 400 * @return string
343 401 */
344 402 public function _($text, $fallback = null)
345 403 {
346 - // check if translations instance exists
347 - if (!isset($this->translations_cache))
348 - {
349 - // set translations
350 - $this->translations_cache = new Libs\Translations();
351 - }
352 -
353 - return $this->translations_cache->_($text, $fallback);
404 + return $this->translations->_($text, $fallback);
354 405 }
355 406 }
356 407 }
357 408