-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.php
More file actions
49 lines (41 loc) · 1.53 KB
/
plugin.php
File metadata and controls
49 lines (41 loc) · 1.53 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
<?php
/**
* Plugin Name: VP Backup
* Plugin URI: http://www.volcanicpixels.com/wordpress-backup
* Description: The easiest way to keep your WordPress site backed up.
* Author: Volcanic Pixels
* Author URI: http://www.volcanicpixls.com
* Version 0.0.0
*/
$required_php_version = '5.2.4';
$required_wp_version = '3.2';
// Registers the autoloader that will load all classes as they are needed
require_once( dirname(__FILE__) . '/autoloader.php' );
require_once( dirname(__FILE__) . '/vendor/autoloader.php' );
VPBackup_Autoloader::register();
// Check if PHP and WordPress versions satisfy requirements.
// If they don't then refuse to activate and give a helpful error message
$php_too_old = version_compare( PHP_VERSION, $required_php_version, '<');
$wp_too_old = version_compare( get_bloginfo( 'version' ), $required_wp_version, '<');
if ($php_too_old || $wp_too_old) {
require_once( ABSPATH . WPINC . 'plugin.php');
deactivate_plugins( basename( __FILE__ ) );
if (isset( $_GET['action'])
&& ($_GET['action'] == 'activate' || $_GET['action'] == 'error_scrape' )
) {
die(
printf(
__(
'VP Backup requires PHP version %s or greater and WordPress version %s or greater',
'vpbackup'
),
$required_php_version,
$required_wp_version
)
);
}
}
// Load plugin using singleton
if (function_exists('add_action')) {
add_action('plugins_loaded', array('VPBackup', 'getPlugin'));
}