How to get WordPress Plugins Data in PHP using Plugin API?

I am trying to get the list of WordPress plugins using the WordPress Plugin API in a PHP page.

Plugin API: http://api.wordpress.org/plugins/info/1.0/

I read lots of articles regarding this but they show how to do it inside WordPress.

So, can you help me out how to get the list of all the plugins in a table in PHP page which can be searched through the search bar on the top?

Like how we can search the plugins inside WordPress while adding a new plugin, I want it the same way in a PHP page. I tried lots of coding but ended up confusing myself.

Any help will be really appreciated.

2 Answers
2

Guys I found the answer.
Well, after a lot of changes in codes, I finally did it through API.

Through that PHP page, you can search in any plugin which exist in WordPress Repository.

Sorry, I cannot include the code because it’s too long.

Basically, I am just listing down in short what exactly I did.

First of all I included a PHP cURL script through CallAPI function. (I copied the same script which is included in the most-voted answer of this question: https://stackoverflow.com/questions/21182946/using-curl-to-get-api-data-within-php)

Then, I added actions and requests to that PHP script as explained here: http://code.tutsplus.com/articles/interacting-with-wordpress-plug-in-theme-api–wp-25805

After this, I unserialized the execution of the CallAPI function

Through this, I got all the info that I needed.
Finally, I then made a table in foreach loop so that details of each and every plugin will show up by loop according to what I wanted to show.

For eg: I only wanted to show the Name, Author, Plugin Version and Downloads. So, according to that I changed the elements of the table.

Through this, I can see 25 last updated wordpress plugins on opening that PHP page and when searched, I can find out any plugin from the WordPress Repository.

The only thing which is missing is live AJAX search which I am trying to implement now.

Hope this explanation will help you guys.

After shortening that code, I’ll add it here. (If possible!)

Leave a Comment