if ( is_wp_error( $request ) ) { $res =
new WP_Error( 'translations_api_failed',
sprintf( /* translators: %s: Support forums URL. */
__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.'
),
__( 'https://wordpress.org/support/forums/'
) ),
$request->
get_error_message() );
} else { $res =
json_decode( wp_remote_retrieve_body( $request ), true
);
if ( !
is_object( $res ) && !
is_array( $res ) ) { $res =
new WP_Error( 'translations_api_failed',
sprintf( /* translators: %s: Support forums URL. */
__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.'
),
__( 'https://wordpress.org/support/forums/'
) ),
wp_remote_retrieve_body( $request ) );
} }