forked from wp-media/backwpup
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackwpup.php
More file actions
executable file
·71 lines (57 loc) · 2.23 KB
/
backwpup.php
File metadata and controls
executable file
·71 lines (57 loc) · 2.23 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
<?php
/*
* Plugin Name: BackWPup
* Plugin URI: https://backwpup.com/
* Description: WordPress Backup Plugin
* Author: BackWPup – WordPress Backup & Restore Plugin
* Author URI: https://backwpup.com
* Version: 5.4.0
* Requires at least: 4.9
* Requires PHP: 7.4
* Text Domain: backwpup
* Domain Path: /languages
* Network: true
* License: GPLv2+
*/
use WPMedia\BackWPup\Dependencies\League\Container\Container;
use WPMedia\BackWPup\Plugin\Plugin;
if ( defined( 'BACKWPUP_PLUGIN_LOADED' ) || class_exists( \BackWPup::class, false ) ) {
return;
}
define( 'BACKWPUP_PLUGIN_FILE', __FILE__ );
define( 'BACKWPUP_PLUGIN_LOADED', true );
// Include the Composer autoload file.
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
require_once __DIR__ . '/vendor/autoload.php';
}
require_once __DIR__ . '/inc/functions.php';
require_once __DIR__ . '/src/compat.php';
$restore_commons = untrailingslashit( BackWPup::get_plugin_data( 'plugindir' ) ) . '/src/Infrastructure/Restore/commons.php';
if ( $restore_commons ) {
require_once $restore_commons;
}
require_once __DIR__ . '/inc/class-system-requirements.php';
require_once __DIR__ . '/inc/class-system-tests.php';
$system_requirements = new BackWPup_System_Requirements();
$system_tests = new BackWPup_System_Tests( $system_requirements );
// Don't activate on anything less than PHP 7.4 or WordPress 4.9.
if ( ! $system_tests->is_php_version_compatible() || ! $system_tests->is_wp_version_compatible() ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php'; // @phpstan-ignore-line
deactivate_plugins( __FILE__ );
exit(
sprintf(
// translators: %1$s is the minimum PHP version, %2$s is the minimum WordPress version.
esc_html__(
'BackWPup requires PHP version %1$s with spl extension or greater and WordPress %2$s or greater.',
'backwpup'
),
esc_html( $system_requirements->php_minimum_version() ),
esc_html( $system_requirements->wp_minimum_version() )
)
);
}
// Deactivation hook.
register_deactivation_hook( __FILE__, [ BackWPup_Install::class, 'deactivate' ] );
$backwpup_plugin = new Plugin( new Container(), __FILE__ );
add_action( 'init', [ $backwpup_plugin, 'load_plugin_textdomain' ] );
add_action( 'plugins_loaded', [ $backwpup_plugin, 'init' ], 11 );