| @@ -1,64 +1,87 @@ | ||
| 1 | -<?php | |
| 2 | -/* | |
| 3 | -Plugin Name: Boxzilla | |
| 4 | -Version: 3.0 | |
| 5 | -Plugin URI: https://boxzillaplugin.com/#utm_source=wp-plugin&utm_medium=boxzilla&utm_campaign=plugins-page | |
| 6 | -Description: Call-To-Action Boxes that display after visitors scroll down far enough. Unobtrusive, but highly conversing! | |
| 7 | -Author: ibericode | |
| 8 | -Author URI: https://ibericode.com/#utm_source=wp-plugin&utm_medium=boxzilla&utm_campaign=plugins-page | |
| 9 | -Text Domain: boxzilla | |
| 10 | -Domain Path: /languages/ | |
| 11 | -License: GPL v3 | |
| 12 | - | |
| 13 | -Boxzilla Plugin | |
| 14 | -Copyright (C) 2013-2016, Danny van Kooten, hi@dannyvankooten.com | |
| 15 | - | |
| 16 | -This program is free software: you can redistribute it and/or modify | |
| 17 | -it under the terms of the GNU General Public License as published by | |
| 18 | -the Free Software Foundation, either version 3 of the License, or | |
| 19 | -(at your option) any later version. | |
| 20 | - | |
| 21 | -This program is distributed in the hope that it will be useful, | |
| 22 | -but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 23 | -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 24 | -GNU General Public License for more details. | |
| 25 | - | |
| 26 | -You should have received a copy of the GNU General Public License | |
| 27 | -along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 28 | -*/ | |
| 29 | - | |
| 30 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 31 | - header( 'Status: 403 Forbidden' ); | |
| 32 | - header( 'HTTP/1.1 403 Forbidden' ); | |
| 33 | - exit; | |
| 34 | -} | |
| 35 | - | |
| 36 | - | |
| 37 | -/** | |
| 38 | - * @ignore | |
| 39 | - * @internal | |
| 40 | - */ | |
| 41 | -function __load_boxzilla() { | |
| 42 | - | |
| 43 | - // Load PHP 5.2 fallback | |
| 44 | - if( version_compare( PHP_VERSION, '5.3', '<' ) ) { | |
| 45 | - require dirname( __FILE__ ) . '/src/class-php-fallback.php'; | |
| 46 | - new Boxzilla_PHP_Fallback( 'Boxzilla', plugin_basename( __FILE__ ) ); | |
| 47 | - return; | |
| 48 | - } | |
| 49 | - | |
| 50 | - define( 'BOXZILLA_FILE', __FILE__ ); | |
| 51 | - define( 'BOXZILLA_VERSION', '3.0' ); | |
| 52 | - | |
| 53 | - require __DIR__ . '/bootstrap.php'; | |
| 54 | -} | |
| 55 | - | |
| 56 | -// load autoloader but only if not loaded already (for compat with sitewide autoloader) | |
| 57 | -if( ! function_exists( 'boxzilla' ) ) { | |
| 58 | - require dirname( __FILE__ ) . '/vendor/autoload.php'; | |
| 59 | -} | |
| 60 | - | |
| 61 | -// register activation hook | |
| 62 | -register_activation_hook( __FILE__, array( 'Boxzilla\\Admin\\Installer', 'run' ) ); | |
| 63 | - | |
| 64 | -add_action( 'plugins_loaded', '__load_boxzilla', 8 ); | |
| 1 | +<?php | |
| 2 | +/* | |
| 3 | +Plugin Name: Boxzilla | |
| 4 | +Version: 3.4.0 | |
| 5 | +Plugin URI: https://www.boxzillaplugin.com/ | |
| 6 | +Description: Call-To-Action Boxes that display after visitors scroll down far enough. Unobtrusive, but highly conversing! | |
| 7 | +Author: ibericode | |
| 8 | +Author URI: https://www.ibericode.com/ | |
| 9 | +Text Domain: boxzilla | |
| 10 | +Domain Path: /languages/ | |
| 11 | +License: GPL-3.0-or-later | |
| 12 | +License URI: http://www.gnu.org/licenses/gpl-3.0.html | |
| 13 | + | |
| 14 | +Boxzilla Plugin | |
| 15 | +Copyright (C) 2013 Danny van Kooten | |
| 16 | + | |
| 17 | +This program is free software: you can redistribute it and/or modify | |
| 18 | +it under the terms of the GNU General Public License as published by | |
| 19 | +the Free Software Foundation, either version 3 of the License, or | |
| 20 | +(at your option) any later version. | |
| 21 | + | |
| 22 | +This program is distributed in the hope that it will be useful, | |
| 23 | +but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 24 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 25 | +GNU General Public License for more details. | |
| 26 | + | |
| 27 | +You should have received a copy of the GNU General Public License | |
| 28 | +along with this program. If not, see <https://www.gnu.org/licenses/>. | |
| 29 | +*/ | |
| 30 | + | |
| 31 | + | |
| 32 | +// Exit if not loaded inside a WordPress context | |
| 33 | +defined('ABSPATH') or exit; | |
| 34 | + | |
| 35 | +// Exit if PHP lower than 7.2 | |
| 36 | +PHP_VERSION_ID >= 70200 or exit; | |
| 37 | + | |
| 38 | +define( 'BOXZILLA_FILE', __FILE__ ); | |
| 39 | +define( 'BOXZILLA_DIR', __DIR__ ); | |
| 40 | +define( 'BOXZILLA_VERSION', '3.3.1' ); | |
| 41 | + | |
| 42 | +require __DIR__ . '/autoload.php'; | |
| 43 | +require __DIR__ . '/src/services.php'; | |
| 44 | +require __DIR__ . '/src/licensing/services.php'; | |
| 45 | + | |
| 46 | + | |
| 47 | +// register activation hook | |
| 48 | +register_activation_hook( __FILE__, array( 'Boxzilla\\Admin\\Installer', 'run' ) ); | |
| 49 | + | |
| 50 | +// Bootstrap plugin at later action hook | |
| 51 | +add_action( | |
| 52 | + 'plugins_loaded', | |
| 53 | + function() { | |
| 54 | + $boxzilla = boxzilla(); | |
| 55 | + | |
| 56 | + // load default filters | |
| 57 | + require __DIR__ . '/src/default-filters.php'; | |
| 58 | + require __DIR__ . '/src/default-actions.php'; | |
| 59 | + | |
| 60 | + if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { | |
| 61 | + $boxzilla['filter.autocomplete']->init(); | |
| 62 | + $boxzilla['admin.menu']->init(); | |
| 63 | + } elseif ( defined( 'DOING_CRON' ) && DOING_CRON ) { | |
| 64 | + $boxzilla['license_poller']->init(); | |
| 65 | + } elseif ( is_admin() ) { | |
| 66 | + $boxzilla['admin']->init(); | |
| 67 | + $boxzilla['admin.menu']->init(); | |
| 68 | + } else { | |
| 69 | + add_action( | |
| 70 | + 'template_redirect', | |
| 71 | + function() use ( $boxzilla ) { | |
| 72 | + $boxzilla['box_loader']->init(); | |
| 73 | + } | |
| 74 | + ); | |
| 75 | + } | |
| 76 | + | |
| 77 | + // license manager | |
| 78 | + if ( is_admin() || ( defined( 'DOING_CRON' ) && DOING_CRON ) || ( defined( 'WP_CLI' ) && WP_CLI ) ) { | |
| 79 | + $boxzilla['license_manager']->init(); | |
| 80 | + | |
| 81 | + if ( count( $boxzilla->plugins ) > 0 ) { | |
| 82 | + $boxzilla['update_manager']->init(); | |
| 83 | + } | |
| 84 | + } | |
| 85 | + }, | |
| 86 | + 90 | |
| 87 | +); | |