-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patheasy-image-optimizer.php
More file actions
81 lines (75 loc) · 2.34 KB
/
easy-image-optimizer.php
File metadata and controls
81 lines (75 loc) · 2.34 KB
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
<?php
/**
* Loader for Easy IO plugin.
*
* This file bootstraps the rest of the Easy IO plugin after some basic checks.
*
* @link https://ewww.io/easy/
* @package Easy_Image_Optimizer
*/
/*
Plugin Name: Easy Image Optimizer
Plugin URI: https://wordpress.org/plugins/easy-image-optimizer/
Description: Easily speed up your website to better connect with your visitors. Properly compress and size/scale images. Includes lazy load and WebP auto-convert.
Author: Exactly WWW
Version: 4.3.2
Requires at least: 6.7
Requires PHP: 8.1
Author URI: https://ewww.io/
License: GPLv3
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'EasyIO\Plugin' ) && ! str_contains( add_query_arg( '', '' ), 'easyio_disable=1' ) ) {
define( 'EASYIO_VERSION', 432 );
/**
* The full path of the plugin file (this file).
*
* @var string EASYIO_PLUGIN_FILE
*/
define( 'EASYIO_PLUGIN_FILE', __FILE__ );
/**
* The path of the plugin file relative to the plugins/ folder.
*
* @var string EASYIO_PLUGIN_FILE_REL
*/
define( 'EASYIO_PLUGIN_FILE_REL', plugin_basename( __FILE__ ) );
/**
* This is the full system path to the plugin folder.
*
* @var string EASYIO_PLUGIN_PATH
*/
define( 'EASYIO_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
if ( ! defined( 'EASYIO_CONTENT_DIR' ) ) {
if ( defined( 'EWWWIO_CONTENT_DIR' ) ) {
define( 'EASYIO_CONTENT_DIR', EWWWIO_CONTENT_DIR );
} else {
$easyio_content_dir = trailingslashit( WP_CONTENT_DIR ) . trailingslashit( 'easyio' );
if ( ! is_writable( WP_CONTENT_DIR ) || ! empty( $_ENV['PANTHEON_ENVIRONMENT'] ) ) {
$upload_dir = wp_get_upload_dir();
if ( ! str_contains( $upload_dir['basedir'], '://' ) && is_writable( $upload_dir['basedir'] ) ) {
$easyio_content_dir = trailingslashit( $upload_dir['basedir'] ) . trailingslashit( 'easyio' );
}
}
define( 'EASYIO_CONTENT_DIR', $easyio_content_dir );
}
}
/**
* All the base functions for our plugins.
*/
require_once EASYIO_PLUGIN_PATH . 'classes/class-base.php';
/**
* The setup functions for Easy IO.
*/
require_once EASYIO_PLUGIN_PATH . 'classes/class-plugin.php';
/**
* The main function to return a single EasyIO\Plugin object to functions elsewhere.
*
* @return object object|EasyIO\Plugin The one true EasyIO\Plugin instance.
*/
function easyio() {
return EasyIO\Plugin::instance();
}
easyio();
} // End if().