| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* |
| 5 |
* @wordpress-plugin |
| 6 |
* Plugin Name: Speed Booster Pack |
| 7 |
* Plugin URI: https://speedboosterpack.com |
| 8 |
* Description: PageSpeed optimization is vital for SEO: A faster website equals better conversions. Optimize & cache your site with this smart plugin! |
| 9 |
* Version: 4.5.9.1 |
| 10 |
* Author: Optimocha |
| 11 |
* Author URI: https://optimocha.com |
| 12 |
* License: GPLv3 or later |
| 13 |
* License URI: https://www.gnu.org/licenses/gpl-3.0.html |
| 14 |
* Text Domain: speed-booster-pack |
| 15 |
* |
| 16 |
* Copyright 2015-2017 Tiguan (office@tiguandesign.com) |
| 17 |
* Copyright 05/05/2017 - 10/04/2017 ShortPixel (alex@shortpixel.com) |
| 18 |
* Copyright 2017-2019 MachoThemes (office@machothemes.com) |
| 19 |
* Copyright 2019-... Optimocha (hey@optimocha.com) |
| 20 |
*/ |
| 21 |
|
| 22 |
defined( 'ABSPATH' ) || exit; |
| 23 |
|
| 24 |
/** |
| 25 |
* Plugin constants. |
| 26 |
*/ |
| 27 |
define( 'SBP_VERSION', '4.5.9.1' ); // plugin version |
| 28 |
define( 'SBP_PLUGIN_NAME', 'Speed Booster Pack' ); // plugin name |
| 29 |
define( 'SBP_PLUGIN_HOME', 'https://speedboosterpack.com/' ); // plugin home |
| 30 |
define( 'SBP_OWNER_NAME', 'Optimocha' ); // plugin owner name |
| 31 |
define( 'SBP_OWNER_HOME', 'https://optimocha.com/' ); // plugin owner home |
| 32 |
define( 'SBP_URL', plugin_dir_url( __FILE__ ) ); // plugin root URL |
| 33 |
define( 'SBP_PATH', realpath( dirname( __FILE__ ) ) . '/' ); // plugin root directory path |
| 34 |
define( 'SBP_INC_PATH', SBP_PATH . 'includes/' ); // plugin includes directory path |
| 35 |
define( 'SBP_LIB_PATH', SBP_PATH . 'vendor/' ); // plugin 3rd party directory path |
| 36 |
define( 'SBP_CACHE_DIR', WP_CONTENT_DIR . '/cache/speed-booster/' ); // plugin cache directory path |
| 37 |
define( 'SBP_CACHE_URL', WP_CONTENT_URL . '/cache/speed-booster/' ); // plugin cache directory URL |
| 38 |
define( 'SBP_UPLOADS_DIR', WP_CONTENT_DIR . '/uploads/speed-booster/' ); // plugin uploads path |
| 39 |
define( 'SBP_UPLOADS_URL', WP_CONTENT_URL . '/uploads/speed-booster/' ); // plugin uploads URL |
| 40 |
define( 'SBP_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); // plugin basename |
| 41 |
define( 'SBP_MIGRATOR_VERSION', '45000' ); // plugin migrator version |
| 42 |
|
| 43 |
/** |
| 44 |
* Load all plugin options |
| 45 |
*/ |
| 46 |
if ( ! function_exists( 'sbp_get_option' ) ) { |
| 47 |
/** |
| 48 |
* Returns the value of the option with given name, if option doesn't exists function returns the default value (from second variable) |
| 49 |
* |
| 50 |
* @param string $option |
| 51 |
* @param null $default |
| 52 |
* |
| 53 |
* @return mixed|null |
| 54 |
*/ |
| 55 |
function sbp_get_option( $option = '', $default = null ) { |
| 56 |
$sbp_options = get_option( 'sbp_options' ); |
| 57 |
|
| 58 |
return ( isset( $sbp_options[ $option ] ) ) ? $sbp_options[ $option ] : $default; |
| 59 |
} |
| 60 |
} |
| 61 |
|
| 62 |
/** |
| 63 |
* The code that runs during plugin activation. |
| 64 |
* This action is documented in includes/class-speed-booster-pack-activator.php |
| 65 |
*/ |
| 66 |
function activate_speed_booster_pack() { |
| 67 |
require_once SBP_INC_PATH . 'class-speed-booster-pack-activator.php'; |
| 68 |
Speed_Booster_Pack_Activator::activate(); |
| 69 |
} |
| 70 |
|
| 71 |
/** |
| 72 |
* The code that runs during plugin deactivation. |
| 73 |
* This action is documented in includes/class-speed-booster-pack-deactivator.php |
| 74 |
*/ |
| 75 |
function deactivate_speed_booster_pack() { |
| 76 |
require_once SBP_INC_PATH . 'class-speed-booster-pack-deactivator.php'; |
| 77 |
Speed_Booster_Pack_Deactivator::deactivate(); |
| 78 |
} |
| 79 |
|
| 80 |
register_activation_hook( __FILE__, 'activate_speed_booster_pack' ); |
| 81 |
register_deactivation_hook( __FILE__, 'deactivate_speed_booster_pack' ); |
| 82 |
|
| 83 |
/** |
| 84 |
* The core plugin class that is used to define internationalization, |
| 85 |
* admin-specific hooks, and public-facing site hooks. |
| 86 |
*/ |
| 87 |
require SBP_INC_PATH . 'class-speed-booster-pack.php'; |
| 88 |
|
| 89 |
/** |
| 90 |
* Autoload classes which has SpeedBooster namespace |
| 91 |
* |
| 92 |
* @param $class_name |
| 93 |
* |
| 94 |
* @since 4.0.0 |
| 95 |
* |
| 96 |
*/ |
| 97 |
spl_autoload_register( 'sbp_autoloader' ); |
| 98 |
function sbp_autoloader( $class_name ) { |
| 99 |
if ( false === strpos( $class_name, 'SpeedBooster\\' ) ) { |
| 100 |
return; |
| 101 |
} |
| 102 |
|
| 103 |
$class_name = str_replace( 'SpeedBooster\\', '', $class_name ); |
| 104 |
|
| 105 |
// Make filename lower case, it's not necessary but do it just in "case" :P (Did you get the joke?) |
| 106 |
$filename = strtolower( str_replace( '_', '-', $class_name ) ); |
| 107 |
$path = SBP_INC_PATH . 'classes/class-' . $filename . '.php'; |
| 108 |
if ( file_exists( $path ) ) { |
| 109 |
require_once( $path ); |
| 110 |
} |
| 111 |
} |
| 112 |
|
| 113 |
/** |
| 114 |
* Begins execution of the plugin. |
| 115 |
* |
| 116 |
* @since 4.0.0 |
| 117 |
*/ |
| 118 |
function run_speed_booster_pack() { |
| 119 |
|
| 120 |
$plugin = new Speed_Booster_Pack(); |
| 121 |
$plugin->run(); |
| 122 |
|
| 123 |
} |
| 124 |
|
| 125 |
run_speed_booster_pack(); |
| 126 |
|