PluginProbe
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment / 2.0.2
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment v2.0.2
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 / firebox.php

firebox.php in FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment 2.0.2, at firebox.php

194 lines 4.6 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.0.2 Free
5 *
6 * @author FirePlugins <info@fireplugins.com>
7 * @link https://www.fireplugins.com
8 * @copyright Copyright © 2023 FirePlugins All Rights Reserved
9 * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
10 *
11 * Plugin Name: FireBox
12 * Plugin URI: https://www.fireplugins.com/firebox
13 * Description: WordPress Popup and leads generation plugin that converts visitors into subscribers & customers.
14 * Version: 2.0.2
15 * Author: FirePlugins Popup Plugin Team
16 * Author URI: https://www.fireplugins.com/
17 * Text Domain: firebox
18 * Domain Path: /languages
19 * Requires at least: 5.4
20 * Requires PHP: 5.6.40
21 * License: GNU General Public License v2.0+
22 * License URI: http://www.gnu.org/licenses/gpl-2.0.html
23 */
24
25 // If this file is called directly, abort.
26 if (!defined('ABSPATH'))
27 {
28 exit; // Exit if accessed directly.
29 }
30
31 // Load Framework
32 require_once dirname(__FILE__) . '/Inc/Framework/init.php';
33
34 // Plugin Autoloader
35 require_once dirname(__FILE__) . '/autoload.php';
36
37
38
39 // Plugin version
40 if (!defined('FBOX_VERSION'))
41 {
42 define('FBOX_VERSION', '2.0.2');
43 }
44
45 // Plugin License type (free/pro)
46 if (!defined('FBOX_LICENSE_TYPE'))
47 {
48
49 $type = 'lite';
50
51
52 define('FBOX_LICENSE_TYPE', $type);
53 }
54
55 // PHP Minimm Version
56 if (!defined('FBOX_MINIMUM_PHP_VERSION'))
57 {
58 define('FBOX_MINIMUM_PHP_VERSION', '5.6.40');
59 }
60
61
62 // Go Pro URL
63 if (!defined('FBOX_GO_PRO_URL'))
64 {
65 define('FBOX_GO_PRO_URL', 'https://www.fireplugins.com/firebox/upgrade');
66 }
67
68
69 // Plugin Documentation URL
70 if (!defined('FBOX_DOC_URL'))
71 {
72 define('FBOX_DOC_URL', 'https://www.fireplugins.com/docs/firebox/');
73 }
74
75 // Plugin Folder Path
76 if (!defined('FBOX_PLUGIN_DIR'))
77 {
78 define('FBOX_PLUGIN_DIR', plugin_dir_path(__FILE__));
79 }
80
81 // Layouts Folder Path
82 if (!defined('FBOX_LAYOUTS_DIR'))
83 {
84 define('FBOX_LAYOUTS_DIR', FBOX_PLUGIN_DIR . 'Inc/Core/Layouts/');
85 }
86
87 // Admin Layouts Folder Path
88 if (!defined('FBOX_ADMIN_LAYOUTS_DIR'))
89 {
90 define('FBOX_ADMIN_LAYOUTS_DIR', FBOX_PLUGIN_DIR . 'Inc/Core/Layouts/admin/');
91 }
92
93 // Public Layouts Folder Path
94 if (!defined('FBOX_PUBLIC_LAYOUTS_DIR'))
95 {
96 define('FBOX_PUBLIC_LAYOUTS_DIR', FBOX_PLUGIN_DIR . 'Inc/Core/Layouts/public/');
97 }
98
99 // Plugin Folder URL
100 if (!defined('FBOX_PLUGIN_URL'))
101 {
102 define('FBOX_PLUGIN_URL', plugin_dir_url(__FILE__));
103 }
104
105 // Media Plugin Folder URL
106 if (!defined('FBOX_MEDIA_URL'))
107 {
108 define('FBOX_MEDIA_URL', plugin_dir_url(__FILE__) . 'media/');
109 }
110
111 // Admin Media Plugin Folder URL
112 if (!defined('FBOX_MEDIA_ADMIN_URL'))
113 {
114 define('FBOX_MEDIA_ADMIN_URL', plugin_dir_url(__FILE__) . 'media/admin/');
115 }
116
117 // Public Media Plugin Folder URL
118 if (!defined('FBOX_MEDIA_PUBLIC_URL'))
119 {
120 define('FBOX_MEDIA_PUBLIC_URL', plugin_dir_url(__FILE__) . 'media/public/');
121 }
122
123 // Plugin Root File
124 if (!defined('FBOX_PLUGIN_BASE_FILE'))
125 {
126 define('FBOX_PLUGIN_BASE_FILE', __FILE__);
127 }
128
129 // Plugin Root Folder
130 if (!defined('FBOX_BASE_FOLDER'))
131 {
132 define('FBOX_BASE_FOLDER', dirname(__FILE__));
133 }
134
135 // Minimum PHP version check
136 if (!version_compare(PHP_VERSION, FBOX_MINIMUM_PHP_VERSION, '>='))
137 {
138 add_action('admin_notices', 'firebox_fail_php_version');
139 }
140 else
141 {
142 // Migrator
143 function firebox_upgrader_migrator_start($upgrader_object, $options)
144 {
145 if ($options['action'] === 'update' && $options['type'] === 'plugin' && isset($options['plugins']))
146 {
147 foreach ($options['plugins'] as $plugin)
148 {
149 if ($plugin !== plugin_basename(__FILE__))
150 {
151 continue;
152 }
153
154 $migrator = new \FireBox\Core\Migrator(get_option('firebox_version', '1.0.0'));
155 $migrator->run();
156 }
157 }
158 }
159 add_action('upgrader_process_complete', 'firebox_upgrader_migrator_start', 10, 2);
160
161 function firebox_init_migrator_start()
162 {
163 add_action('fpf_init', function() {
164 $migrator = new \FireBox\Core\Migrator(get_option('firebox_version', '1.0.0'));
165 $migrator->run();
166 });
167 }
168 add_action('plugins_loaded', 'firebox_init_migrator_start', -1);
169
170 // Start Plugin
171 require_once dirname(__FILE__) . '/Inc/Core/Plugin.php';
172 firebox();
173
174 if (is_admin())
175 {
176 // Run Activation/Deactivation procedures
177 $maintenance = new \FireBox\Core\Admin\Maintenance(firebox()->hook_data);
178 $maintenance->init();
179 }
180 }
181
182 /**
183 * FireBox admin notice for minimum PHP version.
184 *
185 * Warning when the site doesn't have the minimum required PHP version.
186 *
187 * @return void
188 */
189 function firebox_fail_php_version()
190 {
191 $message = sprintf(fpframework()->_('FPF_PHP_VERSION_FAIL'), 'FireBox', FBOX_MINIMUM_PHP_VERSION);
192 $html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) );
193 echo wp_kses_post( $html_message );
194 }