Title: WordPress Plugin Info API
Last modified: August 20, 2016

---

# WordPress Plugin Info API

 *  [Dan Rossiter](https://wordpress.org/support/users/danrossiter/)
 * (@danrossiter)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/wordpress-plugin-info-api/)
 * MakerBlock,
 * I was digging into the plugin code and I see that you’re currently just scraping
   content from the HTML side for each plugin. Though this works, WP actually provides
   [an API for retrieving info about plugins](http://dd32.id.au/projects/wordpressorg-plugin-information-api-docs/).
 * Though the method you’re using currently works, it’s a little less efficient 
   and prone to breaking if WP ever changes their design. The API is documented 
   and will always return what you expect.
 * Just my 2 cents 🙂
 * (I love the plugin, btw!)
 * [http://wordpress.org/extend/plugins/ocd-plugin-stats/](http://wordpress.org/extend/plugins/ocd-plugin-stats/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [Dan Rossiter](https://wordpress.org/support/users/danrossiter/)
 * (@danrossiter)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/wordpress-plugin-info-api/#post-3336611)
 * Sorry, one other thing. Looks like the formula for calculating overall ratings
   for all plugins is incorrect. Currently it takes a straight average of the star
   rating for each, but this assumes the same number of ratings have been given 
   for each plugin, which would almost never be the case.
 * The following pseudocode would return a true average of all plugin ratings:
 *     ```
       reviews = 0
       starpts = 0
       foreach plugin
         reviews += plugin.reviews
         starpts += plugin.reviews * plugin.stars
       return starpts / reviews
       ```
   
 * This is especially an issue if you have a plugin with no ratings yet. That currently
   averages in as a zero, which wouldn’t make sense since a non-rated plugin is 
   not the same as a plugin that has been rated a zero.
 * All the best!

Viewing 1 replies (of 1 total)

The topic ‘WordPress Plugin Info API’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ocd-plugin-stats_a3afe7.svg)
 * [OCD Plugin Stats](https://wordpress.org/plugins/ocd-plugin-stats/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ocd-plugin-stats/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ocd-plugin-stats/)
 * [Active Topics](https://wordpress.org/support/plugin/ocd-plugin-stats/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ocd-plugin-stats/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ocd-plugin-stats/reviews/)

## Tags

 * [enhancement](https://wordpress.org/support/topic-tag/enhancement/)

 * 1 reply
 * 1 participant
 * Last reply from: [Dan Rossiter](https://wordpress.org/support/users/danrossiter/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/wordpress-plugin-info-api/#post-3336611)
 * Status: not resolved