Remove 'WooCommerce Addons Page' user-agent

This commit is contained in:
Bero 2022-04-08 13:25:01 +02:00
parent f7937593e9
commit 0ccf740ef6
1 changed files with 3 additions and 5 deletions

View File

@ -39,7 +39,6 @@ class WC_Admin_Addons {
'https://woocommerce.com/wp-json/wccom-extensions/1.0/featured', 'https://woocommerce.com/wp-json/wccom-extensions/1.0/featured',
array( array(
'headers' => $headers, 'headers' => $headers,
'user-agent' => 'WooCommerce Addons Page',
) )
); );
@ -83,7 +82,6 @@ class WC_Admin_Addons {
'https://woocommerce.com/wp-json/wccom-extensions/2.0/featured' . $parameter_string, 'https://woocommerce.com/wp-json/wccom-extensions/2.0/featured' . $parameter_string,
array( array(
'headers' => $headers, 'headers' => $headers,
'user-agent' => 'WooCommerce Addons Page',
) )
); );
@ -258,7 +256,7 @@ class WC_Admin_Addons {
if ( ! empty( $section->endpoint ) ) { if ( ! empty( $section->endpoint ) ) {
$section_data = get_transient( 'wc_addons_section_' . $section_id ); $section_data = get_transient( 'wc_addons_section_' . $section_id );
if ( false === $section_data ) { if ( false === $section_data ) {
$raw_section = wp_safe_remote_get( esc_url_raw( $section->endpoint ), array( 'user-agent' => 'WooCommerce Addons Page' ) ); $raw_section = wp_safe_remote_get( esc_url_raw( $section->endpoint ) );
if ( ! is_wp_error( $raw_section ) ) { if ( ! is_wp_error( $raw_section ) ) {
$section_data = json_decode( wp_remote_retrieve_body( $raw_section ) ); $section_data = json_decode( wp_remote_retrieve_body( $raw_section ) );