| 1 |
<?php |
| 2 |
/** |
| 3 |
* Offload, Store, Resize & Optimize with Cloudflare Images |
| 4 |
* |
| 5 |
* This file is read by WordPress to generate the plugin information in the plugin |
| 6 |
* Admin area. This file also App all the dependencies used by the plugin, registers |
| 7 |
* the activation and deactivation functions, and defines a function that starts the plugin. |
| 8 |
* |
| 9 |
* @link https://vcore.au |
| 10 |
* @since 1.0.0 |
| 11 |
* @package CF_Images |
| 12 |
* |
| 13 |
* @wordpress-plugin |
| 14 |
* Plugin Name: Offload Media to Cloudflare Images |
| 15 |
* Plugin URI: https://vcore.au |
| 16 |
* Description: Offload media library images to the `Cloudflare Images` service. |
| 17 |
* Version: 1.10.3 |
| 18 |
* Author: Anton Vanyukov |
| 19 |
* Author URI: https://vcore.au |
| 20 |
* License: GPL-2.0+ |
| 21 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 22 |
* Text Domain: cf-images |
| 23 |
* Domain Path: /languages |
| 24 |
*/ |
| 25 |
|
| 26 |
namespace CF_Images; |
| 27 |
|
| 28 |
// If this file is called directly, abort. |
| 29 |
if ( ! defined( 'WPINC' ) ) { |
| 30 |
die; |
| 31 |
} |
| 32 |
|
| 33 |
define( 'CF_IMAGES_VERSION', '1.10.3' ); |
| 34 |
define( 'CF_IMAGES_DIR_URL', plugin_dir_url( __FILE__ ) ); |
| 35 |
|
| 36 |
require_once 'app/class-activator.php'; |
| 37 |
register_activation_hook( __FILE__, array( 'CF_Images\App\Activator', 'activate' ) ); |
| 38 |
register_deactivation_hook( __FILE__, array( 'CF_Images\App\Activator', 'deactivate' ) ); |
| 39 |
|
| 40 |
/** |
| 41 |
* Begins execution of the plugin. |
| 42 |
* |
| 43 |
* Since everything within the plugin is registered via hooks, |
| 44 |
* then kicking off the plugin from this point in the file does |
| 45 |
* not affect the page life cycle. |
| 46 |
* |
| 47 |
* @since 1.0.0 |
| 48 |
*/ |
| 49 |
function run_cf_images() { |
| 50 |
require_once __DIR__ . '/app/traits/trait-ajax.php'; |
| 51 |
require_once __DIR__ . '/app/traits/trait-empty-init.php'; |
| 52 |
require_once __DIR__ . '/app/traits/trait-helpers.php'; |
| 53 |
require_once __DIR__ . '/app/traits/trait-stats.php'; |
| 54 |
require_once __DIR__ . '/app/class-core.php'; |
| 55 |
App\Activator::maybe_upgrade(); |
| 56 |
App\Core::get_instance(); |
| 57 |
} |
| 58 |
run_cf_images(); |
| 59 |
|