Make WordPress Core

Opened 13 years ago

Closed 11 years ago

#19239 closed feature request (fixed)

Combine WordPress News and Other WordPress News dashboard widgets

Reported by: jane's profile jane Owned by:
Milestone: 3.8 Priority: normal
Severity: normal Version: 3.3
Component: Administration Keywords: has-patch needs-testing
Focuses: Cc:

Description

We could lighten the dashboard by making this one widget with configuration instead of two separate ones. Anything from WordPress.org official blog would get a highlight to designate it as such. Configure would allow to choose display of both feeds or jus one, and how many items to show.

Attachments (8)

19239.diff (8.2 KB) - added by ericmann 12 years ago.
Initial Patch
feed-widget.png (25.7 KB) - added by ericmann 12 years ago.
Screenshot of widget
19239-2.diff (10.0 KB) - added by ericmann 11 years ago.
Make feed URLs configurable for I18N
19239.3.diff (6.3 KB) - added by lessbloat 11 years ago.
19239.4.diff (11.2 KB) - added by lessbloat 11 years ago.
19239.4.refresh.diff (11.2 KB) - added by lessbloat 11 years ago.
19239.3.2.diff (12.2 KB) - added by lessbloat 11 years ago.
19239.5.diff (25.6 KB) - added by lessbloat 11 years ago.

Download all attachments as: .zip

Change History (36)

#1 @ericmann
12 years ago

  • Cc eric@… added

Would be a good addition to 3.6.

@ericmann
12 years ago

Initial Patch

@ericmann
12 years ago

Screenshot of widget

#2 @ericmann
12 years ago

  • Keywords has-patch added; needs-patch removed

Took some time to polish off an initial patch.

This version combines both feeds into a single widget. The official blog feed (2 items with summary) come first, followed by Planet WordPress' feed (5 items, no summary). The official feed is also highlighted with a blue WP logo icon (using an already-defined WP icon).

CSS was revised to include the HiDPI version as well.

Here is a screenshot of the widget in action on the dashboard:

http://core.trac.wordpress.org/raw-attachment/ticket/19239/feed-widget.png

Current version includes no additional options (similar to the Right Now and Plugins dashboard widgets), but it can still be hidden from the dashboard entirely.

#3 @SergeyBiryukov
12 years ago

  • Milestone changed from Future Release to 3.6

#4 follow-up: @SergeyBiryukov
12 years ago

Current widgets allow to change the RSS feed URL and title, for example to replace the English feed with a localized one.

I guess the new widget should support that as well. Also, from the description:

Configure would allow to choose display of both feeds or just one, and how many items to show.

#5 in reply to: ↑ 4 @DrewAPicture
12 years ago

Replying to SergeyBiryukov:

Current widgets allow to change the RSS feed URL and title, for example to replace the English feed with a localized one.

I guess the new widget should support that as well. Also, from the description:

Configure would allow to choose display of both feeds or just one, and how many items to show.

Looking at how the configuration options are currently done, it appears that all four built-in RSS widgets (three Dashboard widgets and a sidebar widget) use the same form which is generated by wp_widget_rss_form().

In my reading of the existing setup, we'd need to add a couple of additional arguments to the array passed via wp_dashboard_newsfeed_control() to wp_dashboard_rss_control() as well as $_POST handlers for that data. wp_widget_rss_form() would need corresponding key/value pairs too. Then there'd need to be a check based on the $widget_id to activate the secondary title and URL fields.

That's if we stick with modifying the existing rss control, CMIIW.

Last edited 12 years ago by DrewAPicture (previous) (diff)

#6 follow-up: @rmccue
12 years ago

+1 for making a new dashboard widget for this, rather than modifying the existing one. Modification could break a whole heap of plugins that use it.

#7 @sabreuse
12 years ago

  • Cc sabreuse added

#8 in reply to: ↑ 6 @bpetty
12 years ago

  • Cc bpetty added

Replying to rmccue:

+1 for making a new dashboard widget for this, rather than modifying the existing one. Modification could break a whole heap of plugins that use it.

That's assuming the modifications were done in a backwards incompatible way, and the changes Drew described don't actually sound like they break compatibility (even if they do sound a little unorthodox).

If the current RSS widget methods aren't currently flexible enough to implement this widget, it makes sense to me to refactor and expand their functionality so they can also be used with more 3rd party widgets using an approach similar to this one. What doesn't make sense is writing up a second set of methods that provide the same functionality that have to be maintained right alongside the original methods.

Or as a last result, write a new API and implement the original methods on top of that API (and deprecate them).

#9 follow-up: @ericmann
12 years ago

The way things originally worked:

  • There was one RSS widget function that took some generic parameters (url, show_author, show_summary, show_date, limit) and returned a cachable result with some default markup.
  • The functions that registered both original "official" feed widgets merely called this same function but passed different parameters - the official blog shows excerpts, the WordPress Planet feed doesn't

Since you can still add generic RSS feeds, I took the approach of combining these two widgets into a non-generic feed widget, specific to the feeds generated by WordPress.org.

Replying to SergeyBiryukov:

Current widgets allow to change the RSS feed URL and title, for example to replace the English feed with a localized one.

So far as I knew at the time (and please correct me if I'm wrong) there isn't a multi-language setup for either http://wordpress.org/news or http://planet.wordpress.org. I was taking the approach that other language feeds could be added either through the generic RSS widget or by adding a language-specific RSS widget.

Replying to bpetty:

If the current RSS widget methods aren't currently flexible enough to implement this widget, it makes sense to me to refactor and expand their functionality so they can also be used with more 3rd party widgets using an approach similar to this one. What doesn't make sense is writing up a second set of methods that provide the same functionality that have to be maintained right alongside the original methods.

I modeled this widget not after the generic RSS widgets - those are intended specifically to pull/cache a single feed and display its items on the screen. Instead, I modeled it after the plugins widget that grabs two separate feeds and displays both on the screen.

The use-case here is specific enough (i.e. more than one feed, displayed differently) that abstracting the standard RSS widget functionality (which is used elsewhere) didn't make sense. Including functionality to highlight the official blog (adding the WP logo) wouldn't work in a more generic method, either.

Also note that the plugins widget doesn't include configuration options either. So if we are going to add configuration settings to this widget, my push back would be: why? Are we adding settings for the sake of adding settings? Remember, decisions, not options.

#10 in reply to: ↑ 9 ; follow-up: @SergeyBiryukov
12 years ago

Replying to ericmann:

So far as I knew at the time (and please correct me if I'm wrong) there isn't a multi-language setup for either http://wordpress.org/news or http://planet.wordpress.org.

Right. I meant localized sites like http://pt.wordpress.org/ or http://planet.wpde.org/, which provide relevant news in their language.

I was taking the approach that other language feeds could be added either through the generic RSS widget or by adding a language-specific RSS widget.

I see, makes sense.

#11 @aaronholbrook
12 years ago

Testing patch 19239.patch - not sure if it's just my installation, but the widget sits at 'Loading...'.

#12 @bpetty
11 years ago

  • Milestone changed from 3.6 to Future Release

#13 in reply to: ↑ 10 @ericmann
11 years ago

Replying to SergeyBiryukov:

Right. I meant localized sites like http://pt.wordpress.org/ or http://planet.wpde.org/, which provide relevant news in their language.

Refreshed the patch during WCSF in anticipation of the contributor day. Also took time to add some configuration - since there are local language versions for Plane WordPress and for WordPress news, you can now set those URLs specifically within the widget. Saving the widget options will also flush the feed cache for the widget to make sure your changes are reflected immediately.

All other functionality remains the same.

@ericmann
11 years ago

Make feed URLs configurable for I18N

#14 follow-up: @rmarks
11 years ago

Testing patch 19239.2, I too get a new widget that sits at "Loading...".

Last edited 11 years ago by rmarks (previous) (diff)

#15 in reply to: ↑ 14 @ericmann
11 years ago

Replying to rmarks:

Testing patch 19239.2, I too get a new widget that sits at "Loading...".

This patch updates JavaScript files. If you don't set SCRIPT_DEBUG to true, it won't work.

@lessbloat
11 years ago

@lessbloat
11 years ago

#16 @lessbloat
11 years ago

  • Keywords needs-testing added

I took a stab at this.

This first patch (19239.3.diff) was just me removing all wp_dashboard_primary & wp_dashboard_secondary code, to get a feel for how all of this works.

With 19239.4.diff:

  • I combined "WordPress Blog" and "Other WordPress News" into a single widget (dashboard_rss)
  • If title is left blank, I removed the code that tried to populate it from the RSS feed. The user would have had to manually remove the title intentionally (as it's set for each feed by default).

Please let me know if you have any code suggestions, or if you see any bugs.

A couple of options I could pursue at this point:

A) Provide a way for users to add/remove feeds through the UI.
B) Bring the "Plugins" widget over to this new RSS widget as well.

Let me know your thoughts on either of those.

#17 @desrosj
11 years ago

  • Cc desrosj@… added

#18 @kraftbj
11 years ago

  • Cc bk@… added

#19 @alex-ye
11 years ago

  • Cc nashwan.doaqan@… added

#20 follow-up: @lessbloat
11 years ago

Maybe some screenshots will help solicit some feedback. ;-)

Here's what 19239.4.diff looks like:

http://f.cl.ly/items/3z3f0R0u3c2A302q2n2Z/combined-news.jpg

And the config section looks like this:

http://f.cl.ly/items/1M2W2T1H39270x1l1F0o/news-config.jpg

Possible next steps:

  • Use tabs to separate each feed - see: http://cl.ly/image/0B1g1V3V3n1M for a mockup by Joen
  • Provide a way for users to add/remove feeds within the configure UI
  • Reduce options in config section? Can we remove the "display item author" option?

Thoughts?

#21 @SergeyBiryukov
11 years ago

  • Milestone changed from Future Release to 3.8

#22 in reply to: ↑ 20 @helen
11 years ago

I'm kind of confused by this ticket now, especially because I've been sitting on responding to it for so long - are we combining these two specific feeds and maybe just having a mechanism for localized URLs somehow, or are we building out a widget that basically functions as an RSS reader? The latter seems really weird to me. Honestly, it's weird that these two widgets had UI configuration beyond *maybe* number of items in the first place. Maybe the dashboard feature dev plugin is a good chance to just start over :)

Replying to lessbloat:

Possible next steps:

  • Use tabs to separate each feed - see: http://cl.ly/image/0B1g1V3V3n1M for a mockup by Joen
  • Provide a way for users to add/remove feeds within the configure UI
  • Reduce options in config section? Can we remove the "display item author" option?

Thoughts?

  • Tabs don't scale at all, especially given title lengths and possibly having any number of feeds.
  • As above, I'm starting to feel like we're building an RSS reader.
  • Please oh please get rid of some options if we keep going down this road. Like all of the checkboxes, and maybe even the customizable title.

@lessbloat
11 years ago

#23 @lessbloat
11 years ago

19239.3.2.diff​ builds on 19239.3.diff​, but pulls all of the related "dashboard_plugins" code as well.

@lessbloat
11 years ago

#24 @lessbloat
11 years ago

19239.5.diff​ does a couple of things:

In the end, it looks like this:

http://f.cl.ly/items/0H1w191K3e0t3B1A1d1u/wp-news.jpg

The config page looks like this:

http://f.cl.ly/items/3Q0P2D2W142f2i162r0W/wp-news-config.jpg

NOTE: Once MP6 lands, it will look like this (this is just a mockup, the "newest plugin" link would be in there too):

http://f.cl.ly/items/0r2j2A3k3o050C42302S/3.8-wp-news.jpg

Thoughts?

Last edited 11 years ago by lessbloat (previous) (diff)

#25 follow-up: @krogsgard
11 years ago

  • Cc krogsgard added

I'm not sure the best place to bring it up, but I'd like to propose that the Planet feed be removed from the default feeds provided entirely. I believe it's poorly maintained, has an arbitrary selection of blogs listed, and is mostly irrelevant to your average WordPress user.

Secondly, I'd propose the entire $default_feeds array be filterable as a whole, versus for each of the two inputs available, so that that could be the default "best practice" location for plugins to add their own news feeds, versus registering their own widgets. This could reduce clutter, and maybe some plugins would ditch their own RSS feed widgets if they could add their feed to this more default widget.

A Planet-esque feed could be valuable, but it does not make sense to be in WordPress core to me. It's unnecessarily controversial in a small circle and I just don't see the purpose. And this is a great opportunity to remove it, since the entire dashboard is being re-thought.

#26 @knutsp
11 years ago

I completely agree with krogsgard on this matter. The "planet" feed as a default widget in the dashboard is the most annoying thing with WordPress. As its own widget it can easily be hidden, after all. But merging it with the WP blog widget will only make it more annoying.

Let the official WP blog items stand out boldly, and the items from other feeds, added by plugins, be toned down.

#27 in reply to: ↑ 25 @noumaan
11 years ago

I second that too, its about time the dashboard gets a relevant and clean look.

Replying to krogsgard:

I'm not sure the best place to bring it up, but I'd like to propose that the Planet feed be removed from the default feeds provided entirely. I believe it's poorly maintained, has an arbitrary selection of blogs listed, and is mostly irrelevant to your average WordPress user.

Secondly, I'd propose the entire $default_feeds array be filterable as a whole, versus for each of the two inputs available, so that that could be the default "best practice" location for plugins to add their own news feeds, versus registering their own widgets. This could reduce clutter, and maybe some plugins would ditch their own RSS feed widgets if they could add their feed to this more default widget.

A Planet-esque feed could be valuable, but it does not make sense to be in WordPress core to me. It's unnecessarily controversial in a small circle and I just don't see the purpose. And this is a great opportunity to remove it, since the entire dashboard is being re-thought.

#28 @nacin
11 years ago

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

This was fixed in #25824!

Note: See TracTickets for help on using tickets.