| 1 |
<?php |
| 2 |
|
| 3 |
if (!defined('UPDRAFTPLUS_DIR')) die('No direct access allowed'); |
| 4 |
|
| 5 |
/* |
| 6 |
These actions are no longer called, except in the case of someone restoring an old version of UD onto a new backend and not refreshing the page. We can keep them around a bit longer to handle that limited case. This generally means that they were replaced by calls to commands in the standardised UpdraftPlus_Commands class. |
| 7 |
|
| 8 |
These have been removed from admin.php as part of the process of removing them entirely. |
| 9 |
*/ |
| 10 |
|
| 11 |
global $updraftplus, $updraftplus_admin; |
| 12 |
|
| 13 |
if (isset($_POST['subaction']) && 'credentials_test' === $_POST['subaction']) { |
| 14 |
|
| 15 |
$updraftplus_admin->do_credentials_test(UpdraftPlus_Manipulation_Functions::wp_unslash($_POST)); |
| 16 |
|
| 17 |
} elseif ('poplog' == $_REQUEST['subaction']) { |
| 18 |
|
| 19 |
echo json_encode($updraftplus_admin->fetch_log($_REQUEST['backup_nonce'])); |
| 20 |
|
| 21 |
} elseif ('sid_reset' == $_REQUEST['subaction']) { |
| 22 |
|
| 23 |
delete_site_option('updraftplus-addons_siteid'); |
| 24 |
echo json_encode(array('newsid' => $updraftplus->siteid())); |
| 25 |
|
| 26 |
} elseif ('countbackups' == $_REQUEST['subaction']) { |
| 27 |
|
| 28 |
$backup_history = UpdraftPlus_Backup_History::get_history(); |
| 29 |
echo __('Existing Backups', 'updraftplus').' ('.count($backup_history).')'; |
| 30 |
|
| 31 |
} elseif ('historystatus' == $subaction) { |
| 32 |
|
| 33 |
$remotescan = !empty($_GET['remotescan']); |
| 34 |
$rescan = ($remotescan || !empty($_GET['rescan'])); |
| 35 |
|
| 36 |
$history_status = $updraftplus_admin->get_history_status($rescan, $remotescan); |
| 37 |
echo @json_encode($history_status); |
| 38 |
|
| 39 |
} elseif ('diskspaceused' == $subaction && isset($_GET['entity'])) { |
| 40 |
$entity = $_GET['entity']; |
| 41 |
// This can count either the size of the Updraft directory, or of the data to be backed up |
| 42 |
echo UpdraftPlus_Filesystem_Functions::get_disk_space_used($entity); |
| 43 |
} elseif ('callwpaction' == $subaction) { |
| 44 |
$updraftplus_admin->call_wp_action(UpdraftPlus_Manipulation_Functions::wp_unslash($_REQUEST), true); |
| 45 |
} elseif ('lastbackup' == $subaction) { |
| 46 |
echo $updraftplus_admin->last_backup_html(); |
| 47 |
} |
| 48 |
|