| @@ -1,25 +1,25 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * @package FireBox |
| 4 | - * @version 3.1.13 | |
| 4 | + * @version 2.1.14 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 | - * Plugin Name: FireBox 3.1.13 Free | |
| 11 | + * Plugin Name: FireBox | |
| 12 | 12 | * Plugin URI: https://www.fireplugins.com/ |
| 13 | 13 | * Description: WordPress Popup and leads generation plugin that converts visitors into subscribers & customers. |
| 14 | - * Version: 3.1.13 | |
| 14 | + * Version: 2.1.14 | |
| 15 | 15 | * Author: FireBox Popup Plugin Team |
| 16 | 16 | * Author URI: https://www.fireplugins.com/ |
| 17 | 17 | * Text Domain: firebox |
| 18 | 18 | * Domain Path: /languages |
| 19 | - * Requires at least: 6.3 | |
| 19 | + * Requires at least: 5.4 | |
| 20 | 20 | * Requires PHP: 7.0 |
| 21 | - * License: GPLv3 or later | |
| 21 | + * License: GNU General Public License v2.0+ | |
| 22 | 22 | * License URI: http://www.gnu.org/licenses/gpl-2.0.html |
| 23 | 23 | */ |
| 24 | 24 | |
| 25 | 25 | // If this file is called directly, abort. |
| @@ -46,9 +46,9 @@ | ||
| 46 | 46 | |
| 47 | 47 | // Plugin version |
| 48 | 48 | if (!defined('FBOX_VERSION')) |
| 49 | 49 | { |
| 50 | - define('FBOX_VERSION', '3.1.13'); | |
| 50 | + define('FBOX_VERSION', '2.1.14'); | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | // Plugin License type (free/pro) |
| 54 | 54 | if (!defined('FBOX_LICENSE_TYPE')) |
| @@ -53,29 +53,14 @@ | ||
| 53 | 53 | // Plugin License type (free/pro) |
| 54 | 54 | if (!defined('FBOX_LICENSE_TYPE')) |
| 55 | 55 | { |
| 56 | 56 | |
| 57 | - $fbox_license_type = 'lite'; | |
| 57 | + $type = 'lite'; | |
| 58 | 58 | |
| 59 | 59 | |
| 60 | - define('FBOX_LICENSE_TYPE', $fbox_license_type); | |
| 61 | - unset($fbox_license_type); | |
| 60 | + define('FBOX_LICENSE_TYPE', $type); | |
| 62 | 61 | } |
| 63 | 62 | |
| 64 | -// Plugin License Plan (basic/pro/growth) | |
| 65 | -if (!defined('FBOX_LICENSE_PLAN')) | |
| 66 | -{ | |
| 67 | - | |
| 68 | - $fbox_license_plan = 'free'; | |
| 69 | - | |
| 70 | - | |
| 71 | - | |
| 72 | - | |
| 73 | - | |
| 74 | - define('FBOX_LICENSE_PLAN', $fbox_license_plan); | |
| 75 | - unset($fbox_license_plan); | |
| 76 | -} | |
| 77 | - | |
| 78 | 63 | // PHP Minimm Version |
| 79 | 64 | if (!defined('FBOX_MINIMUM_PHP_VERSION')) |
| 80 | 65 | { |
| 81 | 66 | define('FBOX_MINIMUM_PHP_VERSION', '7.0'); |
| @@ -80,20 +65,22 @@ | ||
| 80 | 65 | { |
| 81 | 66 | define('FBOX_MINIMUM_PHP_VERSION', '7.0'); |
| 82 | 67 | } |
| 83 | 68 | |
| 69 | + | |
| 84 | 70 | // Go Pro URL |
| 85 | 71 | if (!defined('FBOX_GO_PRO_URL')) |
| 86 | 72 | { |
| 87 | - define('FBOX_GO_PRO_URL', 'https://www.fireplugins.com/upgrade/?utm_source=product&utm_campaign=firebox-' . (FBOX_LICENSE_TYPE === 'lite' ? 'free' : 'pro') . '&utm_medium=%s-feature'); | |
| 73 | + define('FBOX_GO_PRO_URL', 'https://www.fireplugins.com/firebox/upgrade?coupon=FREE2PRO&utm_source=Wordpress&utm_medium=upgradebutton&utm_campaign=freeversion'); | |
| 88 | 74 | } |
| 89 | 75 | |
| 90 | 76 | |
| 91 | 77 | |
| 78 | + | |
| 92 | 79 | // Plugin Documentation URL |
| 93 | 80 | if (!defined('FBOX_DOC_URL')) |
| 94 | 81 | { |
| 95 | - define('FBOX_DOC_URL', 'https://www.fireplugins.com/docs/?utm_source=product&utm_campaign=firebox-' . (FBOX_LICENSE_TYPE === 'lite' ? 'free' : 'pro') . '&utm_medium=misc&utm_content=documentation'); | |
| 82 | + define('FBOX_DOC_URL', 'https://www.fireplugins.com/docs/firebox/'); | |
| 96 | 83 | } |
| 97 | 84 | |
| 98 | 85 | // Plugin Folder Path |
| 99 | 86 | if (!defined('FBOX_PLUGIN_DIR')) |
| @@ -103,9 +90,9 @@ | ||
| 103 | 90 | |
| 104 | 91 | // Plugin Release Date |
| 105 | 92 | if (!defined('FBOX_RELEASE_DATE')) |
| 106 | 93 | { |
| 107 | - define('FBOX_RELEASE_DATE', '2026-09-07'); | |
| 94 | + define('FBOX_RELEASE_DATE', '2024-05-30'); | |
| 108 | 95 | } |
| 109 | 96 | |
| 110 | 97 | // Layouts Folder Path |
| 111 | 98 | if (!defined('FBOX_LAYOUTS_DIR')) |
| @@ -172,41 +159,46 @@ | ||
| 172 | 159 | add_action('admin_notices', 'firebox_fail_php_version'); |
| 173 | 160 | } |
| 174 | 161 | else |
| 175 | 162 | { |
| 176 | - /** | |
| 177 | - * Install and upgrade entry point. | |
| 178 | - * | |
| 179 | - * The activation hook fires on one site only, and never for a site added to | |
| 180 | - * a network later. It is also missed when a plugin is activated by WP-CLI on | |
| 181 | - * part of a network, or when a site is restored from a backup. Comparing the | |
| 182 | - * stored version to the running one catches all of those, and it covers the | |
| 183 | - * plugin update too — upgrader_process_complete runs while the old code is | |
| 184 | - * still loaded, so the first request on the new code is what has to do the | |
| 185 | - * work anyway. The installer stamps the version, so this runs once. | |
| 186 | - */ | |
| 187 | - function firebox_init_installer_start() | |
| 163 | + // Migrator | |
| 164 | + function firebox_upgrader_migrator_start($upgrader_object, $options) | |
| 188 | 165 | { |
| 189 | - add_action('fpf_init', function() { | |
| 190 | - if (get_option('firebox_version') === FBOX_VERSION) | |
| 166 | + if ($options['action'] === 'update' && $options['type'] === 'plugin' && isset($options['plugins'])) | |
| 167 | + { | |
| 168 | + foreach ($options['plugins'] as $plugin) | |
| 191 | 169 | { |
| 192 | - return; | |
| 170 | + if ($plugin !== plugin_basename(__FILE__)) | |
| 171 | + { | |
| 172 | + continue; | |
| 173 | + } | |
| 174 | + | |
| 175 | + $migrator = new \FireBox\Core\Migrator(get_option('firebox_version', '1.0.0')); | |
| 176 | + $migrator->run(); | |
| 193 | 177 | } |
| 178 | + } | |
| 179 | + } | |
| 180 | + add_action('upgrader_process_complete', 'firebox_upgrader_migrator_start', 10, 2); | |
| 194 | 181 | |
| 195 | - \FireBox\Core\Admin\SiteInstaller::install(); | |
| 182 | + function firebox_init_migrator_start() | |
| 183 | + { | |
| 184 | + add_action('fpf_init', function() { | |
| 185 | + $migrator = new \FireBox\Core\Migrator(get_option('firebox_version', '1.0.0')); | |
| 186 | + $migrator->run(); | |
| 196 | 187 | }); |
| 197 | 188 | } |
| 198 | - add_action('plugins_loaded', 'firebox_init_installer_start', -1); | |
| 189 | + add_action('plugins_loaded', 'firebox_init_migrator_start', -1); | |
| 199 | 190 | |
| 200 | - | |
| 201 | - | |
| 202 | 191 | // Start Plugin |
| 203 | 192 | require_once dirname(__FILE__) . '/Inc/Core/Plugin.php'; |
| 204 | 193 | firebox(); |
| 205 | 194 | |
| 206 | - // Run Activation/Deactivation procedures. | |
| 207 | - $maintenance = new \FireBox\Core\Admin\Maintenance(firebox()->hook_data); | |
| 208 | - $maintenance->init(); | |
| 195 | + if (is_admin()) | |
| 196 | + { | |
| 197 | + // Run Activation/Deactivation procedures | |
| 198 | + $maintenance = new \FireBox\Core\Admin\Maintenance(firebox()->hook_data); | |
| 199 | + $maintenance->init(); | |
| 200 | + } | |
| 209 | 201 | } |
| 210 | 202 | |
| 211 | 203 | /** |
| 212 | 204 | * FireBox admin notice for minimum PHP version. |
| @@ -222,5 +214,5 @@ | ||
| 222 | 214 | $message = sprintf(fpframework()->_('FPF_PHP_VERSION_FAIL'), 'FireBox', FBOX_MINIMUM_PHP_VERSION); |
| 223 | 215 | $html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) ); |
| 224 | 216 | echo wp_kses_post( $html_message ); |
| 225 | 217 | } |
| 226 | -} | |
| 218 | +} | |