PluginProbe
Speed Booster Pack ⚡ PageSpeed Optimization Suite / trunk
Speed Booster Pack ⚡ PageSpeed Optimization Suite vtrunk
3.7.7 3.8 3.8.1 3.8.2 3.8.2.1 3.8.3 3.8.4.1 3.8.4.2 3.8.4.3 3.8.5 3.8.5.1 3.8.6 4.0.0 4.0.1 4.1.0 4.1.1 4.1.2 4.1.3 4.2.0 4.2.1 4.2.2 4.3.0 4.3.1 4.3.2 4.3.3 All 78 releases
speed-booster-pack / speed-booster-pack.php

speed-booster-pack.php in Speed Booster Pack ⚡ PageSpeed Optimization Suite trunk, at speed-booster-pack.php

126 lines 4.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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