protected function get_parsed_response( $raw_body ) {

		$json_start = strpos( $raw_body, '{' );
		$json_end = strrpos( $raw_body, '}' ) + 1; // inclusive

		$json = substr( $raw_body, $json_start, ( $json_end - $json_start ) );

		return json_decode( $json, $this->json_decode_as_array );
	}
protected function get_parsed_response( $raw_body ) {

		$json_start = strpos( $raw_body, '{' );
		$json_end = strrpos( $raw_body, '}' ) + 1; // inclusive

		$json = substr( $raw_body, $json_start, ( $json_end - $json_start ) );

		return json_decode( $json, $this->json_decode_as_array );
	}
protected function get_parsed_response ( $ raw_body ) { $ json_start = strpos ( $ raw_body , '{' ) ; $ json_end = strrpos ( $ raw_body , '}' ) + 1 ; // inclusive $ json = substr ( $ raw_body , $ json_start , ( $ json_end - $ json_start ) ) ; return json_decode ( $ json , $ this -> json_decode_as_array ) ; }
JSON decode the response body after stripping any invalid leading or
trailing characters.

Plugins (looking at you WP Super Cache) or themes
can add output to the returned JSON which breaks decoding.

@since 2.0
@param string $raw_body raw response body
@return object|array JSON decoded response body
JSON decode the response body after stripping any invalid leading or trailing characters .