[wp-trac] [WordPress Trac] #40702: Add WordCamps and meetup events to the News Dashboard widget

WordPress Trac noreply at wordpress.org
Thu May 18 22:23:49 UTC 2017


#40702: Add WordCamps and meetup events to the News Dashboard widget
----------------------------+-----------------------------------
 Reporter:  iandunn         |       Owner:
     Type:  task (blessed)  |      Status:  new
 Priority:  normal          |   Milestone:  4.8
Component:  Administration  |     Version:  trunk
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |     Focuses:  javascript, rest-api
----------------------------+-----------------------------------

Comment (by iandunn):

 [attachment:40702-geoip.3.diff] finishes the work that was started in
 [attachment:40702-geoip.2.diff], to improve the handling of locations
 determined by geolocating the IP address. It also introduces improvments
 for handling locations determined by manual searches. As a whole, this
 patch addresses a lot of the feedback from beta1 about location accuracy,
 and also is required to support some changes on the API side from
 #meta2823 (specifically, [meta5497] and [meta5499].

 === Breakdown of changes ===

 * For locations determined by IP address, the IP itself is treated as the
 location, rather than the result of the geolocation. This is necessary
 because the API no longer results a location for IP queries. It also is
 nice for certain use cases, like when the user is traveling. As of r40781,
 if the user travels to a new location, their location and events are not
 updated. With this patch, they will always be shown events that match
 their current location. As a result of not having a geolocated
 description, the user is just shown a generic message. That's probably
 better for UX anyway, since it won't distract users that the location
 doesn't match their city exactly, even though the events are close enough
 to be relevant.
 * For locations determined by a manual search, the patch handles the new
 way that the API responds to requests. It no longer returns the location
 description, so the client just uses the one it already has saved instead.
 Because the API doesn't return a complete location each time, the original
 saved location is preserved.
 * `attend_event_near_generic` moved from a template to a `.l10n` string,
 see comment:61. `no-upcoming-events` ended up needing to remain a
 template, though, since it needs to apply `{{ data.location.description
 }}`. I combined the two inside a single template, though, because that
 seemed a bit cleaner than how it was before.
 * Renamed `get_client_ip` to `get_unsafe_client_ip`, because it now needs
 to be `public` and `static`. That will have the unintended side-effect of
 encouraging usage by plugins, so I think it's best to be explicit that the
 method isn't designed to verify the authenticity of the returned IP.

 I've done a lot of testing, and I think this is pretty solid. I think it
 needs a few others testing it just to confirm that, though. Can anyone try
 it out and give feedback? You'll need to set up the mu-plugin from
 comment:53.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40702#comment:64>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list