$custom_replacements Rules for the database, already checked. * * @throws HttpException With a message fit to show the person. */ public static function start( string $key, int $user_id, JobStore $store, array $custom_replacements = array() ): JobState { $parsed = ConnectionKey::decode( $key ); if ( null === $parsed ) { throw new HttpException( 'om_remote_key', esc_html__( 'That connection key is not valid. Copy it again, in full, from the source site.', 'migratex' ), 400 ); } if ( time() > $parsed['created'] + Auth::TTL ) { throw new HttpException( 'om_remote_expired', esc_html__( 'That connection key has expired. Generate a new one on the source site.', 'migratex' ), 410 ); } // Both ends must be HTTPS (a development host excepted). foreach ( array( $parsed['url'], home_url() ) as $address ) { $reason = Transport::insecureReason( $address ); if ( null !== $reason ) { throw new HttpException( 'om_remote_insecure', esc_html( $reason ), 400 ); } } if ( untrailingslashit( $parsed['url'] ) === untrailingslashit( home_url() ) ) { throw new HttpException( 'om_remote_self', esc_html__( 'That key was made on this site. Paste the key from the other site.', 'migratex' ), 400 ); } if ( null !== $store->findActive( 'import', $user_id ) ) { throw new HttpException( 'om_import_active', esc_html__( 'An import is already in progress. Cancel it before starting another.', 'migratex' ), 409 ); } $chunk_max = Environment::remoteChunkMax(); // the largest piece this server will take; a current source may send smaller ones. $legacy = false; $response = self::handshakeRequest( $parsed, $chunk_max, false ); // A source on an older version cannot verify the newer handshake (it signs a different set of fields), // so it answers with MigrateX's own 403. Try once more the way that version expects. This keeps // every check: the request is still signed with the key's secret and the response still verified, and // the pieces are the older, smaller ones. Anything other than that one refusal (a firewall's page, a // network error, a different status) is not retried: it would not be a version problem. if ( self::isOwnDenial( $response ) ) { $second = self::handshakeRequest( $parsed, $chunk_max, true ); if ( ! is_wp_error( $second ) && 200 === (int) wp_remote_retrieve_response_code( $second ) ) { $response = $second; $legacy = true; } } $meta = self::handshakeData( $response, $parsed, $chunk_max, $legacy ); $free = Environment::freeDiskSpace( Paths::jobs() ); if ( null !== $free && $free < $meta['size'] * 2.5 ) { throw new HttpException( 'om_disk_full', esc_html__( 'Not enough free disk space to restore this backup.', 'migratex' ), 507 ); } $job = $store->create( 'import', $user_id, array( 'filename' => $meta['name'], 'size' => $meta['size'], 'total_chunks' => $meta['total_chunks'], 'chunk_size' => $meta['chunk_size'], 'remote_url' => $parsed['url'], 'remote_id' => $parsed['id'], 'remote_secret' => $parsed['secret'], 'remote_proto' => $meta['proto'], 'custom_replacements' => $custom_replacements, ) ); $job->setDetail( array( 'chunks' => 0, 'total_chunks' => $meta['total_chunks'], 'remote' => true, ) ); $store->save( $job ); if ( $legacy ) { Logger::log( $job->id(), 'The source site runs an older MigrateX (chunk protocol ' . $meta['proto'] . '): using its ' . round( $meta['chunk_size'] / 1048576, 1 ) . ' MB pieces.' ); } return $job; } /** * One tick of the pull: fetches chunks until the tick's time is spent. */ public static function step( JobState $job, Budget $budget ): StageResult { $secret = (string) $job->get( 'remote_secret', '' ); if ( '' === $secret ) { return StageResult::fail( 'om_remote_gone', __( 'The connection to the source site was closed. Start the transfer again.', 'migratex' ) ); } $total = (int) $job->get( 'total_chunks', 0 ); $receiver = new ChunkReceiver( new JobStore( Paths::jobs() ) ); while ( ! $budget->exhausted() ) { $index = strpos( str_pad( (string) $job->cursor( 'map', '' ), $total, '0' ), '0' ); if ( false === $index ) { return self::complete( $job ); } $error = self::fetchChunk( $job, $receiver, (int) $index, $total, $secret ); if ( null !== $error ) { if ( $error['fatal'] ) { return StageResult::fail( $error['code'], $error['message'] ); } $failures = (int) $job->cursor( 'fails', 0 ) + 1; $job->setCursor( 'fails', $failures ); $job->setCursor( 'last_error', $error['message'] ); // Shown under the progress bar while it retries, so a stall is visible and explained. $job->setDetail( array( 'chunks' => substr_count( str_pad( (string) $job->cursor( 'map', '' ), $total, '0' ), '1' ), 'total_chunks' => $total, 'remote' => true, 'problem' => $error['message'], 'attempt' => $failures, ) ); Logger::log( $job->id(), sprintf( 'Chunk %d: %s (attempt %d of %d)', $index, $error['message'], $failures, self::MAX_FAILURES ) ); if ( $failures >= self::MAX_FAILURES ) { return StageResult::fail( 'om_remote_unreachable', sprintf( /* translators: 1: number of attempts, 2: what went wrong */ __( 'The source site stopped answering after %1$d attempts. The last problem was: %2$s', 'migratex' ), $failures, $error['message'] ) ); } $budget->endTick(); return StageResult::more( self::BACKOFF[ min( $failures, count( self::BACKOFF ) ) - 1 ] * 1000 ); // wait, then try this chunk again. } $job->setCursor( 'fails', 0 ); $budget->unit(); } return false === strpos( str_pad( (string) $job->cursor( 'map', '' ), $total, '0' ), '0' ) ? self::complete( $job ) : StageResult::more(); } /** * Tells the source the key is no longer needed, and forgets the secret. Runs when the job fails or is * cancelled; the source then deletes its key at once instead of waiting for it to expire. */ public static function abort( JobState $job ): void { if ( '' === (string) $job->get( 'remote_secret', '' ) ) { return; } self::notifyFinish( $job, 'error' ); $job->set( 'remote_secret', '' ); } /** * Every chunk is here: the transfer is over, so the key has done its job. */ private static function complete( JobState $job ): StageResult { self::notifyFinish( $job, 'complete' ); $job->set( 'remote_secret', '' ); return StageResult::next(); } /** * @return array{fatal:bool,code:string,message:string}|null Null when the chunk was fetched and stored. */ private static function fetchChunk( JobState $job, ChunkReceiver $receiver, int $index, int $total, string $secret ): ?array { $url = (string) $job->get( 'remote_url' ); $id = (string) $job->get( 'remote_id' ); $now = time(); $response = self::request( 'GET', self::endpoint( $url, 'chunk' ) . '&index=' . $index, array( 'timeout' => self::CHUNK_TIMEOUT, 'headers' => array( 'X-OM-Key-Id' => $id, 'X-OM-Timestamp' => (string) $now, 'X-OM-Signature' => Auth::sign( $secret, 'chunk', $id, $now, array( (string) $index ) ), 'Accept' => 'application/octet-stream', 'Accept-Encoding' => 'identity', ), ), $url ); if ( is_wp_error( $response ) ) { return self::problem( false, 'om_remote_http', self::networkProblem( $response->get_error_message() ) ); } $code = (int) wp_remote_retrieve_response_code( $response ); if ( 403 === $code ) { return self::problem( true, 'om_remote_denied', self::denialMessage( $response ) ); } if ( 404 === $code || 410 === $code ) { return self::problem( true, 'om_remote_unavailable', __( 'The backup on the source site is no longer available.', 'migratex' ) ); } if ( 200 !== $code ) { return self::problem( false, 'om_remote_http', self::httpProblem( $code, $response ) ); } $raw = self::plainBody( $response ); if ( null === $raw ) { return self::problem( false, 'om_remote_encoding', __( 'The source site (or a proxy in front of it) compressed the chunk in a way this server cannot undo. Turn off compression for /wp-json/migratex/ on the source.', 'migratex' ) ); } if ( 1 === (int) $job->get( 'remote_proto', 2 ) ) { // An older source: the chunk's hash and signature are in the response headers, over the plain bytes. $hash = strtolower( (string) wp_remote_retrieve_header( $response, 'x-om-chunk-hash' ) ); $sig = strtolower( (string) wp_remote_retrieve_header( $response, 'x-om-chunk-signature' ) ); $body = $raw; $expected = RemoteStreamController::chunkSignature( $secret, $id, $index, $total, $hash, strlen( $body ) ); if ( 1 !== preg_match( '/^[a-f0-9]{64}$/', $hash ) || ! hash_equals( $expected, $sig ) ) { return self::problem( false, 'om_remote_signature', __( 'A chunk failed its signature check: something between the two sites (a proxy, CDN or security plugin) changed the response. Updating MigrateX on both sites makes the transfer robust against this.', 'migratex' ) ); } } else { // Everything the chunk needs travels inside it, so stray text before it, or headers lost on the way, do not matter. $frame = RemoteStreamController::unframe( $raw ); if ( null === $frame ) { return self::problem( false, 'om_remote_frame', sprintf( /* translators: %s: the start of what was received */ __( 'The reply was not an MigrateX chunk: it may have been cut short, compressed, replaced by a page from a security plugin or firewall, or the source site runs an older MigrateX (both sites need the same version). It begins: %s', 'migratex' ), self::peek( $raw ) ) ); } $hash = $frame['hash']; $body = $frame['payload']; // The source's own signature over this chunk: it came from the holder of the key and was not altered. $expected = RemoteStreamController::chunkSignature( $secret, $id, $index, $total, $hash, $frame['length'] ); if ( $frame['index'] !== $index || $frame['total'] !== $total || 1 !== preg_match( '/^[a-f0-9]{64}$/', $hash ) || ! hash_equals( $expected, $frame['signature'] ) ) { return self::problem( false, 'om_remote_signature', __( 'A chunk failed its signature check: it is not the chunk that was asked for, or something between the two sites changed it.', 'migratex' ) ); } } try { $receiver->accept( $job, $index, $total, $hash, $body ); } catch ( HttpException $e ) { // A damaged chunk is simply fetched again; anything else (disk full, wrong layout) is final. return self::problem( 422 !== $e->status(), $e->errorCode(), $e->getMessage() ); } return null; } /** * Sends the handshake. The current form also states the largest piece this server will take, and signs * it; the older form signs only the site address, as earlier versions of the source expect. * * @param array{url:string,id:string,secret:string,created:int} $key * @return array|\WP_Error */ private static function handshakeRequest( array $key, int $chunk_max, bool $legacy ) { $now = time(); $parts = $legacy ? array( home_url() ) : array( home_url(), (string) $chunk_max ); $body = array( 'key_id' => $key['id'], 'timestamp' => $now, 'signature' => Auth::sign( $key['secret'], 'handshake', $key['id'], $now, $parts ), 'site' => home_url(), ); if ( ! $legacy ) { $body['chunk_max'] = $chunk_max; } return self::request( 'POST', self::endpoint( $key['url'], 'handshake' ), array( 'timeout' => 30, 'body' => $body ), $key['url'] ); } /** * Whether a response is MigrateX's own "request denied" (403 with its error code), as opposed to a * firewall's page or anything else. * * @param array|\WP_Error $response */ private static function isOwnDenial( $response ): bool { if ( is_wp_error( $response ) || 403 !== (int) wp_remote_retrieve_response_code( $response ) ) { return false; } $body = json_decode( (string) wp_remote_retrieve_body( $response ), true ); return is_array( $body ) && 'om_remote_denied' === ( $body['code'] ?? '' ); } /** * The handshake's answer, checked field by field. The numbers are signed by the source, so a middleman * cannot change the size or chunk layout. * * @param array|\WP_Error $response * @param array{url:string,id:string,secret:string,created:int} $key * @param int $chunk_max The largest piece this server asked for. * @param bool $legacy The source answered the older handshake: no format number is required of it, and its pieces are at most the older 5 MB. * @return array{name:string,size:int,chunk_size:int,total_chunks:int,proto:int} * @throws HttpException */ private static function handshakeData( $response, array $key, int $chunk_max, bool $legacy ): array { if ( is_wp_error( $response ) ) { throw new HttpException( 'om_remote_http', esc_html( sprintf( /* translators: %s: error */ __( 'Could not reach the source site: %s', 'migratex' ), $response->get_error_message() ) ), 502 ); } $code = (int) wp_remote_retrieve_response_code( $response ); if ( 403 === $code ) { throw new HttpException( 'om_remote_denied', esc_html( self::denialMessage( $response ) ), 403 ); } $data = json_decode( (string) wp_remote_retrieve_body( $response ), true ); $data = is_array( $data ) && is_array( $data['data'] ?? null ) ? $data['data'] : null; if ( 200 !== $code || null === $data ) { throw new HttpException( 'om_remote_http', esc_html__( 'The source site did not answer as expected. Is MigrateX active there, and is its REST API reachable?', 'migratex' ), 502 ); } // The chunk format the source speaks: 2 = chunks in a self-describing frame; 1 (announced or, from the // oldest versions, simply absent) = hash and signature in response headers. A current handshake // needs a current source. $announced = $data['proto'] ?? null; $proto = null === $announced ? 1 : $announced; if ( ! $legacy ? RemoteStreamController::PROTOCOL !== $proto : ! in_array( $proto, array( 1, RemoteStreamController::PROTOCOL ), true ) ) { throw new HttpException( 'om_remote_version', esc_html__( 'The two sites run different versions of MigrateX. Install the same (latest) version on both, then try again.', 'migratex' ), 409 ); } $name = is_string( $data['name'] ?? null ) ? $data['name'] : ''; $size = is_int( $data['size'] ?? null ) ? $data['size'] : 0; $chunk = is_int( $data['chunk_size'] ?? null ) ? $data['chunk_size'] : 0; $total = is_int( $data['total_chunks'] ?? null ) ? $data['total_chunks'] : 0; $sig = is_string( $data['signature'] ?? null ) ? $data['signature'] : ''; // How big a piece may be: never more than this server asked to receive; an older source cannot be asked, // and never sent more than 5 MB. $cap = $legacy ? 5242880 : min( 16777216, $chunk_max ); $valid = 1 === preg_match( '/^[A-Za-z0-9._-]{1,200}\.' . preg_quote( MIGRATEX_ARCHIVE_EXT, '/' ) . '$/', $name ) && false === strpos( $name, '..' ) && $size > 0 && $chunk >= 65536 && $chunk <= $cap && ceil( $size / $chunk ) === (float) $total; // What the source signed: the oldest versions did not include a format number. $fields = null === $announced ? array( 'meta', $key['id'], $name, (string) $size, (string) $chunk, (string) $total ) : array( 'meta', $key['id'], (string) $proto, $name, (string) $size, (string) $chunk, (string) $total ); $expected = hash_hmac( 'sha256', implode( "\n", $fields ), (string) hex2bin( $key['secret'] ) ); if ( ! $valid || ! hash_equals( $expected, $sig ) ) { throw new HttpException( 'om_remote_http', esc_html__( 'The source site sent a response that could not be verified, so the connection was dropped.', 'migratex' ), 502 ); } return array( 'name' => $name, 'size' => $size, 'chunk_size' => $chunk, 'total_chunks' => $total, 'proto' => $proto, ); } /** * What a 403 from the source means. MigrateX's own refusal is a small JSON error with a known code; * anything else (an HTML page, no code) came from something in front of WordPress, such as a firewall * or bot-protection rule, and no key can fix that. * * @param array $response */ private static function denialMessage( array $response ): string { $body = json_decode( (string) wp_remote_retrieve_body( $response ), true ); if ( is_array( $body ) && 'om_remote_denied' === ( $body['code'] ?? '' ) ) { $data = is_array( $body['data'] ?? null ) ? $body['data'] : array(); if ( 'ip_mismatch' === ( $data['reason'] ?? '' ) && is_string( $data['ip'] ?? null ) && is_string( $data['pinned'] ?? null ) ) { return sprintf( /* translators: 1: the address the source now sees, 2: the address it saw at the handshake (last part hidden) */ __( 'The source site refused the request because it now sees this server at a different address (%1$s) than when the connection was made (%2$s). This key was locked to one address, which fails when a connection changes address (mobile or shared internet, several lines, IPv4 and IPv6). Generate a new key on the source site without the "Lock the key to the other site\'s address" box ticked, and make sure MIGRATEX_ENABLE_IP_PINNING is not set there.', 'migratex' ), $data['ip'], $data['pinned'] ); } return __( 'The source site refused the request. The key has expired or been revoked, or this server is not the one that connected. The Site-to-Site screen on the source site shows why the last request was refused.', 'migratex' ); } return __( 'A firewall or security rule on the source site (for example Cloudflare bot protection) blocked the request before it reached MigrateX. Allow requests to /?rest_route=/migratex/v1/remote/ (or /wp-json/migratex/v1/remote/) from this server, then try again.', 'migratex' ); } /** * A failed connection in words a person can act on, with the library's own message kept at the end. */ private static function networkProblem( string $message ): string { $lower = strtolower( $message ); if ( false !== strpos( $lower, 'timed out' ) || false !== strpos( $lower, 'timeout' ) || false !== strpos( $lower, 'error 28' ) ) { /* translators: %s: technical message */ return sprintf( __( 'The connection timed out: the source site, or a proxy in front of it, took too long or cut it off (%s).', 'migratex' ), $message ); } if ( false !== strpos( $lower, 'ssl' ) || false !== strpos( $lower, 'certificate' ) ) { /* translators: %s: technical message */ return sprintf( __( 'A secure connection to the source site could not be made (%s).', 'migratex' ), $message ); } if ( false !== strpos( $lower, 'resolve' ) || false !== strpos( $lower, 'valid url' ) ) { /* translators: %s: technical message */ return sprintf( __( 'This server could not find or may not connect to the source site (%s).', 'migratex' ), $message ); } /* translators: %s: technical message */ return sprintf( __( 'The connection failed (%s).', 'migratex' ), $message ); } /** * A non-200 answer: the status, what kind it is, and a few words of the page if it is HTML (a CDN's * error page says what happened). * * @param array $response */ private static function httpProblem( int $code, array $response ): string { $body = (string) wp_remote_retrieve_body( $response ); $snippet = trim( (string) preg_replace( '/\s+/', ' ', wp_strip_all_tags( substr( $body, 0, 1500 ) ) ) ); $snippet = '' === $snippet ? '' : ' "' . substr( $snippet, 0, 120 ) . '"'; if ( $code >= 520 && $code <= 530 ) { /* translators: 1: HTTP status, 2: page text */ return sprintf( __( 'Cloudflare reported an error reaching the source site (HTTP %1$d)%2$s.', 'migratex' ), $code, $snippet ); } if ( 429 === $code ) { /* translators: %s: page text */ return sprintf( __( 'The source site is limiting requests (HTTP 429)%s. Wait a moment or relax its rate limit.', 'migratex' ), $snippet ); } if ( $code >= 500 ) { /* translators: 1: HTTP status, 2: page text */ return sprintf( __( 'The source site or its host returned a server error (HTTP %1$d)%2$s.', 'migratex' ), $code, $snippet ); } /* translators: 1: HTTP status, 2: page text */ return sprintf( __( 'The source site answered with an unexpected status (HTTP %1$d)%2$s.', 'migratex' ), $code, $snippet ); } /** * The response body with any transport compression undone. A server is asked not to compress, but one * that does anyway (the header says so) is decoded rather than failed, since the signature is over the * plain bytes. * * @param array $response */ private static function plainBody( array $response ): ?string { $body = (string) wp_remote_retrieve_body( $response ); $encoding = strtolower( trim( (string) wp_remote_retrieve_header( $response, 'content-encoding' ) ) ); if ( '' === $encoding || 'identity' === $encoding ) { return $body; } if ( in_array( $encoding, array( 'gzip', 'x-gzip' ), true ) && function_exists( 'gzdecode' ) ) { // A real gzip body starts with 1f 8b. Anything else was already inflated by the HTTP library, // which leaves the header as it was. if ( "\x1f\x8b" !== substr( $body, 0, 2 ) ) { return $body; } $plain = @gzdecode( $body ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged -- a failure is handled below. return false === $plain ? null : (string) $plain; } if ( 'deflate' === $encoding && function_exists( 'gzinflate' ) ) { $plain = @gzinflate( $body ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged if ( false === $plain && function_exists( 'gzuncompress' ) ) { $plain = @gzuncompress( $body ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged -- "deflate" is sometimes zlib-wrapped. } if ( false !== $plain ) { return (string) $plain; } // Not deflate data after all: if it is a chunk as it stands, the library had already inflated it. return false !== strpos( substr( $body, 0, 65536 ), RemoteStreamController::FRAME_MAGIC ) ? $body : null; } return null; // an encoding this server cannot undo (brotli, zstd). } /** * The first few printable characters of a reply, for an error message. */ private static function peek( string $body ): string { $head = substr( $body, 0, 400 ); $odd = strlen( (string) preg_replace( '/[^\x00-\x08\x0E-\x1F\x7F-\xFF]/', '', $head ) ); // how many bytes are not text if ( '' !== $head && $odd / strlen( $head ) > 0.15 ) { return __( '(binary data)', 'migratex' ); } $text = trim( (string) preg_replace( '/\s+/', ' ', wp_strip_all_tags( (string) preg_replace( '/[^\x20-\x7E\r\n\t]/', '', substr( $body, 0, 400 ) ) ) ) ); return '' === $text ? __( '(binary data)', 'migratex' ) : '"' . substr( $text, 0, 100 ) . '"'; } private static function notifyFinish( JobState $job, string $status ): void { $url = (string) $job->get( 'remote_url' ); $id = (string) $job->get( 'remote_id' ); $secret = (string) $job->get( 'remote_secret' ); if ( '' === $url || '' === $secret ) { return; } $now = time(); self::request( 'POST', self::endpoint( $url, 'finish' ), array( 'timeout' => 10, 'headers' => array( 'X-OM-Key-Id' => $id, 'X-OM-Timestamp' => (string) $now, 'X-OM-Signature' => Auth::sign( $secret, 'finish', $id, $now, array( $status ) ), ), 'body' => array( 'status' => $status ), ), $url ); // best effort: the key expires by itself within 30 minutes anyway. } /** * The REST route on the source, by ?rest_route= so it works with or without pretty permalinks. */ private static function endpoint( string $site_url, string $route ): string { return untrailingslashit( $site_url ) . '/?rest_route=/' . MIGRATEX_REST_NAMESPACE . '/remote/' . $route; } /** * wp_safe_remote_* refuses private and loopback addresses and odd ports, which is what a production * site wants when a pasted key could otherwise aim this server at its own network. Two development * sites (localhost, *.test, *.local) talk to each other on exactly such addresses, so that pair, and * only that pair, uses the plain functions. * * @param array $args * @return array|\WP_Error */ private static function request( string $method, string $url, array $args, string $site_url ) { $args = array_merge( array( 'redirection' => 0, // a redirect could carry the signed request somewhere else. 'decompress' => false, 'sslverify' => true, // A plain, honest identity: web application firewalls tend to challenge or drop requests that // arrive with no recognisable agent. This one names the plugin and the site asking. 'user-agent' => 'MigrateX/' . ( defined( 'MIGRATEX_VERSION' ) ? MIGRATEX_VERSION : 'dev' ) . '; site-to-site; ' . home_url(), ), $args ); // The source pins the address it sees at the handshake. A server that can use both IPv4 and IPv6 may // reach the same site over one and then the other, and would be refused as a stranger, so stay on IPv4 // (the migratex_remote_force_ipv4 filter turns this off for a source that is IPv6 only). $ipv4 = static function ( $handle ): void { if ( function_exists( 'curl_setopt' ) && defined( 'CURLOPT_IPRESOLVE' ) && defined( 'CURL_IPRESOLVE_V4' ) && ( is_resource( $handle ) || is_object( $handle ) ) ) { curl_setopt( $handle, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); // phpcs:ignore WordPress.WP.AlternativeFunctions.curl_curl_setopt -- the HTTP API's own cURL handle, one option. } }; $force = (bool) apply_filters( 'migratex_remote_force_ipv4', true ); if ( $force ) { add_action( 'http_api_curl', $ipv4 ); } try { if ( Transport::mayReachLocal( $site_url ) ) { return 'GET' === $method ? wp_remote_get( $url, $args ) : wp_remote_post( $url, $args ); } return 'GET' === $method ? wp_safe_remote_get( $url, $args ) : wp_safe_remote_post( $url, $args ); } finally { if ( $force ) { remove_action( 'http_api_curl', $ipv4 ); } } } /** * @return array{fatal:bool,code:string,message:string} */ private static function problem( bool $fatal, string $code, string $message ): array { return array( 'fatal' => $fatal, 'code' => $code, 'message' => $message, ); } }