Viewing 1 replies (of 1 total)
  • Thread Starter Dan Rossiter

    (@danrossiter)

    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.