*/ 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 = Archive_Repository::status(); $status['any_backup'] = ! empty( $status['backup_count'] ); // status() already explains what this plugin does not record. Append rather than replace: // "no archive exists" and "no outcome is stored for the archives that do" are both true and // are different pieces of news. $existing = isset( $status['note'] ) ? (string) $status['note'] : ''; $status['note'] = empty( $status['backup_count'] ) ? trim( __( 'All-in-One WP Migration is active but holds no archive, so there is nothing to restore from. Take one with all-in-one/start-export before making changes that would be hard to undo.', 'acrossai-abilities-manager' ) . ' ' . $existing ) : $existing; return $status; } }