WordPress.org

Making WordPress.org

Opened 3 years ago

Last modified 5 months ago

#1278 accepted enhancement

Plugins Install API: Add ability to order results

Reported by: apeatling Owned by: tellyworth
Milestone: Priority: normal
Component: API Keywords:
Cc:

Description

Copied over from #wp12696:

Replying to apeatling:

It would be awesome if you could pass an ordering parameter to plugins_api() that would allow you to return a list of filtered plugins in a specific order.

I'd love to be able to use the API to return a list of the most popular / newest / recently updated plugins on the repo that contain the tag "buddypress".

Something like this would be awesome:

$plugins = plugins_api( 'query_plugins', array( 'tag' => 'buddypress', 'page' => 1, 'order' => 'popular' );

Even better, also allow search filtering:

$plugins = plugins_api( 'query_plugins', array( 'tag' => 'buddypress', 'search' => 'album', 'page' => 1, 'order' => 'popular' );

I'd be happy to implement this if I can get access to the API source on WordPress.org.

Reply from Otto:

This wouldn't be terribly difficult to add to the API, but it's pointless until core supports doing it there and is able to request the ordering. So, moving to the plugins component.

Now that the arguments for plugins_api() have been documented, paired with the fact that there are existing filters in plugins_api() for modifying arguments, I think there's now a more compelling case for implementing an 'orderby' (or similar) argument in the dotorg API.

Change History (5)

#1 @DrewAPicture
3 years ago

  • Reporter changed from DrewAPicture to apeatling

#2 @paaljoachim
2 years ago

A make believe but so true scenario...
I need to find a plugin to improve my responsive design. I go to Plugins -> Add New -> Click the Search Plugins box. Which btw shows Featured plugins. I write mobile into the search box and click enter. It jumps from the Featured page to a specific Search Results. But but I thought it would search featured plugins.....? Guess not. Ok so it is on a Search Results page.

The first mobile plugin I see has 9000 active installs and a star rating of 4. I click the Keyword drop down box and want to find the highest rated or most Active Installs. But under Keyword it says Author and Tag. I decide to try Tag. Click into the search box again and click enter. Another plugin comes up that says nothing about mobile....

The ideal scenario.
Go into Add Plugins -> write mobile into the search box. Click enter. It searches the Featured plugins (or goes to the Search Results page) for the most active installed plugin. Going to the dropdown one can select Keyword, Author, Tags, Active Installs or Highest Rated. This approach would make searching a lot better.

Last edited 2 years ago by paaljoachim (previous) (diff)

#3 follow-up: @obenland
6 months ago

We could probably achieve that with the REST API and by making more of the custom taxonomies and metas available in rest

#4 @tellyworth
5 months ago

  • Owner set to tellyworth
  • Status changed from new to accepted

#5 in reply to: ↑ 3 @dd32
5 months ago

Replying to obenland:

We could probably achieve that with the REST API and by making more of the custom taxonomies and metas available in rest

We should really avoid having people hit wp-json/ directly when we've got api.wordpress.org.

That being said, I also don't see the point in implementing this until such a time that core or WordPress.org needs it (even though it'd be simple to do so)

Note: See TracTickets for help on using tickets.