• Proposals
  • Improve extendability of Statistics extension

This extensions could be used to track other activities on forum. For example I have Gamification extension and I would like see stats for number of votes. Number of likes from Likes extension could be also useful. But right now it is really hard/impossible to add additional sections to stats widget:

  1. List of stats is hardcoded JS and there is no nice API to extend it. And since components are not exported, you can't even use MiniStatisticsWidget.prototype.entities = myList to change it.
  2. List of stats is also hardcoded in PHP. You can still extend this class and use own implementation for /statistics endpoint, but it is inconvenient and it is too hacky to do this in extension.
  3. Query for stats assumes that table has id column. But this is not always true - post_likes table does not have such column. Replacing COUNT(id) with COUNT(*) should give the same results but without such problems.