*/ protected function input_properties(): array { return array( ); } /** * @since 0.0.35 * @return array */ protected function required_input(): array { return array(); } /** * @since 0.0.35 * @return array */ protected function output_properties(): array { return array( 'backup_count' => array( 'type' => 'integer' ), 'last_backup_time' => array( 'type' => array( 'integer', 'null' ) ), 'last_backup_gmt' => array( 'type' => array( 'string', 'null' ) ), 'last_backup_age' => array( 'type' => array( 'string', 'null' ) ), 'last_backup_result' => array( 'type' => array( 'boolean', 'null' ), 'description' => __( 'Whether the last run succeeded. Null when the plugin records no outcome, which is not the same as a failure.', 'acrossai-abilities-manager' ), ), 'last_backup_errors' => array( 'type' => 'array', 'items' => array( 'type' => 'string' ) ), 'running' => array( 'type' => 'boolean' ), 'schedules' => array( 'type' => 'array', 'items' => array( 'type' => 'object', 'additionalProperties' => true ), ), 'retention' => array( 'type' => array( 'object', 'array' ), 'additionalProperties' => true ), 'remote_storage' => array( 'type' => 'array', 'items' => array( 'type' => 'string' ), 'description' => __( 'Destination names only. Their credentials are never read.', 'acrossai-abilities-manager' ), ), 'storage_path' => array( 'type' => 'string' ), 'any_backup' => array( 'type' => 'boolean' ), 'note' => array( 'type' => 'string' ), ); } /** * @since 0.0.35 * @return array */ protected function annotations(): array { return array( 'readonly' => true, 'destructive' => false, 'idempotent' => true, ); } /** * @since 0.0.35 * @param array $input Input. * @return array|WP_Error */ protected function run( array $input ) { unset( $input ); $status = Backup_Repository::status(); $status['any_backup'] = ! empty( $status['backup_count'] ); $status['note'] = empty( $status['backup_count'] ) ? __( 'UpdraftPlus is active but has never produced a backup set, so there is nothing to restore from. Take one with updraftplus/start-backup before making changes that would be hard to undo.', 'acrossai-abilities-manager' ) : ''; return $status; } }