From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.svg

Release status:Extension status beta

ImplementationTemplate:Extension#type Parser extension, Database, Data extraction
DescriptionTemplate:Extension#description Allows rating of articles
Author(s)Template:Extension#username Josef Martiňák (Jossmarttalk)
Latest versionTemplate:Extension#version 0.3.1 (2014-01-30)
MediaWikiTemplate:Extension#mediawiki 1.22
Database changesTemplate:Extension#needs-updatephp Yes
TablesTemplate:Extension#table1 articlescores
LicenseTemplate:Extension#license GNU General Public License 2.0
Download here
Hooks usedTemplate:Extension#hook

Translate the ArticleScores extension if it is available at translatewiki.net

Check usage and version matrix.

The ArticleScores extension allows inserting the score to every article's revision by using the stars. Recent revision is of the highest importance. One revision can be rated from the same IP address again next day. Javascript required.


  • Let's iterate the revisions' list of an article sorted by rev_id DESC (from table "revision")
  • First iteration has a weight=0.8^i and the number i (starts with 0) increments with following iterations if weight>0.0001.
  • We can avoid rounding errors with this limit. These weights are so tiny that we can leave them.
  • Rated revision (has a row in articlescores table) has a score:
    • S = sum of stars of this revision / number of votes.
    • Not rated revision has a score S = 0.

  • R: rating of the article
  • w: weight = 0.8^i. If revision is not rated, w(i)=0.
  • i: iteration step, starts with 0
  • S: rating of a revision

As soon as some edit on a rated article is done, the rating gets recounted.


  • Tested with Vector skin only
  • Main page is excluded from rating.


SpecialPage:ArticleScores diplays best, worst, or articles with selected rating. The are sorted by the score. Articles with score 2 have in fact 1,5 - 2,4999. There is no paging, I assume that only top articles in the selected filter are interesting. Number of items displayed can be set in AS_SPECIAL_ITEMS, see Configuration section.


  • Download, extract and place the file(s) in a directory called ArticleScores in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    require_once "$IP/extensions/ArticleScores/ArticleScores.php";
  • Run the update script which will automatically create the necessary database tables that this extension needs.
  • Configure as required.
  • YesY Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.


Open the "config.php" file and set following constants:

  • AS_NAMESPACES - numbers of namespaces we want to rate, separated by comma, for example
    define( 'AS_NAMESPACES', '0, 2, 12' );
    allows Main, User, Help namespaces. Numbers of built in namespaces can be found at Manual:Namespace. Default is 0 = Main namespace.
  • AS_SPECIAL_ITEMS - number of rated articles showed on Special:ArticleScores. Default is 50.