Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 8 years ago

#22002 closed task (blessed) (fixed)

Favorite plugins in the plugin installer

Reported by: otto42's profile Otto42 Owned by: nacin's profile nacin
Milestone: 3.5 Priority: normal
Severity: normal Version:
Component: Upgrade/Install Keywords: has-patch commit
Focuses: Cc:

Description

Show a new Favorites tab in the plugin installer, to allow users to put in a WordPress.org username and see the Favorites of that user, and install them.

API change has been made. Patch to use API change is attached.

Attachments (12)

favorites.diff (2.4 KB) - added by Otto42 11 years ago.
Add favorites to plugin installer
favorites-updated.diff (2.5 KB) - added by griffinjt 11 years ago.
favorites-updated.2.diff (4.4 KB) - added by griffinjt 11 years ago.
apologies - malformed diff file for first upload
22002.diff (2.7 KB) - added by Japh 11 years ago.
Some fixed typos, and implemented usermeta feature
22002.2.diff (2.7 KB) - added by Japh 11 years ago.
Updated to user get_user_option and update_user_meta as per @nacin's advice
22002.3.diff (2.6 KB) - added by Otto42 11 years ago.
Update wording of user field, eliminate extra space and ugly header
22002.4.diff (2.6 KB) - added by Otto42 11 years ago.
Move form into the correct position to match the search form display, so it doesn't push down the results table needlessly
22002.5.diff (4.4 KB) - added by DrewAPicture 11 years ago.
Adds help text for the Favorites link, fixes a couple of help-text typos
22002.6.diff (4.5 KB) - added by Japh 11 years ago.
Switched input field type to 'search'
22002.7.diff (4.4 KB) - added by Japh 11 years ago.
Removed enctype attribute from the form, as per @nacin's recommendation
22002.8.diff (4.8 KB) - added by nacin 11 years ago.
22002.8.1.diff (5.0 KB) - added by DrewAPicture 11 years ago.
Some spaces.

Download all attachments as: .zip

Change History (49)

@Otto42
11 years ago

Add favorites to plugin installer

#1 @helenyhou
11 years ago

Cool! Surprise: it works. :)

#2 @Japh
11 years ago

  • Cc japh@… added

#3 @ocean90
11 years ago

Seems like it returns all plugins if a user exists but has no favorites.

#4 @Otto42
11 years ago

Fixed. That's on the API side. BB_Query has this disconcerting habit of returning all possible results when there are no matches for the given data.

#5 @mordauk
11 years ago

  • Cc pippin@… added

#6 @mordauk
11 years ago

Very cool.

#7 @griffinjt
11 years ago

Updated the patch with typo fixes and a little more relevant documenting for the $page param.

#8 @scribu
11 years ago

  • Milestone changed from Awaiting Review to 3.5

+1. Without this, favorite plugins are little more than bookmarks.

#9 @sabreuse
11 years ago

+eleventy

#10 follow-up: @Japh
11 years ago

I have included a suggested change in my Favorite Plugins plugin which utilises this new API, that is remembering the user. Though perhaps for core, we could do this with a transient?

@griffinjt
11 years ago

apologies - malformed diff file for first upload

#11 @Otto42
11 years ago

Japh: If I was going to do that, I'd probably want it to use a cookie or something instead, to keep it browser/user specific instead of storing it on the server-side. Could be weird if you have multiple admins browsing that page.

#12 @griffinjt
11 years ago

Ok, ignore my patches until I get my trunk install corrected. x.x

#13 @Japh
11 years ago

Otto42: Yes, I was thinking either cookie or session.

#14 @Otto42
11 years ago

No sessions. Bad mojo with sessions. You'd be downright shocked at the number of hosting setups out there which will break painfully when you even try to use sessions.

#15 in reply to: ↑ 10 @nacin
11 years ago

  • Component changed from Plugins to Upgrade/Install
  • Type changed from enhancement to task (blessed)

Replying to Japh:

I have included a suggested change in my Favorite Plugins plugin which utilises this new API, that is remembering the user. Though perhaps for core, we could do this with a transient?

This is a worthy addition to this — but simply as a user option (global usermeta) rather than a site option.

#16 @DrewAPicture
11 years ago

Getting a fatal error Cannot redeclare install_plugins_favorites() clicking 'Add New' from a site's Plugins menu on Multisite:

Fatal error: Cannot redeclare install_plugins_favories() (previously declared in /Users/Drew/Sites/mutrunk/wp-admin/includes/plugin-install.php:183) in /Users/Drew/Sites/mutrunk/wp-admin/includes/plugin-install.php on line 212

EDIT: Applies to favorites-updates.2.diff

Oh, and by the way ... ooooh ahhhh, impressive.

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

#17 @Otto42
11 years ago

DrewAPicture: Use my patch, not the two broken ones after that. See if that is the problem.

#18 @DrewAPicture
11 years ago

  • Cc xoodrew@… added

Make that fatal error on 'Add New' from any plugins screen in Multisite including Network Admin with favorites-updated.2.diff

Replying to Otto42:

DrewAPicture: Use my patch, not the two broken ones after that. See if that is the problem.

favorites.diff works for me on Multisite. Spiffy.

#19 @Otto42
11 years ago

Yes, both the "updated" patches from griffinjt are broken, as he pointed out earlier. The original patch is currently the correct one, for now.

#20 @DrewAPicture
11 years ago

Paired with this, it sure would be nice to be able to install multiple plugins at once though. There's a ticket for that somewhere around here (unless I'm missing something).

#21 @Otto42
11 years ago

Interesting idea, but separate. Anyway, this new screen uses the same listing methodology as all the other pages do (same function calls) so a patch to do multiple installs should affect this in an identical fashion.

@Japh
11 years ago

Some fixed typos, and implemented usermeta feature

#22 @Japh
11 years ago

I implemented at least a preliminary version of username remembrance with usermeta in 22002.diff. Also fixed favories -> favorites typo.

@Japh
11 years ago

Updated to user get_user_option and update_user_meta as per @nacin's advice

@Otto42
11 years ago

Update wording of user field, eliminate extra space and ugly header

@Otto42
11 years ago

Move form into the correct position to match the search form display, so it doesn't push down the results table needlessly

@DrewAPicture
11 years ago

Adds help text for the Favorites link, fixes a couple of help-text typos

#23 @DrewAPicture
11 years ago

22002.5.diff Adds help text and fixes a couple of typos.

@Japh
11 years ago

Switched input field type to 'search'

#24 @Japh
11 years ago

For the sake of consistency and friendliness to touch devices, 22002.6.diff changes the favourites input field type to 'search'.

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

#25 @nacin
11 years ago

enctype="multipart/form-data" appears to be copied-pasted from the upload form. This form isn't uploading data, so it can go.

@Japh
11 years ago

Removed enctype attribute from the form, as per @nacin's recommendation

#26 @Japh
11 years ago

Patch 22002.7.diff removes the extra attribute @nacin pointed out.

@nacin
11 years ago

#27 @nacin
11 years ago

  • Keywords commit added

22002.8.diff hides the list table before the initial search and moves to method="get" action="".

@DrewAPicture
11 years ago

Some spaces.

#28 @DrewAPicture
11 years ago

  • Keywords 2nd-opinion added

After a bit of back and forth with @japh seems like searches are only case-insensitive if the username is all lowercase to start with.

For instance, 'markjaquith' works, but 'MarkJaquith' doesn't. 'matt' works but 'Matt' doesn't.

But DrewAPicture and drewapicture both work (username:DrewAPicture).

Consensus seems to be this should be looked at on the API side.

#29 @nacin
11 years ago

  • Keywords 2nd-opinion removed

Yes, this is just an API thing. Otto42 and I should be able to straighten it out.

#30 @westi
11 years ago

This is a great enhancement and great use of the WP.org favs

#31 @georgestephanis
11 years ago

For

$user = isset( $_REQUEST['user'] ) ? stripslashes( $_REQUEST['user'] ) : get_user_option( 'wporg_favorites' );

should we be explicitly checking $_GET instead of $_REQUEST? The form's a get form anyways.

#32 @Otto42
11 years ago

User name search is now case-insensitive.

#33 @pento
11 years ago

  • Cc gary@… added

#34 @nacin
11 years ago

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

In [22026]:

Browse and install your wordpress.org plugin favorites from the plugin installer. props Otto42, Japh, DrewAPicture. fixes #22002.

#35 @husobj
11 years ago

  • Cc ben@… added

#36 @maor
11 years ago

  • Cc maorhaz@… added

This ticket was mentioned in Slack in #forums by otto42. View the logs.


8 years ago

Note: See TracTickets for help on using tickets.