backup
Last commit date
config
10 months ago
languages
10 months ago
public
10 months ago
src
10 months ago
templates
10 months ago
README.txt
10 months ago
backup.php
10 months ago
backup.php
46 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Plugin Name: JetBackup |
| 4 | * Plugin URI: https://www.jetbackup.com/jetbackup-for-wordpress |
| 5 | * Description: JetBackup is the most complete WordPress site backup and restore plugin. We offer the easiest way to backup, restore or migrate your site. You can backup your files, database or both. |
| 6 | * Version: 3.1.12.3 |
| 7 | * Author: JetBackup |
| 8 | * Author URI: https://www.jetbackup.com/jetbackup-for-wordpress |
| 9 | * License: GPLv2 or later |
| 10 | * |
| 11 | */ |
| 12 | |
| 13 | use JetBackup\Entities\Util; |
| 14 | use JetBackup\Factory; |
| 15 | use JetBackup\JetBackup; |
| 16 | use JetBackup\Wordpress\Wordpress; |
| 17 | |
| 18 | if (!defined('WPINC')) die('Direct access is not allowed'); |
| 19 | |
| 20 | if(!defined('__JETBACKUP__')) define('__JETBACKUP__', true); |
| 21 | if(!defined('JB_ROOT')) define('JB_ROOT', dirname(__FILE__)); |
| 22 | if(!defined('WP_ROOT')) define('WP_ROOT', rtrim(ABSPATH, DIRECTORY_SEPARATOR)); |
| 23 | |
| 24 | require_once(JB_ROOT . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'JetBackup' . DIRECTORY_SEPARATOR . 'autoload.php'); |
| 25 | |
| 26 | // Installation procedures |
| 27 | register_activation_hook( __FILE__, ['\JetBackup\Wordpress\Installer', 'install']); |
| 28 | register_uninstall_hook( __FILE__, ['\JetBackup\Wordpress\Installer', 'uninstall']); |
| 29 | register_deactivation_hook( __FILE__, ['\JetBackup\Wordpress\Installer', 'deactivate']); |
| 30 | |
| 31 | add_action('init', ['\JetBackup\Wordpress\Init', 'actionInit']); |
| 32 | |
| 33 | // Anything after init will not check for user permissions ! |
| 34 | add_action('init', ['\JetBackup\Wordpress\Init', 'actionCLI']); |
| 35 | add_action('upgrader_process_complete', ['\JetBackup\Wordpress\Installer', 'update']); |
| 36 | add_filter('admin_body_class', ['\JetBackup\Wordpress\Init', 'filterAdminBodyClass']); |
| 37 | add_filter('admin_bar_menu', ['\JetBackup\Wordpress\UI', 'addTopMenuBarIntegration'], 100); |
| 38 | add_filter('plugin_action_links_backup/backup.php', ['\JetBackup\Wordpress\UI', 'addActionLinks']); |
| 39 | add_filter('plugin_row_meta', ['\JetBackup\Wordpress\UI', 'addRowMeta'], 10, 2); |
| 40 | |
| 41 | //WordPress will register the callback function in the database and will try to call it during uninstall |
| 42 | //At this point class doesn't exist anymore, so we have to use wrapper function |
| 43 | add_filter('site_transient_update_plugins', function($transient) { |
| 44 | if (!class_exists('\JetBackup\Wordpress\Update')) return $transient; |
| 45 | return \JetBackup\Wordpress\Update::check($transient); |
| 46 | }); |