Move to JSON for the plugin and theme update-check API endpoints. see #25311.
Built from https://develop.svn.wordpress.org/trunk@25442 git-svn-id: http://core.svn.wordpress.org/trunk@25363 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
fef6081046
commit
9414d6e40e
|
@ -206,7 +206,7 @@ function wp_update_plugins() {
|
||||||
'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
|
'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
|
||||||
);
|
);
|
||||||
|
|
||||||
$url = 'http://api.wordpress.org/plugins/update-check/1.0/';
|
$url = 'http://api.wordpress.org/plugins/update-check/1.1/';
|
||||||
if ( wp_http_supports( array( 'ssl' ) ) )
|
if ( wp_http_supports( array( 'ssl' ) ) )
|
||||||
$url = set_url_scheme( $url, 'https' );
|
$url = set_url_scheme( $url, 'https' );
|
||||||
|
|
||||||
|
@ -215,10 +215,10 @@ function wp_update_plugins() {
|
||||||
if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) )
|
if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) );
|
$response = json_decode( wp_remote_retrieve_body( $raw_response ) );
|
||||||
|
|
||||||
if ( is_array( $response ) )
|
if ( is_object( $response ) )
|
||||||
$new_option->response = $response;
|
$new_option->response = (array) $response;
|
||||||
else
|
else
|
||||||
$new_option->response = array();
|
$new_option->response = array();
|
||||||
|
|
||||||
|
@ -317,7 +317,7 @@ function wp_update_themes() {
|
||||||
'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
|
'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
|
||||||
);
|
);
|
||||||
|
|
||||||
$url = 'http://api.wordpress.org/themes/update-check/1.0/';
|
$url = 'http://api.wordpress.org/themes/update-check/1.1/';
|
||||||
if ( wp_http_supports( array( 'ssl' ) ) )
|
if ( wp_http_supports( array( 'ssl' ) ) )
|
||||||
$url = set_url_scheme( $url, 'https' );
|
$url = set_url_scheme( $url, 'https' );
|
||||||
|
|
||||||
|
@ -330,7 +330,7 @@ function wp_update_themes() {
|
||||||
$new_update->last_checked = time();
|
$new_update->last_checked = time();
|
||||||
$new_update->checked = $checked;
|
$new_update->checked = $checked;
|
||||||
|
|
||||||
$response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) );
|
$response = json_decode( wp_remote_retrieve_body( $raw_response ), true );
|
||||||
if ( is_array( $response ) )
|
if ( is_array( $response ) )
|
||||||
$new_update->response = $response;
|
$new_update->response = $response;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue