-
Notifications
You must be signed in to change notification settings - Fork 0
/
wordpress-oss.php
65 lines (54 loc) · 2.3 KB
/
wordpress-oss.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
<?php
/*
Plugin Name: Aliyun OSS for WP Media
Plugin URI: https://guztia.com/accelerate-site-china
Description: Uses Aliyun OSS to offload media
Author: Guztia Consulting
Version: 1.0.3
Author URI: https://guztia.com/
Domain Path: /languages/
// Copyright (c) 2021 Guztia Consulting. All rights reserved.
//
// Released under the GPL license
// http://www.opensource.org/licenses/gpl-license.php
//
// **********************************************************************
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// **********************************************************************
//
// Forked WP Offload Media Lite (https://wordpress.org/plugins/amazon-s3-and-cloudfront/)
// which is a fork of Amazon S3 for WordPress with CloudFront (http://wordpress.org/extend/plugins/tantan-s3-cloudfront/)
// which is a fork of Amazon S3 for WordPress (http://wordpress.org/extend/plugins/tantan-s3/).
// Then partially rewritten to make it work for Aliyun OSS.
*/
$GLOBALS['aws_meta']['amazon-s3-and-cloudfront']['version'] = '1.0.3';
/**
* @throws Exception
*/
function as3cf_init() {
if ( class_exists( 'Amazon_S3_And_CloudFront' ) ) {
return;
}
global $as3cf;
$abspath = dirname( __FILE__ );
// Autoloader.
require_once $abspath . '/aliyun-oss-media-autoloader.php';
require_once $abspath . '/include/functions.php';
require_once $abspath . '/classes/as3cf-utils.php';
require_once $abspath . '/classes/as3cf-error.php';
require_once $abspath . '/classes/as3cf-filter.php';
require_once $abspath . '/classes/filters/as3cf-local-to-s3.php';
require_once $abspath . '/classes/filters/as3cf-s3-to-local.php';
require_once $abspath . '/classes/as3cf-notices.php';
require_once $abspath . '/classes/as3cf-plugin-base.php';
require_once $abspath . '/classes/as3cf-plugin-compatibility.php';
require_once $abspath . '/classes/amazon-s3-and-cloudfront.php';
new Aliyun_OSS_Media_Autoloader( 'Aliyun_OSS_Media', $abspath );
$as3cf = new Amazon_S3_And_CloudFront( __FILE__ );
do_action( 'as3cf_init', $as3cf );
}
add_action( 'init', 'as3cf_init' );
// If AWS still active need to be around to satisfy addon version checks until upgraded.
add_action( 'aws_init', 'as3cf_init', 11 );