Make WordPress Core

Opened 7 years ago

Closed 6 years ago

#41112 closed enhancement (fixed)

Show WordCamps higher up in the News Dashboard widget

Reported by: grapplerulrich's profile grapplerulrich Owned by: metalandcoffee's profile metalandcoffee
Milestone: 4.9.7 Priority: normal
Severity: normal Version: 4.8
Component: Administration Keywords: fixed-major
Focuses: Cc:

Description

WordCamp Bern is planned for 9th September. Till then we have three Meetups planned for June, July and August. Due to this the WordCamp is not being displayed on the list of events.

It is not really important for us that people see the Meetup happening in August but that people see that there is a WordCamp in September.

As there is less organising for meetup it does not mater if people sign up a few days before but for WordCamp we want people to buy their tickets as soon as possible.

If there is a WordCamp nearby it should be shown at the top of list of events.

Related #40702

Attachments (8)

events.jpeg (105.6 KB) - added by grapplerulrich 7 years ago.
events dashboard widget with only meetups and not the WordCamp
events.2.jpeg (101.7 KB) - added by grapplerulrich 7 years ago.
Now that the Meetup has passed the WordCamp is being shown
41112.diff (1.4 KB) - added by metalandcoffee 7 years ago.
before and after.png (166.3 KB) - added by grapplerulrich 7 years ago.
Screenshot before and after applying the patch
Screenshot at 2017-11-15 10:47:55.png (27.1 KB) - added by vertizio 7 years ago.
WordCamp Utrecht gone in favour of pinned WCUS, meetups still showing though
41112.2.diff (6.2 KB) - added by iandunn 7 years ago.
Pin to bottom, add test case
41112.3.diff (10.8 KB) - added by iandunn 7 years ago.
Restores continue to simplify diff, adds more tests
Screen Shot 2018-02-17 at 13.50.32.png (95.1 KB) - added by nielslange 7 years ago.
WordCamp Lancaster, PA still listed on bottom

Download all attachments as: .zip

Change History (34)

@grapplerulrich
7 years ago

events dashboard widget with only meetups and not the WordCamp

#1 @rmccue
7 years ago

  • Focuses rest-api removed
  • Milestone changed from Awaiting Review to WordPress.org

Not related to the REST API; data is provided by WordPress.org under the hood, and it seems like that's probably where this wants to be fixed.

#2 @iandunn
7 years ago

  • Focuses javascript removed
  • Keywords ui-feedback good-first-bug added

This was brought up previously, and I think it's a great idea; there just wasn't time for it in v1.

It'll require some changes on the API side to make camps sticky in API responses, but I think it'll also require some minor (PHP and CSS) tweaks in Core.

cc @mrwweb, @mapk

@grapplerulrich
7 years ago

Now that the Meetup has passed the WordCamp is being shown

#3 @DrewAPicture
7 years ago

  • Keywords has-patch added
  • Owner set to grapplerulrich
  • Status changed from new to assigned

Assigning ownership to mark the good-first-bug as "claimed".

#4 @swissspidy
7 years ago

@iandunn Is there already a meta ticket for the API change? Without that change, one cannot really work on this ticket.

#6 @iandunn
7 years ago

The Meta ticket is meta:#2994.

#7 @iandunn
7 years ago

  • Keywords needs-patch added; has-patch removed
  • Owner grapplerulrich deleted

#8 @jorbin
7 years ago

  • Owner set to metalandcoffee

This is being worked on at WordCamp Philly contributor day . Assigning to @metalandcoffee as her computer is being used for the patch.

@metalandcoffee
7 years ago

#9 @metalandcoffee
7 years ago

  • Keywords has-patch added; needs-patch removed

The above patch was worked on at WordCamp Philly Contributor Day by myself, @warmlaundry, and @alejandroxlopez along with @jorbin.

We found a way to do this without any API changes being necessary. Feedback is encouraged.

@grapplerulrich
7 years ago

Screenshot before and after applying the patch

#10 @grapplerulrich
7 years ago

I tested it with the location Utrecht as I knew there was a WordCamp planned but at least three meetups till then. See the screenshot above of the before and after applying the patch.

#11 @iandunn
7 years ago

  • Milestone changed from WordPress.org to 5.0

Thanks @metalandcoffee, I think 41112.diff moves this forward :)

My hunch is that we'll also need some changes on the API side. In some active cities, there can be 2-3 meetup events per week. Since Core only requests 5 events from the API, the WordCamp wouldn't show up in the API response until about 2-3 weeks before the date.

Regardless of that, though, this is still an improvement on the current situation. If the API changes are languishing, then maybe we can do something like this for 5.0, and then iterate on it once the API is ready. If anyone wants to work on that side of things, the details are in #meta2994, and I posted some instructions for setting up the dev environment in Slack.

I think the widget will probably feel the most intuitive to people if the camp is just listed in the normal chronological flow, rather than having a fixed position at the top. We talked about it a bit before, but there wasn't a lot of feedback, so I'm definitely open to other ideas if you think having it at the top is better.

This ticket was mentioned in Slack in #meta-wordcamp by mrwweb. View the logs.


7 years ago

@vertizio
7 years ago

WordCamp Utrecht gone in favour of pinned WCUS, meetups still showing though

#13 follow-up: @vertizio
7 years ago

Some suggestions for improvement:

  • The ‘Community Events’ widget could be tabbed. One tab for WordCamps, one for meetups. That way we still could stick to 3 items and not mix up the types of events.
  • Fix with: next local WordCamp, Local Meetup and Regional WordCamp. If there is not alocal WordCamp or a Regional WordCamp then show a meetup.

#14 in reply to: ↑ 13 @iandunn
7 years ago

Replying to vertizio:

The ‘Community Events’ widget could be tabbed. One tab for WordCamps, one for meetups. That way we still could stick to 3 items and not mix up the types of events.

I think one of the great things about the way the widget is currently designed, is that the user doesn't have to do anything. Their location is detected automatically, and the relevant events are shown automatically.

The goal of the widget is to promote WP events to users who aren't already aware of the community, so we can't expect them to do any work in order to get the information. We're just trying to pique their interest.

If we switch to tabs, then the user has to do extra work to see the extra events, and I'd worry that the vast majority would never do that.

The current approach feels like it lines up much more with the design for the majority and decisions not options part of WP's philosophy.

@iandunn
7 years ago

Pin to bottom, add test case

#15 @iandunn
7 years ago

  • Keywords has-unit-tests needs-testing added

A camp is now pinned to the API response, as of [meta6275].

41112.2.diff moves the pinned camp from the top to the bottom, and adds a unit test. It needs a bit more testing, but I think it's in good shape.

@iandunn
7 years ago

Restores continue to simplify diff, adds more tests

#16 @iandunn
7 years ago

41112.3.diff restores the continue, in order to make the diff a bit simpler, and also adds some more tests.

For manual testing, you should see it working for Albuquerque and Philly right now, since they have camps coming up in the next 6 weeks, but 3+ meetups before then.

Sticking this in an mu-plugin is helpful, to avoid having to manually clear the local cache:

add_action( 'init', 'clear_events_cache' );
function clear_events_cache() {
        $location = get_user_option( 'community-events-location', get_current_user_id() );

        if ( isset( $location['ip']  ) ) {
                delete_site_transient( 'community-events-' . md5( $location['ip'] ) );
        }

        if ( isset( $location['latitude'], $location['longitude'] ) ) {
                delete_site_transient( 'community-events-' . md5( $location['latitude'] . $location['longitude'] ) );
        }
}

#17 follow-up: @iandunn
7 years ago

@dd32, do you have time to give this a sanity check? I think it's ready for commit.

With the patch applied, you should see WordCamp Lancaster show up if you set your location to Philadelphia.

@nielslange
7 years ago

WordCamp Lancaster, PA still listed on bottom

#18 in reply to: ↑ 17 ; follow-up: @nielslange
7 years ago

Replying to iandunn:

@dd32, do you have time to give this a sanity check? I think it's ready for commit.

With the patch applied, you should see WordCamp Lancaster show up if you set your location to Philadelphia.

After applying your patch I still see WordCamp Lancaster on the bottom of the list. Shouldn't it show up on top?

#19 in reply to: ↑ 18 @iandunn
7 years ago

Replying to nielslange:

After applying your patch I still see WordCamp Lancaster on the bottom of the list. Shouldn't it show up on top?

I left them in chronological order, since that seems more intuitive, unless we're going to add some visual indicators that the camp is pinned.

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


7 years ago

#21 @pento
7 years ago

  • Keywords commit added

I like the idea and implementation. Let's do this.

#22 @jorbin
7 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 42726:

Community Events Dashboard: Always show a WordCamp if one is coming up

WordCamps are celebrations of the local WordPress Community and once a local one is scheduled, people in that community should know it is coming. This adjusts the WordPress Events in the dashboard widgets to always display a WordCamp, even if there are multiple Meetups happening first.

Props iandunn, metalandcoffee, warmlaundry, alejandroxlopez, jorbin.
Fixes #41112.

#23 @jorbin
7 years ago

In 42728:

Community Events Dashboard: Use wp_list_pluck rather than array_columns

array_columns is only available in PHP 5.5+

Introduced in [42726]

See: #41112.

#24 @iandunn
7 years ago

  • Keywords fixed-major added; ui-feedback good-first-bug has-patch has-unit-tests needs-testing commit removed
  • Milestone changed from 5.0 to 4.9.7
  • Resolution fixed deleted
  • Status changed from closed to reopened

SInce 4.9.x is open for enhancements 1, 2, it doesn't seem like there's any reason for this to wait until 5.0.

#25 @SergeyBiryukov
6 years ago

In 43356:

Docs: Update @since versions in Community Events class added in [42726].

See #41112.

#26 @SergeyBiryukov
6 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 43357:

Community Events Dashboard: Always show a WordCamp if one is coming up.

WordCamps are celebrations of the local WordPress Community and once a local one is scheduled, people in that community should know it is coming. This adjusts the WordPress Events in the dashboard widgets to always display a WordCamp, even if there are multiple Meetups happening first.

Props iandunn, metalandcoffee, warmlaundry, alejandroxlopez, jorbin.
Merges [42726], [42728], and [43356] to the 4.9 branch.
Fixes #41112.

Note: See TracTickets for help on using tickets.