private function normalize_parameters( $parameters ) {

		$normalized_parameters = array();

		foreach ( $parameters as $key => $value ) {

			// percent symbols (%) must be double-encoded
			$key   = str_replace( '%', '%25', rawurlencode( rawurldecode( $key ) ) );
			$value = str_replace( '%', '%25', rawurlencode( rawurldecode( $value ) ) );

			$normalized_parameters[ $key ] = $value;
		}

		return $normalized_parameters;
	}
private function normalize_parameters( $parameters ) {

		$normalized_parameters = array();

		foreach ( $parameters as $key => $value ) {

			// percent symbols (%) must be double-encoded
			$key   = str_replace( '%', '%25', rawurlencode( rawurldecode( $key ) ) );
			$value = str_replace( '%', '%25', rawurlencode( rawurldecode( $value ) ) );

			$normalized_parameters[ $key ] = $value;
		}

		return $normalized_parameters;
	}
private function normalize_parameters ( $ parameters ) { $ normalized_parameters = array ( ) ; foreach ( $ parameters as $ key => $ value ) { // percent symbols (%) must be double-encoded $ key = str_replace ( '%' , '%25' , rawurlencode ( rawurldecode ( $ key ) ) ) ; $ value = str_replace ( '%' , '%25' , rawurlencode ( rawurldecode ( $ value ) ) ) ; $ normalized_parameters [ $ key ] = $ value ; } return $ normalized_parameters ; }
Normalize each parameter by assuming each parameter may have already been
encoded, so attempt to decode, and then re-encode according to RFC 3986

Note both the key and value is normalized so a filter param like:

'filter[period]' => 'week'

is encoded to:

'filter%5Bperiod%5D' => 'week'

This conforms to the OAuth 1.0a spec which indicates the entire query string
should be URL encoded

Modeled after the core method here:

@link https://github.com/woothemes/woocommerce/blob/master/includes/api/class-wc-api-authentication.php#L254-L288

@since 2.0
@see rawurlencode()
@param array $parameters un-normalized pararmeters
@return array normalized parameters
Normalize each parameter by assuming each parameter may have already been encoded so attempt to decode and then re - encode according to RFC 3986