sg-cachepress
Last commit date
assets
4 weeks ago
core
4 weeks ago
helpers
4 weeks ago
templates
4 weeks ago
vendor
4 weeks ago
readme.txt
4 weeks ago
sg-cachepress.php
4 weeks ago
uninstall.php
4 weeks ago
sg-cachepress.php
75 lines
| 1 | <?php |
| 2 | /** |
| 3 | * SG CachePress |
| 4 | * |
| 5 | * @package SG_CachePress |
| 6 | * @author SiteGround |
| 7 | * @link http://www.siteground.com/ |
| 8 | * |
| 9 | * @wordpress-plugin |
| 10 | * Plugin Name: Speed Optimizer |
| 11 | * Plugin URI: https://siteground.com |
| 12 | * Description: This plugin will link your WordPress application with all the performance optimizations provided by SiteGround |
| 13 | * Version: 7.7.10 |
| 14 | * Author: SiteGround |
| 15 | * Author URI: https://www.siteground.com |
| 16 | * Text Domain: sg-cachepress |
| 17 | * Domain Path: /languages |
| 18 | * License: GPLv3 |
| 19 | */ |
| 20 | |
| 21 | // Our namespace. |
| 22 | namespace SiteGround_Optimizer; |
| 23 | |
| 24 | use SiteGround_Optimizer\Loader\Loader; |
| 25 | use SiteGround_Optimizer\Helper\Helper; |
| 26 | use SiteGround_Optimizer\Activator\Activator; |
| 27 | use SiteGround_Optimizer\Deactivator\Deactivator; |
| 28 | |
| 29 | // If this file is called directly, abort. |
| 30 | if ( ! defined( 'WPINC' ) ) { |
| 31 | die; |
| 32 | } |
| 33 | |
| 34 | // Define version constant. |
| 35 | if ( ! defined( __NAMESPACE__ . '\VERSION' ) ) { |
| 36 | define( __NAMESPACE__ . '\VERSION', '7.7.10' ); |
| 37 | } |
| 38 | |
| 39 | // Define slug constant. |
| 40 | if ( ! defined( __NAMESPACE__ . '\PLUGIN_SLUG' ) ) { |
| 41 | define( __NAMESPACE__ . '\PLUGIN_SLUG', 'sg-cachepress' ); |
| 42 | } |
| 43 | |
| 44 | // Define root directory. |
| 45 | if ( ! defined( __NAMESPACE__ . '\DIR' ) ) { |
| 46 | define( __NAMESPACE__ . '\DIR', __DIR__ ); |
| 47 | } |
| 48 | |
| 49 | // Define root URL. |
| 50 | if ( ! defined( __NAMESPACE__ . '\URL' ) ) { |
| 51 | $root_url = \trailingslashit( DIR ); |
| 52 | |
| 53 | // Sanitize directory separator on Windows. |
| 54 | $root_url = str_replace( '\\', '/', $root_url ); |
| 55 | |
| 56 | $wp_plugin_dir = str_replace( '\\', '/', WP_PLUGIN_DIR ); |
| 57 | $root_url = str_replace( $wp_plugin_dir, \plugins_url(), $root_url ); |
| 58 | |
| 59 | define( __NAMESPACE__ . '\URL', \untrailingslashit( $root_url ) ); |
| 60 | |
| 61 | unset( $root_url ); |
| 62 | } |
| 63 | |
| 64 | require_once( \SiteGround_Optimizer\DIR . '/vendor/autoload.php' ); |
| 65 | |
| 66 | register_activation_hook( __FILE__, array( new Activator(), 'activate' ) ); |
| 67 | register_deactivation_hook( __FILE__, array( new Deactivator(), 'deactivate' ) ); |
| 68 | |
| 69 | // Initialize the loader. |
| 70 | global $siteground_optimizer_loader; |
| 71 | |
| 72 | if ( ! isset( $siteground_optimizer_loader ) ) { |
| 73 | $siteground_optimizer_loader = new Loader(); |
| 74 | } |
| 75 |