-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathedge-images.php
87 lines (77 loc) · 2.26 KB
/
edge-images.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
/**
* Edge Images - Routes images through edge providers for optimization and transformation.
*
* @package Edge_Images
* @author Jono Alderson <https://www.jonoalderson.com/>
* @license GPL-2.0-or-later
* @link https://github.com/jonoalderson/edge-images/
* @since 1.0.0
* @version 5.2.13
*
* @wordpress-plugin
* Plugin Name: Edge Images
* Plugin URI: https://github.com/jonoalderson/edge-images/
* Description: Routes images through edge providers (like Cloudflare or Accelerated Domains) for automatic optimization and transformation. Improves page speed and image loading performance.
* Version: 5.2.13
* Requires PHP: 7.4
* Requires at least: 5.6
* Tested up to: 6.7
* Author: Jono Alderson
* Author URI: https://www.jonoalderson.com/
* Text Domain: edge-images
* Domain Path: /languages
* License: GPL v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*/
namespace Edge_Images;
// Prevent direct access.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Define plugin constants.
define( 'EDGE_IMAGES_VERSION', '5.2.13' );
define( 'EDGE_IMAGES_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'EDGE_IMAGES_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
// Load autoloader.
require_once EDGE_IMAGES_PLUGIN_DIR . 'autoload.php';
// Add near the top of the file after plugin header
register_activation_hook(__FILE__, ['\Edge_Images\Activation', 'activate']);
/**
* Initialize admin functionality when in the WordPress admin area.
*
* @since 4.0.0
* @return void
*/
if ( is_admin() ) {
add_action( 'init', [ Admin_Page::class, 'register' ] );
}
/**
* Initialize the main plugin functionality.
*
* @since 4.0.0
* @return void
*/
add_action( 'init', [ Handler::class, 'register' ], 5 );
/**
* Initialize integrations.
* We use 'plugins_loaded' to ensure all plugins are available.
*
* @since 4.0.0
* @return void
*/
add_action( 'plugins_loaded', [ Integrations::class, 'register' ], 5 );
/**
* Initialize feature management.
*
* @since 4.0.0
* @return void
*/
add_action('init', [Features::class, 'register'], 5);
/**
* Initialize block management.
*
* @since 4.5.0
* @return void
*/
add_action('init', [Blocks::class, 'register'], 5);