Create and maintain user reputation in a TWiki site

Introduction and Features

This is a plugin for creating and maintaining user and content reputation in a TWiki site. Reputation is managed by voting topics which makes topic's authors either more or less trusted, depending on the vote. Topics receive score from the votes and this score can be used to evaluate topics trustworthiness.

Because the users in a wiki can be more or less interconnected, the plugin can be used in two different modes. In relative mode it calculates a score for every article based on users own past experiences with topic's voters and with past experience of users who are trustworthy from user's perspective. In absolute vote count mode, the votes are simply added together. The behaviour can be controlled either by the user or the site administration.

In addition to voting the plugin can count the number of backlinks which lead to a topic, this can be used as a metric for topic's popularity. It is somewhat questionable if the amount of interlinking can be used to measure trustworthiness, since interlinking is inherent to wikis and it doesn't necessarily imply that the author of the linking article has even read the topic in question. Amount of backlinks is still a useful value, because it measures the need for a particular topic and doesn't create any additional work for the users. However, this feature can have a performance penalty so it's turned off by default.

In addition to the core functionality, features include:

  • Toplists for webs
  • Listing of voted topics for every user
  • Optional voting quotas for webs
Much of the code was originally taken from TWiki:Plugins.TagMePlugin because I didn't want to start from scratch, as this was my first TWiki Plugin and the first thing I've written in Perl. In the current version mostly plugin's internal data storage functions have code originating from TWiki:Plugins.TagMePlugin.


The plugin uses basic TWiki syntax, allthough it is primarily intended to be used interactively by the end users. Additional functionality is meant to be used through provided template topics.

Commands for topic voting

%REPUTATION{ rpaction="vote" vote="negative" }% Prints voting buttons and adds negative vote for this topic.
%REPUTATION{ rpaction="remove" vote="positive" }% Prints voting buttons and tries to remove positive vote for this topic.
%REPUTATION{ rpaction="%URLPARAM{rpaction}%" vote="%URLPARAM{vote}%" }% Prints voting buttons and reads the user input from current page view URL.

Wanted action is given to the plugin with rpaction parameter. Additional parameters are needed for:

  • vote - Adds vote given with vote parameter for the currently viewed topic
  • remove - Removes vote given with vote parameter from currently viewed topic's votes

Listing voted topics and trusted users

%REPUTATION{ rpaction="showtopics" }% Lists all the topics which current user has voted. List includes authors as they were on the time of the vote.
%REPUTATION{ rpaction="showtrusted" }% List of users who have been authors of voted topics and their respective scores.
%REPUTATION{ rpaction="showtoplist" web="Sandbox"}% List all the voted topics in given web (the web name is optional)

Trust value manipulation

When some user is known 'out of band' (eg. from real life) user might want to trust him more or less than the level of trust derived from their interaction on the wiki. Distribution includes a template topic for this ReputationPluginChangeValues

%REPUTATION{ rpaction="addtrust" addvalue="30" user="TWikiGuest" }% Adds given value to user's trust score.
%REPUTATION{rpaction="addtrust" addvalue="%URLPARAM{addvalue}%" user="%URLPARAM{user}%" oldvalue="%URLPARAM{oldvalue}%" slider="%URLPARAM{slider}%"}% The included ReputationPluginChangeValues topic has this command, the plugin prints the sliders and this command collects the URL-parameters from the form.

Example commands

Example 1: %REPUTATION{ rpaction="%URLPARAM{rpaction}%" vote="%URLPARAM{vote}%" }%

Output with theme 'plain', four options and backlink search enabled

Popularity: 7/20 Rating 0.00

Output with default theme 'smiley', with default settings


Example 2: %REPUTATION{ rpaction="showtopics" }%


Topics voted as positive

Topic: TestiSivu2 Authors: JoonaKannisto SeppoTaalasmaa
Topic: WebChanges Authors: WikiGuest
Topic: TestTopic2 Authors: JoonaKannisto

Topics voted as negative

Topic: JoonaKannisto Authors: JoonaKannisto TWikiRegistrationAgent?
Topic: TestiSivu Authors: JoonaKannisto SeppoTaalasmaa AdminUser
Topic: WebHome Authors: WikiGuest
Topic: WebPreferences Authors: JoonaKannisto TWikiContributor? ArthurClemens? PeterThoeny? JohnTalintyre?
Topic: TestTopic1 Authors: SeppoTaalasmaa UllaTaalasmaa
Topic: ReputationPlugin Authors: JoonaKannisto

Example 3: %REPUTATION{ rpaction="showtrusted" }%


Plugin Settings

Most of the plugin settings are preferences settings. Cfg variables were not used as much as they should, since the main target for this plugin runs TWiki through mod_perl and TWiki with mod_perl doesn't read LocalSite.cfg until the server process is restarted.

  • One line description, is shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Create and maintain user reputation in a TWiki site
  • Optional Plugin settings, can be added to TWiki configure, twiki/lib/LocalSite.cfg:
    • $TWiki::cfg{Plugins}{ReputationPlugin}{Voterreputation} =0; --- If set to 1 other voters also gain or lose reputation depending on their agreement with the user.
    • $TWiki::cfg{Plugins}{ReputationPlugin}{Debug} =0; --- Turn on debug mode (no intended for normal use)

Plugin access control settings

These are standard [[][TWiki Access Control] rules. In addition to allow rules, it is possible to use deny lists as well. These variables accept comma separated lists of groups or usernames as value.
  • This setting controls the visibility of the votes
  • Votes can be restricted

Settings having effect in WebPreferences

  • This controls the number of voting options shown to user (currently has options 2 and 4)
  • With restricted votes it can be a good idea to hide the toplist for the web as well
  • Different groups can have different weights on different webs
    • Set REPUTATIONPLUGIN_WEIGHTGROUPS = AdminGroup,2,TestGroup,3
  • Possibility to restrict the number of votes user has by assining a quota for every option
  • Define the quota for each option (default shown here), this can be used to make limited votings in a web.
    • #Set REPUTATIONPLUGIN_QUOTATMPL = excellent,2,positive,2,negative,2,poor,2

User spesific settings

These settings can be used in all preference topics. Allthough changing them in the user topic makes most sense.

  • Maximum number of backlinks searched, zero disables the functionality
  • Theme chooser, options are plain and smiley (default shown here). Plain theme is implemented with standard HTML-submit buttons and in smiley they are styled.
  • Voting interface is not shown in system topics by default, setting this value to 1 changes the behaviour.
  • Changes the behaviour to take account the reputation of voters, all the following options are dependent on this option
  • Users with a trust value below 500 are considered as noise by default. This option controls whether we ignore these untrusted users or count their votes with negative value.
  • This changes the way we handle recommendations, all the recommendations from users with trustvalue below this are not taken into account. The default value is 1000 and the maximum value for trust in the plugin is 999, which means that recommendations are not used unless this parameter is defined. If this value is set below 500, which is the default value for user trust, the recommendations are calculated with negative value.
  • This option controls the weight given to trusted users
  • This option controls the weight of the unknown users (the trusted users are actually counted twice)

Included template topics

TWiki06x00.ReputationPluginChangeValues provides an easy to use interface for making manual adjustments to trust relations. TWiki06x00.ReputationPluginToplist see all the ratings in a single web at once.

Plugin Installation Instructions

Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the TWiki server.

  • Download the ZIP file from the Plugin Home (see below)
  • Unzip in your twiki installation directory.
  • Configure the Plugin:
    • Run the configure script to enable the Plugin
    • Change the Plugin settings as needed
  • Test if the installation was successful:
    %REPUTATION{rpaction="%URLPARAM{rpaction}%" vote="%URLPARAM{vote}%"}%
%REPUTATION{rpaction="" vote=""}%

Make the plugin appear on every page

Inside the zip file is a skin template that makes this plugin to show up just before the topic's text content. Skin can be enabled for a web (For all webs Main.TWikiPreferences for a single web, for example Sandbox web WebPreferences ) or for a single topic in Topic's preferences.

   * Set SKIN = reputation,pattern 
It is possible to put the SKIN setting to a user topic as well (guest). However, this means that only the users who have the SKIN enabled can see the submitted reviews in topics and webs which do not have this setting.

Skin can be excluded from any topic, user or web by setting the skin preference without ReputationPlugin's skin eg:

   * Set SKIN = pattern 

ALERT! Note about the template system: This skin defines the content part of the TWiki page, if you have some other plugin or template which defines this part of the page you will have to do some manual editing.

Plugin Info

Plugin Author: TWiki:Main.JoonaKannisto
Copyright: © 2009-2011 TWiki:Main.JoonaKannisto
© 2009-2011 TWiki:TWiki.TWikiContributor
License: GPL (GNU General Public License)
Plugin Version: 2011-05-14 (V1.2)
Change History:  
2011-05-14: TWikibug:Item6701: Doc improvements; small fix in Config.spec -- TWiki:Main.PeterThoeny
2010-12-08: Many new features and improvements
2010-07-26: TWikibug:Item6532 - move to SVN repository; doc fixes; changing TWIKIWEB to SYSTEMWEB
2009-11-24: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.2
CPAN Dependencies: Locale::Maketext HTML::Entities
Other Dependencies: none
Perl Version: 5.005
TWiki:Plugins.Benchmark: GoodStyle nn%, FormattedSearch nn%, ReputationPlugin nn%
Plugin Home:

Related Topics: ReputationPluginChangeValues, ReputationPluginInfofi, ReputationPluginInfo, ReputationPluginToplist, ReputationPluginVotedfi, ReputationPluginVoted, TWikiPlugins, DeveloperDocumentationCategory, AdminDocumentationCategory, TWikiPreferences

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatmd5 ReputationPlugin.md5 r7 r6 r5 r4 r3 manage 0.2 K 2011-05-15 - 06:09 PeterThoeny  
Compressed Zip archivetgz ReputationPlugin.tgz r7 r6 r5 r4 r3 manage 75.2 K 2011-05-15 - 06:08 PeterThoeny  
Compressed Zip archivezip r10 r9 r8 r7 r6 manage 85.5 K 2011-05-15 - 06:08 PeterThoeny  
Unknown file formatEXT ReputationPlugin_installer r3 r2 r1 manage 5.6 K 2011-05-15 - 06:09 PeterThoeny  
Texttxt r1 manage 5.6 K 2011-04-28 - 12:22 JoonaKannisto  
Edit | Attach | Watch | Print version | History: r15 < r14 < r13 < r12 < r11 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r15 - 2013-10-16 - PeterThoeny
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2015 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.