|null Associative array of JSON data on success, null on failure. */ function unpack_response_body( $response ): ?array { $body = wp_remote_retrieve_body( $response ); if ( $body ) { $json = json_decode( $body, true ); return is_array( $json ) ? $json : null; } return null; }