[wp-meta] [Making WordPress.org] #4469: Plugin information API: Prioritize 100% matched slug in search

Making WordPress.org noreply at wordpress.org
Wed May 22 16:07:26 UTC 2019


#4469: Plugin information API: Prioritize 100% matched slug in search
--------------------------+--------------------
 Reporter:  tobifjellner  |      Owner:  (none)
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:
Component:  API           |   Keywords:
--------------------------+--------------------
 A common use case:
 As an administrator of one or several WordPress installations, I want to
 install a specific plugin from the Plugin Directory and I know its
 specific SLUG/URL

 I go to the "Add new plugin" interface and paste the plugin slug or the
 plugin page URL in the "Keyword" field.

 If I'm lucky, the intended plugin may be included in the search result,
 but perhaps not even on page 1. So I have to look through the search
 result and try to find it, and double-check that the plugin I found really
 is the one I wanted to find.

 A nice long-term solution would be
 https://core.trac.wordpress.org/ticket/40475 but that takes a change in
 core AND an additional keyword to be served in the API.

 A much simpler solution, is what's described in this ticket. This would
 touch only the internal parts of the API code.

 In "keyword" search:
 If the supplied search argument contains "/plugins/", then delete
 everything from the start of the string up to and including "/plugins/".
 I.e. any http|https, el|br|ja|..., wordpress.org|"" we throw away.

 Next: if, after deleting any trailing spaces, there are no spaces in the
 search argument, then check if there's any valid plugin with exactly this
 slug, then
 include this plugin as match number 1. Next do the normal search and
 exclude the slug-matched from the search result (so that it doesn't) get
 included twice.
 (We could even say that a trailing slash would be a good marker that a
 slug search is intended)

 This way, by searching on the slug, I'll always find my intended plugin in
 the same, first position. (Unless some active plugin on the users
 installation filters the search result, of course...)

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/4469>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list