Extension:WikimediaEditorTasks

MediaWiki extensions manual
WikimediaEditorTasks
Release status: beta
Implementation API , Database
Description Supports the Suggested Edits project of the Wikimedia Apps team.
Author(s) Michael Holloway
Latest version 0.1.0
Compatibility policy Snapshots releases along with MediaWiki. Master is not backward compatible.
MediaWiki 1.33+
Database changes Yes
Tables wikimedia_editor_tasks_counts
wikimedia_editor_tasks_edit_streak
wikimedia_editor_tasks_keys
License GNU General Public License 2.0 or later
Download
README.md
  • $wgWikimediaEditorTasksUserCountsDatabase
  • $wgWikimediaEditorTasksUserCountsCluster
  • $wgWikimediaEditorTasksEnableRevertCounts
  • $wgWikimediaEditorTasksEnableEditStreaks
  • $wgWikimediaEditorTasksEnabledCounters
Quarterly downloads 0
Translate the WikimediaEditorTasks extension if it is available at translatewiki.net
Vagrant role wikimediaeditortasks
Issues Open tasks · Report a bug

The WikimediaEditorTasks extension supports the Suggested Edits project of the Wikimedia Apps team. It provides an interface for defining specialized counters that tally edits per user with the desired characteristics. For example, a counter may be defined to count a user's edits via the wbsetdescription API module where the User-Agent begins with WikipediaApp.

If $wgWikimediaEditorTasksEnableEditStreaks is true, the extension will also keep track of "streaks" for each counter, i.e., consecutive days in which the contributor has made a qualifying edit.

These counts are exposed through the wikimediaeditortaskscounts API module.

Config edit

  • $wgWikimediaEditorTasksUserCountsCluster: The database cluster in which the tables can be found. If false, use the cluster of the current wiki. At Wikimedia, this is set to extension1. (Default: false)
  • $wgWikimediaEditorTasksUserCountsDatabase: The database in which the tables can be found. If false, use the current wiki database. At Wikimedia, this is set to wikishared. (Default: false)
  • $wgWikimediaEditorTasksEnabledCounters: List of enabled counter definitions, instantiated on demand by ObjectFactory. (Default: [])
    • Wikimedia's current configuration, for example:
[
    [
        'class' => 'MediaWiki\\Extension\\WikimediaEditorTasks\\WikipediaAppDescriptionEditCounter',
        'counter_key' => 'app_description_edits',
    ],
    [
        'class' => 'MediaWiki\\Extension\\WikimediaEditorTasks\\WikipediaAppCaptionEditCounter',
        'counter_key' => 'app_caption_edits',
    ],
    [
        'class' => 'MediaWiki\\Extension\\WikimediaEditorTasks\\WikipediaAppImageDepictsEditCounter',
        'counter_key' => 'app_depicts_edits',
    ],
],
  • $wgWikimediaEditorTasksEnableEditStreaks: Feature flag for edit streak counting. (Default: false)
  • $wgWikimediaEditorTasksEnableRevertCounts: Feature flag for revert counting. (Default: false)

Development edit

The recommended development environment for WikimediaEditorTasks is MediaWiki-Vagrant (see "Installation" below). The wikimediaeditortasks role pulls in the centralauth and wikidata roles, thereby automating a considerable amount of setup. (Note: A full development environment for Wikimedia requires setting up CentralAuth, WikibaseMediaInfo (Vagrant role mediainfo), and Wikidata. This requires either setting up the full environment manually, following the instructions for each extension, or hacking around conflicts between the wikidata and mediainfo Vagrant roles.)

Conceptually, the extension is very simple: it provides an abstract Counter base class that developers can subclass to implement logic defining whether to keep count of a given revision (and reverts to such revisions) per user. Counters may be registered in $wgWikimediaEditorTasksEnabledCounters. On PageSaveComplete, WikimediaEditorTasks iterates through each registered counter and determines whether the user's count should be iterated. If the new revision undoes another revision, the undone revision is examined to see if the undone revision author's count should be decremented. Revisions are also evaluated for possible decrementing for each registered counter on RollbackComplete.

The extension provides a few WikipediaApp- counters implementing the specific logic required by Android Suggested Edits. Each is a subclass of the abstract WikipediaAppCounter class, which in turn subclasses Counter.

  • WikipediaAppDescriptionEditCounter: Counts Wikidata description edits from the Wikipedia app per user. In technical terms, it counts revisions created through the wbsetdescription API module where the User-Agent begins with WikipediaApp.
  • WikipediaAppCaptionEditCounter: Counts structured image caption edits from the Wikipedia app per user. In technical terms, it counts revisions created through the wbsetlabel API module where the User-Agent begins with WikipediaApp.
  • WikipediaAppImageDepictsEditCounter: Counts Wikidata Depicts (P180) statements added from the Wikipedia app per user. In technical terms, it counts revisions where the User-Agent begins with WikipediaApp and the revision results from either a wbsetclaim request concerning P180 or a wbeditentity request adding a Depicts statement.

Installation edit

  • Download and move the extracted WikimediaEditorTasks folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/WikimediaEditorTasks
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'WikimediaEditorTasks' );
    
  • Run the update script which will automatically create the necessary database tables that this extension needs.
  •   Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.


Vagrant installation:

  • If using Vagrant , install with vagrant roles enable wikimediaeditortasks --provision

See also edit