. * * Attribution: This code is part of the All-in-One WP Migration plugin, developed by * * ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗ * ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝ * ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝ * ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗ * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗ * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ */ if ( ! defined( 'ABSPATH' ) ) { die( 'Kangaroos cannot jump here' ); } class Ai1wm_Status { /** * @var string|null */ public static $job_id = null; public static function error( $title, $message ) { self::log( array( 'type' => 'error', 'title' => $title, 'message' => $message ) ); } public static function left_error( $title, $message ) { self::log( array( 'type' => 'error', 'title' => $title, 'message' => $message, 'leftAligned' => true ) ); } public static function info( $message ) { self::log( array( 'type' => 'info', 'message' => $message ) ); } public static function download( $message ) { self::log( array( 'type' => 'download', 'message' => $message ) ); } public static function disk_space_confirm( $message ) { self::log( array( 'type' => 'disk_space_confirm', 'message' => $message ) ); } public static function confirm( $message ) { self::log( array( 'type' => 'confirm', 'message' => $message ) ); } public static function done( $title, $message = null ) { self::log( array( 'type' => 'done', 'title' => $title, 'message' => $message ) ); } public static function blogs( $title, $message ) { self::log( array( 'type' => 'blogs', 'title' => $title, 'message' => $message ) ); } public static function progress( $percent ) { self::log( array( 'type' => 'progress', 'percent' => $percent ) ); } public static function backup_is_encrypted( $error ) { self::log( array( 'type' => 'backup_is_encrypted', 'error' => $error ) ); } public static function server_cannot_decrypt( $message ) { self::log( array( 'type' => 'server_cannot_decrypt', 'message' => $message ) ); } public static function log( $data ) { global $ai1wm_params; // Job-scoped write (when job_id is set, e.g. REST API or any pipeline with storage) if ( self::$job_id !== null ) { $job_data = $data; if ( isset( $ai1wm_params['archive'] ) ) { $job_data['archive'] = $ai1wm_params['archive']; } update_option( 'ai1wm_status_' . self::$job_id, $job_data, false ); } // Global write (only for non-scheduled, preserves existing browser UI behavior) if ( ! ai1wm_is_scheduled_backup() ) { update_option( AI1WM_STATUS, $data ); } } }