do_credentials_test(UpdraftPlus_Manipulation_Functions::wp_unslash($_POST)); } elseif ('poplog' == $_REQUEST['subaction']) { echo json_encode($updraftplus_admin->fetch_log($_REQUEST['backup_nonce'])); } elseif ('sid_reset' == $_REQUEST['subaction']) { delete_site_option('updraftplus-addons_siteid'); echo json_encode(array('newsid' => $updraftplus->siteid())); } elseif ('countbackups' == $_REQUEST['subaction']) { $backup_history = UpdraftPlus_Backup_History::get_history(); echo __('Existing Backups', 'updraftplus').' ('.count($backup_history).')'; } elseif ('historystatus' == $subaction) { $remotescan = !empty($_GET['remotescan']); $rescan = ($remotescan || !empty($_GET['rescan'])); $history_status = $updraftplus_admin->get_history_status($rescan, $remotescan); echo @json_encode($history_status); } elseif ('diskspaceused' == $subaction && isset($_GET['entity'])) { $entity = $_GET['entity']; // This can count either the size of the Updraft directory, or of the data to be backed up echo UpdraftPlus_Filesystem_Functions::get_disk_space_used($entity); } elseif ('callwpaction' == $subaction) { $updraftplus_admin->call_wp_action(UpdraftPlus_Manipulation_Functions::wp_unslash($_REQUEST), true); } elseif ('lastbackup' == $subaction) { echo $updraftplus_admin->last_backup_html(); }