Extension:Moderation

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

Release status:Extension status stable

Special Moderation screenshot.png
ImplementationTemplate:Extension#type Special page
DescriptionTemplate:Extension#description Sends all edits and uploads from new users to moderation.
Author(s)Template:Extension#username Edward Chernenko
Latest versionTemplate:Extension#version 1.0.0 (2016-12-28)
MediaWikiTemplate:Extension#mediawiki 1.23+
PHPTemplate:Extension#php 5.3+
Database changesTemplate:Extension#needs-updatephp Yes
TablesTemplate:Extension#table1 moderationExtension:Moderation/moderation table
moderation_blockExtension:Moderation/moderation_block table
LicenseTemplate:Extension#license GNU General Public License 3.0 or later
Download
ParametersTemplate:Extension#parameters
  • $wgModerationEnable
  • $wgModerationTimeToOverrideRejection
Added rightsTemplate:Extension#rights
  • moderation
  • skip-moderation
  • moderation-checkuser
Hooks usedTemplate:Extension#hook
AddNewAccountManual:Hooks/AddNewAccount
AlternateEditManual:Hooks/AlternateEdit
ApiBeforeMainManual:Hooks/ApiBeforeMain
ApiCheckCanExecuteManual:Hooks/ApiCheckCanExecute
AuthPluginAutoCreateManual:Hooks/AuthPluginAutoCreate
BeforePageDisplayManual:Hooks/BeforePageDisplay
CheckUserInsertForRecentChangeManual:Hooks/CheckUserInsertForRecentChange
EditFilterManual:Hooks/EditFilter
EditFormInitialTextManual:Hooks/EditFormInitialText
EditFormPreloadTextManual:Hooks/EditFormPreloadText
EditPage::showEditForm:fieldsManual:Hooks/EditPage::showEditForm:fields
LoadExtensionSchemaUpdatesManual:Hooks/LoadExtensionSchemaUpdates
NewRevisionFromEditCompleteManual:Hooks/NewRevisionFromEditComplete
PageContentSaveManual:Hooks/PageContentSave
PageContentSaveCompleteManual:Hooks/PageContentSaveComplete
RecentChange_saveManual:Hooks/RecentChange_save
UploadVerifyFileManual:Hooks/UploadVerifyFile
getUserPermissionsErrorsManual:Hooks/getUserPermissionsErrors

Incompatible with upload extensions (forms replacing Special:Upload, e.g. Extension:MultiUpload).

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

Check usage and version matrix.

The Moderation extension provides protection against vandalism for small and medium wikis.

This is one of the most effective anti-vandal protection methods and has very little impact on legitimate users.

Introduction[edit]

How does it work?
  1. Every edit (or image upload) by a new user is being sent to moderation.
  2. Until the moderator approves this edit, the page is unchanged. Pending edit is neither in page history nor on RecentChanges.
  3. The user can see his/her edit and continue editing his/her own version of the page.
How do the admins moderate?
  1. New special page is provided (Special:Moderation). It's much like the RecentChanges, but has "Approve", "Reject", "Approve all" and "Reject all" buttons.
  2. Rejected edits go into the rejected archive.
  3. Approved edits are applied normally.
  4. Logs "who approved what" are maintained. Only the moderators can see them.
  5. If edit conflict is detected and it can't be resolved automatically, the moderator has the Merge button to apply the edit manually.
Why is it good?
  1. New users are not discouraged by annoying captchas, phone number verifications, etc. They edit normally, like they would do in MediaWiki without moderation.
  2. Blocks become practically obsolete. And blocks are not good (consider the chance of hitting a legitimate user with a range block, or inability to allow good edits from a not-very-adequate user who sometimes has the urge to vandalize a page or two).
  3. Vandalism out of "wanting to be noticed" is discouraged. Noone would sit for 5 hours looking for new and new proxies to make admin angry, if it's known that all those actions are not a problem.
  4. Vandalism methods like "vandalizing one page from two accounts to prevent one-click rollback" are no longer effective.
  5. Website can operate in anonymous networks like TOR or I2P.

Alternatives[edit]

Moderation log

Does MediaWiki have other counter-vandalism methods? In brief - not really.

MediaWiki was developed for Wikipedia. At any given time, Wikipedia has hundreds of volunteers willing to revert vandalism in real time. Almost every other wiki besides Wikipedia doesn't have that kind of advantage. The built-in counter-vandalism idea of MediaWiki is that vandalism takes more time than reverting it. Normally that's true, but this does poor job at discouraging vandalism, and the admins still have to check for vandalism in real time, even if the reverting itself doesn't take much of their time.

There are three known methods of fighting vandalism:

  1. Make all edits hard. For example, Lurkmore.to imposes a strong captcha on all edits from new users, and it takes a lot of edits to finally be able to edit without the captcha. Therefore the vandal has to spend a lot of time to do a handful of edits.
    The obvious minus is that all legitimate users have to bypass the captcha as well, which could discourage minor edits like spelling fixes.
  2. Enforce user identification - for example, login via Facebook. If the social network verifies that all its users have a valid mobile phone number, then each vandalism attempt requires the vandal to go to the shop and buy a new SIM card. This method is extremely effective, though eliminates the anonymous editing and turns away the users who don't have an account in any supported social network.
    A strong minus of this method is the impact on users' privacy. In non-democratic countries editing a page on politics can result in government trying to identify and persecute the user. For example, Lurkmore.to was contacted by Russian "anti-extremist special force" with demands to disclose information about the authors of pages about Ramzan Kadyrov and Molotov cocktail.[1]
  3. Mitigate the results of vandalism. For example, a user can create 100 pages with offensive titles, but they can all be deleted by two clicks in Extension:Nuke. Moderation extension belongs to this category.

Is this extension stable?[edit]

This extension is stable. It has been deployed in production on Russian Uncyclopedia (absurdopedia.net) since November 2014.

The extension has an automated testsuite with significant coverage. See README.testsuite for details. Every change to Moderation is automatically tested on:

  1. newest version of MediaWiki,
  2. MediaWiki 1.27 (LTS),
  3. legacy MediaWiki 1.23.

Please read the files KNOWN_LIMITATIONS, TODO and WONT_DO for all known issues. Feel free to contact the author if you have any questions.

Installation[edit]

  • Check-out the sources with git clone https://github.com/edwardspec/mediawiki-moderation.git and place the file(s) in a directory called Moderation in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'Moderation' );
    
  • Run the update script which will automatically create the necessary database tables that this extension needs.
  • YesY Done - Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

To users running MediaWiki 1.24 or earlier:

The instructions above describe the new way of installing this extension using wfLoadExtension() If you need to install this extension on these earlier versions (MediaWiki 1.24 and earlier), instead of wfLoadExtension( 'Moderation' );, you need to use:

require_once "$IP/extensions/Moderation/Moderation.php";
This extension should be enabled last in your "LocalSettings.php" file after all other settings and extensions.

Configuration[edit]

  • Parameters for LocalSettings.php:
    $wgModerationEnable 
    If set to false, then new edits are applied as usual (not sent to moderation). Default: true.
    $wgModerationTimeToOverrideRejection 
    Time (in seconds) after which rejected edit could no longer be approved. Default: 2 weeks.
  • User rights:
    skip-moderation 
    If the user has this right, his/her edits are applied as usual (not sent to moderation).
    moderation 
    Allows access to Special:Moderation.
    moderation-checkuser 
    Allows to see IPs of registered users on Special:Moderation.
  • Default settings are:
    • By default, two groups are created: moderator (has moderation right) and automoderated (has skip-moderation right).
    • By default, group checkuser has moderation-checkuser right.

Sample configuration[edit]

require_once "$IP/extensions/Moderation/Moderation.php";

$wgGroupPermissions['sysop']['moderation'] = true; # Allow sysops to use Special:Moderation
$wgGroupPermissions['sysop']['skip-moderation'] = true; # Allow sysops to skip moderation
$wgGroupPermissions['bot']['skip-moderation'] = true; # Allow bots to skip moderation
$wgGroupPermissions['checkuser']['moderation-checkuser'] = false; # Don't let checkusers see IPs on Special:Moderation

$wgAddGroups['sysop'][] = 'automoderated'; # Allow sysops to assign "automoderated" flag
$wgRemoveGroups['sysop'][] = 'automoderated'; # Allow sysops to remove "automoderated" flag

Additional anti-vandalism tips[edit]

In order to prevent vandalism, the following additional measures should be applied:

  1. Absolute MUST for any small/medium wiki (with or without the moderation): moving pages must be restricted to a trusted group. Page moves are currently not intercepted by Extension:Moderation, and they are a popular type of vandalism.
  2. Registering new accounts with offensive names is still a way for a vandal to show itself in the RecentChanges. A simple solution is to remove newusers log from RecentChanges:
    $wgLogRestrictions["newusers"] = 'moderation';
    

Recommended use / good practices[edit]

The following good-practices are advised:

  1. Only vandalism should be Rejected. Not-so-good edits with good intentions (e.g. adding excessive plot details into the Wikipedia article about film) are better made Accepted and then reverted as usual. This way the author is not offended and the text is saved in page history, viewable by anyone.
  2. Any user that is deemed legitimate (does N good edits) should be granted automoderated flag.
  3. Adding automoderated flag via $wgAutopromote is NOT recommended, as it motivates the vandals to do many very-minor edits (e.g. adding interwiki). Better grant the flag manually for one good edit and not grant it for 30 useless-edits-made-for-count.
  4. Abstain from using blocks. Don't protect pages "just in case", except maybe for important templates.
  5. Allow the full rehabilitation of users with bad history of editing. Their useful edits to the articles should be allowed, no matter how many times they were blocked. At the same time, trolling on talkpages should be rejected, so are the purposely-low-quality edits.

Compatibility with other extensions[edit]

  1. Extension:Moderation should be enabled last in LocalSettings.php, because it aborts at least PageContentSave hook.
  2. Extension:Moderation fully supports Extension:CheckUser, meaning that if CheckUser extension is enabled, then any approved edit will have correct IP, user-agent and XFF saved in the checkuser tables.
  3. Extension:Moderation is fully compatible with Extension:VisualEditor and Extension:MobileFrontend. Theoretically it should also work with other API-based editors.
  4. Extension:Flow will work, but edits in Flow forums will bypass moderation.
    Flow forums use a non-text "content model", which is not yet supported by Moderation.
  5. It's not a good idea to mix Extension:Moderation with upload extensions like Extension:MultiUpload.
    MediaWiki hook for uploads is not receiving all the necessary information (e.g. image description is not there). So we need to use upload form directly. Because of that, uploading via API is also disabled for users without skip-moderation right.

See also[edit]