0 ) { $job = BackWPup_Option::get_job( $job_id ); if ( is_array( $job ) && ! empty( $job['ftpssh'] ) ) { $failure_destination = 'SFTP'; } } if ( 'SFTP' === $failure_destination ) { $storage_label = __( 'SFTP', 'backwpup' ); } elseif ( 'FOLDER' === $storage_code ) { $storage_label = __( 'Website Server', 'backwpup' ); } elseif ( isset( $registered_destinations[ $storage_code ]['info']['name'] ) ) { $storage_label = (string) $registered_destinations[ $storage_code ]['info']['name']; } else { $storage_label = ucwords( strtolower( str_replace( '_', ' ', $failure_destination ) ) ); } $failure_reason = isset( $backup['error_message'] ) ? trim( (string) $backup['error_message'] ) : ''; if ( '' !== $error_code ) { $container = wpm_apply_filters_typed( '?object', 'backwpup_container', null ); if ( $container ) { $display_details_resolver = $container->get( 'failure_display_details_resolver' ); if ( $display_details_resolver ) { $display_details = $display_details_resolver->resolve( $error_code, $failure_destination ); if ( ! empty( $display_details['label'] ) ) { $failure_reason = (string) $display_details['label']; } } } } if ( '' !== $failure_reason ) { /* translators: 1: storage label. 2: failure reason. */ $failure_message = sprintf( __( '%1$s backup failed – %2$s', 'backwpup' ), $storage_label, $failure_reason ); } else { /* translators: %s: storage label. */ $failure_message = sprintf( __( '%s backup failed', 'backwpup' ), $storage_label ); } } if ( $is_aborted ) { $failure_message = __( 'Aborted by user', 'backwpup' ); } if ( 'link' === $backup_trigger ) { $type_icon = 'link'; $type = __( 'Link', 'backwpup' ); } elseif( '' === $backup['type'] ) { $type_icon = 'user-settings'; $type = __( 'Manual', 'backwpup' ); } $actions = []; $view_log_action = []; if ( $can_view_logs && $backup_id > 0 ) { $view_log_action = [ "name" => __( "View log", 'backwpup' ), "icon" => "info", "trigger" => "load-and-open-modal", "display" => "backup-log", "dataset" => [ "data-block-name" => "modal/backup-log", "data-block-type" => "children", "data-backup-id" => $backup_id, "data-job-id" => $job_id, "data-modal-style" => $log_modal_style, ], ]; } if ( ( $is_failed || $is_aborted ) && $backup_id > 0 ) { if ( $view_log_action ) { $actions[] = $view_log_action; } $actions[] = [ "name" => __( "Delete", 'backwpup' ), "icon" => "trash", "trigger" => "load-and-open-modal", "display" => "delete-failed-backup", "dataset" => [ "data-block-name" => "modal/delete-failed-backup", "data-block-type" => "children", "data-backup-id" => $backup_id, ], ]; } else { if ( $view_log_action ) { $actions[] = $view_log_action; } //Add the download and restore action //If we can't restore the backup, we can't download it either. if (isset($backup['dataset-download'])) { $actions[] = ["name" => __("Download", 'backwpup'), "icon" => "download", "trigger" => $backup["download-trigger"], "dataset" => $backup['dataset-download']]; } if (isset($backup['dataset-restore'])) { $actions[] = ["name" => $backup['dataset-restore']['label'], "icon" => "restore", "trigger" => "open-modal", "display" => "restore-backup","dataset" => $backup['dataset-restore']]; } // Add the delete action if (isset($backup['dataset-delete'])) { $actions[] = [ "name" => __("Delete", 'backwpup'), "icon" => "trash", "trigger" => "open-modal", "display" => "delete-backup", "dataset" => $backup['dataset-delete'] ]; } } $delete_dataset = null; if ( ( $is_failed || $is_aborted ) && $backup_id > 0 ) { $delete_dataset = [ 'backup_id' => $backup_id ]; } elseif ( isset( $backup['dataset-delete'] ) ) { $delete_dataset = $backup['dataset-delete']; } // Start output buffering ob_start(); ?> 0 ) { echo ' data-backup-id="' . esc_attr( $backup_id ) . '"'; } ?>> "select_backup", "style" => "light", "trigger" => "select-backup", "data" => [ "delete" => wp_json_encode( $delete_dataset ), ] ]); ?>

at

$type, "icon_name" => $type_icon, "icon_size" => "large", "position" => "center", ]); ?>

(array) ( $backup['stored_on'] ?? [] ), "style" => "alt" ]); ?>

$is_aborted ? "alert" : "danger", "size" => "large", "position" => "top", ]); ?>

(array)$backup['stored_on'], "style" => "alt" ]); ?>

$label, "icon_name" => $icon, "icon_size" => "large", "position" => "center", ]); } ?>
"max-md:hidden", "actions" => $actions, ]); ?>