| @@ -1,26 +1,25 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * @package FireBox |
| 4 | - * @version 1.1.0 Free | |
| 4 | + * @version 3.1.14 | |
| 5 | 5 | * |
| 6 | 6 | * @author FirePlugins <[email protected]> |
| 7 | 7 | * @link https://www.fireplugins.com |
| 8 | - * @copyright Copyright © 2022 FirePlugins All Rights Reserved | |
| 8 | + * @copyright Copyright © 2026 FirePlugins All Rights Reserved | |
| 9 | 9 | * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later |
| 10 | 10 | * |
| 11 | - * Plugin Name: FireBox | |
| 12 | - * Plugin URI: https://www.fireplugins.com/firebox | |
| 11 | + * Plugin Name: FireBox 3.1.14 Free | |
| 12 | + * Plugin URI: https://www.fireplugins.com/ | |
| 13 | 13 | * Description: WordPress Popup and leads generation plugin that converts visitors into subscribers & customers. |
| 14 | - * Version: 1.1.0 | |
| 15 | - * Author: FirePlugins Popup Plugin Team | |
| 14 | + * Version: 3.1.14 | |
| 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: 5.4 | |
| 20 | - * Tested up to: 5.9 | |
| 21 | - * Requires PHP: 5.6.40 | |
| 22 | - * License: GNU General Public License v2.0+ | |
| 19 | + * Requires at least: 6.3 | |
| 20 | + * Requires PHP: 7.0 | |
| 21 | + * License: GPLv3 or later | |
| 23 | 22 | * License URI: http://www.gnu.org/licenses/gpl-2.0.html |
| 24 | 23 | */ |
| 25 | 24 | |
| 26 | 25 | // If this file is called directly, abort. |
| @@ -29,11 +28,19 @@ | ||
| 29 | 28 | exit; // Exit if accessed directly. |
| 30 | 29 | } |
| 31 | 30 | |
| 32 | 31 | // Load Framework |
| 32 | +if (!file_exists(dirname(__FILE__) . '/Inc/Framework/init.php')) | |
| 33 | +{ | |
| 34 | + return; | |
| 35 | +} | |
| 33 | 36 | require_once dirname(__FILE__) . '/Inc/Framework/init.php'; |
| 34 | 37 | |
| 35 | 38 | // Plugin Autoloader |
| 39 | +if (!file_exists(dirname(__FILE__) . '/autoload.php')) | |
| 40 | +{ | |
| 41 | + return; | |
| 42 | +} | |
| 36 | 43 | require_once dirname(__FILE__) . '/autoload.php'; |
| 37 | 44 | |
| 38 | 45 | |
| 39 | 46 | |
| @@ -39,9 +46,9 @@ | ||
| 39 | 46 | |
| 40 | 47 | // Plugin version |
| 41 | 48 | if (!defined('FBOX_VERSION')) |
| 42 | 49 | { |
| 43 | - define('FBOX_VERSION', '1.1.0'); | |
| 50 | + define('FBOX_VERSION', '3.1.14'); | |
| 44 | 51 | } |
| 45 | 52 | |
| 46 | 53 | // Plugin License type (free/pro) |
| 47 | 54 | if (!defined('FBOX_LICENSE_TYPE')) |
| @@ -46,33 +53,47 @@ | ||
| 46 | 53 | // Plugin License type (free/pro) |
| 47 | 54 | if (!defined('FBOX_LICENSE_TYPE')) |
| 48 | 55 | { |
| 49 | 56 | |
| 50 | - $type = 'lite'; | |
| 57 | + $fbox_license_type = 'lite'; | |
| 51 | 58 | |
| 52 | 59 | |
| 53 | - define('FBOX_LICENSE_TYPE', $type); | |
| 60 | + define('FBOX_LICENSE_TYPE', $fbox_license_type); | |
| 61 | + unset($fbox_license_type); | |
| 54 | 62 | } |
| 55 | 63 | |
| 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 | + | |
| 56 | 78 | // PHP Minimm Version |
| 57 | 79 | if (!defined('FBOX_MINIMUM_PHP_VERSION')) |
| 58 | 80 | { |
| 59 | - define('FBOX_MINIMUM_PHP_VERSION', '5.6.40'); | |
| 81 | + define('FBOX_MINIMUM_PHP_VERSION', '7.0'); | |
| 60 | 82 | } |
| 61 | 83 | |
| 62 | - | |
| 63 | 84 | // Go Pro URL |
| 64 | 85 | if (!defined('FBOX_GO_PRO_URL')) |
| 65 | 86 | { |
| 66 | - define('FBOX_GO_PRO_URL', 'https://www.fireplugins.com/firebox/upgrade'); | |
| 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'); | |
| 67 | 88 | } |
| 68 | 89 | |
| 69 | 90 | |
| 91 | + | |
| 70 | 92 | // Plugin Documentation URL |
| 71 | 93 | if (!defined('FBOX_DOC_URL')) |
| 72 | 94 | { |
| 73 | - // TODO: define final URL | |
| 74 | - define('FBOX_DOC_URL', 'https://www.fireplugins.com/docs/firebox'); | |
| 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'); | |
| 75 | 96 | } |
| 76 | 97 | |
| 77 | 98 | // Plugin Folder Path |
| 78 | 99 | if (!defined('FBOX_PLUGIN_DIR')) |
| @@ -79,24 +100,30 @@ | ||
| 79 | 100 | { |
| 80 | 101 | define('FBOX_PLUGIN_DIR', plugin_dir_path(__FILE__)); |
| 81 | 102 | } |
| 82 | 103 | |
| 104 | +// Plugin Release Date | |
| 105 | +if (!defined('FBOX_RELEASE_DATE')) | |
| 106 | +{ | |
| 107 | + define('FBOX_RELEASE_DATE', '2026-10-02'); | |
| 108 | +} | |
| 109 | + | |
| 83 | 110 | // Layouts Folder Path |
| 84 | 111 | if (!defined('FBOX_LAYOUTS_DIR')) |
| 85 | 112 | { |
| 86 | - define('FBOX_LAYOUTS_DIR', plugin_dir_path(__FILE__) . 'Inc/Core/Layouts/'); | |
| 113 | + define('FBOX_LAYOUTS_DIR', FBOX_PLUGIN_DIR . 'Inc/Core/Layouts/'); | |
| 87 | 114 | } |
| 88 | 115 | |
| 89 | 116 | // Admin Layouts Folder Path |
| 90 | 117 | if (!defined('FBOX_ADMIN_LAYOUTS_DIR')) |
| 91 | 118 | { |
| 92 | - define('FBOX_ADMIN_LAYOUTS_DIR', plugin_dir_path(__FILE__) . 'Inc/Core/Layouts/admin/'); | |
| 119 | + define('FBOX_ADMIN_LAYOUTS_DIR', FBOX_PLUGIN_DIR . 'Inc/Core/Layouts/admin/'); | |
| 93 | 120 | } |
| 94 | 121 | |
| 95 | 122 | // Public Layouts Folder Path |
| 96 | 123 | if (!defined('FBOX_PUBLIC_LAYOUTS_DIR')) |
| 97 | 124 | { |
| 98 | - define('FBOX_PUBLIC_LAYOUTS_DIR', plugin_dir_path(__FILE__) . 'Inc/Core/Layouts/public/'); | |
| 125 | + define('FBOX_PUBLIC_LAYOUTS_DIR', FBOX_PLUGIN_DIR . 'Inc/Core/Layouts/public/'); | |
| 99 | 126 | } |
| 100 | 127 | |
| 101 | 128 | // Plugin Folder URL |
| 102 | 129 | if (!defined('FBOX_PLUGIN_URL')) |
| @@ -133,8 +160,13 @@ | ||
| 133 | 160 | { |
| 134 | 161 | define('FBOX_BASE_FOLDER', dirname(__FILE__)); |
| 135 | 162 | } |
| 136 | 163 | |
| 164 | +if (!defined('FBOX_PLUGIN_BASENAME')) | |
| 165 | +{ | |
| 166 | + define('FBOX_PLUGIN_BASENAME', plugin_basename(__FILE__)); | |
| 167 | +} | |
| 168 | + | |
| 137 | 169 | // Minimum PHP version check |
| 138 | 170 | if (!version_compare(PHP_VERSION, FBOX_MINIMUM_PHP_VERSION, '>=')) |
| 139 | 171 | { |
| 140 | 172 | add_action('admin_notices', 'firebox_fail_php_version'); |
| @@ -140,11 +172,41 @@ | ||
| 140 | 172 | add_action('admin_notices', 'firebox_fail_php_version'); |
| 141 | 173 | } |
| 142 | 174 | else |
| 143 | 175 | { |
| 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() | |
| 188 | + { | |
| 189 | + add_action('fpf_init', function() { | |
| 190 | + if (get_option('firebox_version') === FBOX_VERSION) | |
| 191 | + { | |
| 192 | + return; | |
| 193 | + } | |
| 194 | + | |
| 195 | + \FireBox\Core\Admin\SiteInstaller::install(); | |
| 196 | + }); | |
| 197 | + } | |
| 198 | + add_action('plugins_loaded', 'firebox_init_installer_start', -1); | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 144 | 202 | // Start Plugin |
| 145 | 203 | require_once dirname(__FILE__) . '/Inc/Core/Plugin.php'; |
| 146 | 204 | firebox(); |
| 205 | + | |
| 206 | + // Run Activation/Deactivation procedures. | |
| 207 | + $maintenance = new \FireBox\Core\Admin\Maintenance(firebox()->hook_data); | |
| 208 | + $maintenance->init(); | |
| 147 | 209 | } |
| 148 | 210 | |
| 149 | 211 | /** |
| 150 | 212 | * FireBox admin notice for minimum PHP version. |
| @@ -152,10 +214,13 @@ | ||
| 152 | 214 | * Warning when the site doesn't have the minimum required PHP version. |
| 153 | 215 | * |
| 154 | 216 | * @return void |
| 155 | 217 | */ |
| 156 | -function firebox_fail_php_version() | |
| 218 | +if (!function_exists('firebox_fail_php_version')) | |
| 157 | 219 | { |
| 158 | - $message = sprintf(fpframework()->_('FPF_PHP_VERSION_FAIL'), 'FireBox', FBOX_MINIMUM_PHP_VERSION); | |
| 159 | - $html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) ); | |
| 160 | - echo wp_kses_post( $html_message ); | |
| 161 | -} | |
| 220 | + function firebox_fail_php_version() | |
| 221 | + { | |
| 222 | + $message = sprintf(fpframework()->_('FPF_PHP_VERSION_FAIL'), 'FireBox', FBOX_MINIMUM_PHP_VERSION); | |
| 223 | + $html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) ); | |
| 224 | + echo wp_kses_post( $html_message ); | |
| 225 | + } | |
| 226 | +} | |