Making WordPress.org

Changeset 7702


Ignore:
Timestamp:
09/24/2018 11:24:59 PM (6 years ago)
Author:
iandunn
Message:

WordCamp Post Type: Log geocoding errors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-admin.php

    r7701 r7702  
    11<?php
    22
     3use WordCamp\Logger;
    34use WordCamp\Mentors_Dashboard;
    45use WordPress_Community\Applications\WordCamp_Application;
     
    171172
    172173            $response = wcorg_redundant_remote_get( $request_url );
     174            $body     = json_decode( wp_remote_retrieve_body( $response ) );
    173175
    174176            // Don't delete the existing (and probably good) values if the request failed
    175             if ( is_wp_error( $response ) ) {
     177            if ( is_wp_error( $response ) || empty( $body->results[0]['address_components'] ) ) {
     178                Logger\log( 'geocoding_failure', compact( 'request_url', 'response' ) );
    176179                return;
    177180            }
Note: See TracChangeset for help on using the changeset viewer.