WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 5 months ago

#19239 closed feature request (fixed)

Combine WordPress News and Other WordPress News dashboard widgets

Reported by: 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 16 months ago.
Initial Patch
feed-widget.png (25.7 KB) - added by ericmann 16 months ago.
Screenshot of widget
19239-2.diff (10.0 KB) - added by ericmann 9 months ago.
Make feed URLs configurable for I18N
19239.3.diff (6.3 KB) - added by lessbloat 8 months ago.
19239.4.diff (11.2 KB) - added by lessbloat 8 months ago.
19239.4.refresh.diff (11.2 KB) - added by lessbloat 7 months ago.
19239.3.2.diff (12.2 KB) - added by lessbloat 7 months ago.
19239.5.diff (25.6 KB) - added by lessbloat 7 months ago.

Download all attachments as: .zip

Change History (36)

comment:1 ericmann16 months ago

  • Cc eric@… added

Would be a good addition to 3.6.

ericmann16 months ago

Initial Patch

ericmann16 months ago

Screenshot of widget

comment:2 ericmann16 months 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.

comment:3 SergeyBiryukov16 months ago

  • Milestone changed from Future Release to 3.6

comment:4 follow-up: SergeyBiryukov15 months 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.

comment:5 in reply to: ↑ 4 DrewAPicture15 months 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 15 months ago by DrewAPicture (previous) (diff)

comment:6 follow-up: rmccue15 months 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.

comment:7 sabreuse15 months ago

  • Cc sabreuse added

comment:8 in reply to: ↑ 6 bpetty15 months 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).

comment:9 follow-up: ericmann15 months 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.

comment:10 in reply to: ↑ 9 ; follow-up: SergeyBiryukov15 months 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.

comment:11 aaronholbrook15 months ago

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

comment:12 bpetty11 months ago

  • Milestone changed from 3.6 to Future Release

comment:13 in reply to: ↑ 10 ericmann9 months 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.

ericmann9 months ago

Make feed URLs configurable for I18N

comment:14 follow-up: rmarks9 months ago

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

Last edited 9 months ago by rmarks (previous) (diff)

comment:15 in reply to: ↑ 14 ericmann9 months 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.

lessbloat8 months ago

lessbloat8 months ago

comment:16 lessbloat8 months 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.

comment:17 desrosj8 months ago

  • Cc desrosj@… added

comment:18 kraftbj8 months ago

  • Cc bk@… added

comment:19 alex-ye8 months ago

  • Cc nashwan.doaqan@… added

comment:20 follow-up: lessbloat7 months 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?

comment:21 SergeyBiryukov7 months ago

  • Milestone changed from Future Release to 3.8

comment:22 in reply to: ↑ 20 helen7 months 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.

lessbloat7 months ago

lessbloat7 months ago

comment:23 lessbloat7 months ago

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

lessbloat7 months ago

comment:24 lessbloat7 months 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 7 months ago by lessbloat (previous) (diff)

comment:25 follow-up: krogsgard7 months 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.

comment:26 knutsp7 months 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.

comment:27 in reply to: ↑ 25 noumaan7 months 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.

comment:28 nacin5 months ago

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

This was fixed in #25824!

Note: See TracTickets for help on using tickets.