Update WP and plugins

This commit is contained in:
Oliver Davies 2019-04-16 20:56:22 +01:00
parent 10a4713229
commit 1fb77fc4ff
864 changed files with 101724 additions and 78262 deletions

View file

@ -95,8 +95,8 @@ class WP_Community_Events {
// include an unmodified $wp_version
include( ABSPATH . WPINC . '/version.php' );
$api_url = 'http://api.wordpress.org/events/1.0/';
$request_args = $this->get_request_args( $location_search, $timezone );
$api_url = 'http://api.wordpress.org/events/1.0/';
$request_args = $this->get_request_args( $location_search, $timezone );
$request_args['user-agent'] = 'WordPress/' . $wp_version . '; ' . home_url( '/' );
if ( wp_http_supports( array( 'ssl' ) ) ) {
@ -203,7 +203,7 @@ class WP_Community_Events {
// Wrap the args in an array compatible with the second parameter of `wp_remote_get()`.
return array(
'body' => $args
'body' => $args,
);
}
@ -233,7 +233,7 @@ class WP_Community_Events {
* or false on failure.
*/
public static function get_unsafe_client_ip() {
$client_ip = $netmask = false;
$client_ip = false;
// In order of preference, with the best ones for this purpose first.
$address_headers = array(
@ -308,7 +308,7 @@ class WP_Community_Events {
if ( isset( $location['ip'] ) ) {
$key = 'community-events-' . md5( $location['ip'] );
} else if ( isset( $location['latitude'], $location['longitude'] ) ) {
} elseif ( isset( $location['latitude'], $location['longitude'] ) ) {
$key = 'community-events-' . md5( $location['latitude'] . $location['longitude'] );
}
@ -425,7 +425,7 @@ class WP_Community_Events {
$response_body['events'] = array_slice( $response_body['events'], 0, 3 );
$trimmed_event_types = wp_list_pluck( $response_body['events'], 'type' );
// Make sure the soonest upcoming WordCamps is pinned in the list.
// Make sure the soonest upcoming WordCamp is pinned in the list.
if ( ! in_array( 'wordcamp', $trimmed_event_types ) && $wordcamps ) {
array_pop( $response_body['events'] );
array_push( $response_body['events'], $wordcamps[0] );
@ -452,11 +452,13 @@ class WP_Community_Events {
return;
}
error_log( sprintf(
'%s: %s. Details: %s',
__METHOD__,
trim( $message, '.' ),
wp_json_encode( $details )
) );
error_log(
sprintf(
'%s: %s. Details: %s',
__METHOD__,
trim( $message, '.' ),
wp_json_encode( $details )
)
);
}
}