-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcache-manager.php
54 lines (45 loc) · 1.2 KB
/
cache-manager.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
<?php
/**
* A WordPress plugin for managing Nginx fastcgi cache.
*
* @package cache-manager
*/
/**
* Plugin Name: Cache Manager
* Plugin URI: https://github.com/ssnepenthe/cache-manager
* Description: A WordPress plugin for managing Nginx fastcgi cache.
* Version: 0.3.0
* Author: Ryan McLaughlin
* Author URI: https://github.com/ssnepenthe
* License: GPL-2.0
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain:
* Domain Path:
*/
if ( ! defined( 'ABSPATH' ) ) {
die;
}
/**
* Require a given file once if it exists.
*
* @param string $file File to check existence of and require.
*
* @return void
*/
function _cm_require_if_exists( $file ) {
if ( file_exists( $file ) ) {
require_once $file;
}
}
$cm_dir = plugin_dir_path( __FILE__ );
_cm_require_if_exists( $cm_dir . 'vendor/autoload.php' );
$cm_checker = new WP_Requirements\Plugin_Checker( 'Cache Manager', __FILE__ );
$cm_checker->php_at_least( '5.4' );
if ( $cm_checker->requirements_met() ) {
require_once $cm_dir . 'inc/debug.php';
require_once $cm_dir . 'inc/functions.php';
add_action( 'plugins_loaded', 'Cache_Manager\\initialize' );
} else {
$cm_checker->deactivate_and_notify();
}
unset( $cm_checker, $cm_dir );