Standardise on performing api.WordPress.org requests over SSL when possible, falling back to non-SSL when appropriate.

This also standardises the `User-Agent` used when communicating with WordPress.org, allowing for more consistent version detection.

Fixes #42004.


git-svn-id: https://develop.svn.wordpress.org/trunk@41605 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse
2017-09-27 07:59:14 +00:00
parent 1545e58ea6
commit 2ff224a044
7 changed files with 50 additions and 11 deletions

View File

@@ -301,7 +301,7 @@ function wp_update_plugins( $extra_stats = array() ) {
'locale' => wp_json_encode( $locales ),
'all' => wp_json_encode( true ),
),
'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' )
);
if ( $extra_stats ) {
@@ -479,7 +479,7 @@ function wp_update_themes( $extra_stats = array() ) {
'translations' => wp_json_encode( $translations ),
'locale' => wp_json_encode( $locales ),
),
'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' )
);
if ( $extra_stats ) {