PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / 2.3.0
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF v2.3.0
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
imagify / inc / 3rd-party / amazon-s3-and-cloudfront / amazon-s3-and-cloudfront.php

amazon-s3-and-cloudfront.php in Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF 2.3.0, at inc/3rd-party/amazon-s3-and-cloudfront/amazon-s3-and-cloudfront.php

65 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
3
4 /**
5 * Tell if WP Offload S3 compatibility is loaded.
6 *
7 * @since 1.7
8 * @author Grégory Viguier
9 *
10 * @return bool
11 */
12 function imagify_load_as3cf_compat() {
13 if ( function_exists( 'as3cf_init' ) ) {
14 // WP Offload S3 Lite.
15 $version = ! empty( $GLOBALS['aws_meta']['amazon-s3-and-cloudfront']['version'] ) ? $GLOBALS['aws_meta']['amazon-s3-and-cloudfront']['version'] : false;
16
17 if ( ! $version ) {
18 return false;
19 }
20
21 if ( ! function_exists( 'amazon_web_services_init' ) && version_compare( $version, '1.3' ) < 0 ) {
22 // Old version, plugin Amazon Web Services is required.
23 return false;
24 }
25
26 if ( version_compare( $version, '2.3' ) >= 0 ) {
27 // A new version that removes a punlic method.
28 return false;
29 }
30
31 return true;
32 }
33
34 if ( function_exists( 'as3cf_pro_init' ) ) {
35 // WP Offload S3 Pro.
36 $version = ! empty( $GLOBALS['aws_meta']['amazon-s3-and-cloudfront-pro']['version'] ) ? $GLOBALS['aws_meta']['amazon-s3-and-cloudfront-pro']['version'] : false;
37
38 if ( ! $version ) {
39 return false;
40 }
41
42 if ( ! function_exists( 'amazon_web_services_init' ) && version_compare( $version, '1.6' ) < 0 ) {
43 // Old version, plugin Amazon Web Services is required.
44 return false;
45 }
46
47 if ( version_compare( $version, '2.3' ) >= 0 ) {
48 // A new version that removes a punlic method.
49 return false;
50 }
51
52 return true;
53 }
54
55 return false;
56 }
57
58 if ( imagify_load_as3cf_compat() ) :
59
60 class_alias( '\\Imagify\\ThirdParty\\AS3CF\\Main', '\\Imagify_AS3CF' );
61
62 add_action( 'imagify_loaded', [ \Imagify\ThirdParty\AS3CF\Main::get_instance(), 'init' ], 1 );
63
64 endif;
65