Extension:WatchAnalytics

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

Release status:Extension status beta

WatchAnalytics reviewership visualization.png
ImplementationTemplate:Extension#type Special page, User activity, Notify
DescriptionTemplate:Extension#description Encourages good distribution of watchers
Author(s)Template:Extension#username James Montalvo (Jamesmontalvo3talk)
PHPTemplate:Extension#php 5.3+
Database changesTemplate:Extension#needs-updatephp Yes
LicenseTemplate:Extension#license MIT License
Download
README
ParametersTemplate:Extension#parameters
  • $egWatchAnalyticsPageScoreNamespaces
  • $egPendingReviewsEmphasizeDays
  • $egPendingReviewsNumberWatchSuggestions
  • $egPendingReviewsShowWatchSuggestionsIfReviewsUnder
  • $egWatchAnalyticsWatchQualityColors
  • $egWatchAnalyticsReviewStatusColors
Added rightsTemplate:Extension#rights

viewpagescore

Hooks usedTemplate:Extension#hook
PersonalUrlsManual:Hooks/PersonalUrls
BeforePageDisplayManual:Hooks/BeforePageDisplay
ParserFirstCallInitManual:Hooks/ParserFirstCallInit
TitleMoveCompleteManual:Hooks/TitleMoveComplete
ArticlePageDataBeforeManual:Hooks/ArticlePageDataBefore
PageContentSaveCompleteManual:Hooks/PageContentSaveComplete
MagicWordwgVariableIDsManual:Hooks/MagicWordwgVariableIDs
ParserBeforeTidyManual:Hooks/ParserBeforeTidy
LoadExtensionSchemaUpdatesManual:Hooks/LoadExtensionSchemaUpdates

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

Check usage and version matrix.

The WatchAnalytics extension leverages the watchlist table to show statistics on how well-guarded an individual page and the wiki as a whole is, as well as to invite users to watch and review neglected pages.

Development status[edit]

Currently this extension is considered to be beta quality. A version of this extension is in heavy usage within the author's corporate environment. Newer versions need to be better tested and documented before they can be considered "stable", and in future improvements development versions need to be separated from the stable master version.

Additionally, there is very little consideration currently for making this extension configurable for Internet-facing, public wikis. All features were designed with enterprise use in mind, and before calling this stable configuration options must be available to protect users' privacy.

Installation[edit]

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

Configuration[edit]

  • $egWatchAnalyticsPageScoreNamespaces: an array to specify what namespace to display page scores. Default is just the main and talk namespaces (NS_MAIN, NS_TALK)
  • $egPendingReviewsEmphasizeDays: After how many days should the pending reviews link in the top-right become bigger and threateningly shake at the user. To disable this feature set this value to zero.
  • $egPendingReviewsNumberWatchSuggestions: how many pages to show in Pending Reviews. This should also be user-configurable.
  • $egPendingReviewsShowWatchSuggestionsIfReviewsUnder: When number of pending reviews is under this number, show Watch Suggestions. Set to zero to disable. Default is 5.
  • $egWatchAnalyticsWatchQualityColors and $egWatchAnalyticsReviewStatusColors: arrays used to define how to color page scores.

Usage[edit]

Page scores[edit]

On each page in the main namespace (or any namespace added to the $egWatchAnalyticsPageScoreNamespaces variable) two scores are displayed near the heading which indicate how well the page is being watched in general (the "scrutiny") and the total number of people who have reviewed the latest version of the page. Clicking on these scores brings you to the PageStatistics special page.

Showing page scores added by Watch Analytics
Showing page scores added by Watch Analytics

Special:PageStatistics[edit]

Provides explanations of what "scrutiny" and "reviewers" mean. Below this it lists the page editors in order of number of revisions, who is watching the page, and whether or not they have reviewed the latest revision. At the bottom of the page it has a chart showing how many reviewers the page had at any given time in the past. In future versions this data will be used to determine an average length of time for the page to get n-reviewers, thus making it possible to find pages that tend to not be reviewed quickly.

Special:WatchAnalytics[edit]

The WatchAnalytics special page provides information about pages, users and the overall state of watchers on the wiki.

Page information[edit]

For pages it provides information like the number of people watching, the number people who have reviewed the latest revision, and the "watch quality" of the page. Watch quality refers to how well the watchers of the page do at quickly reviewing changes to the page. Right now the algorithm for this number is pretty poor, and in future uses it will hopefully provide better page scoring.

User information[edit]

Provides similar information but for users. This includes how many pages the user is watching, how many pending reviews they have, how long their oldest review is, etc. This table can be filtered by user group and page category, which can be helpful to see how sub-organizations (e.g. creating a group type "Engineering") are doing at watching certain pages.

User-page relationship visualization[edit]

A D3.js force-directed graph showing how users are watching pages. Users are represented by orange dots around the outside, and pages are represented by blue dots. Lines between users and pages indicate that the user is watching the page. If the line is red it means that the user has not seen the most recent version of the page. Note that this visualization will not work well for very large wikis.

Watch analytics visualization
A D3.js force-directed graph showing the watch-relationship between users and pages.

Special:PendingReviews[edit]

This special page is a simplified version of Special:Watchlist. Special:Watchlist is very daunting for new editors and has a lot of unnecessary information even for seasoned editors. Pending Reviews shows which pages the user has not seen the latest version (of pages in the user's watchlist). These pages are prioritized by how important it is for the wiki to have the page reviewed, which right now is entirely determined by how many people have reviewed the page. In the future it will hopefully take into account revision scoring methods.

Watch suggestions[edit]

Below the user's list of pending reviews there are suggestions for other pages the user should watch. These are determined by finding all pages linked to or from the user's watchlist. These pages are then ranked by how many watchlist pages link to/from the page, how many watchers the page currently has, and how much traffic the page gets. Pages with few watchers and a lot of traffic are thus highly prioritized.

Maintenance scripts[edit]

forgivePendingReviews.php
used to clear reviews. This script has not been used by the author in a long time, and users should only execute it after backing up their database. Make sure it does what you want before using.
watchAnalyticsRecordState.php
records the user and page watch state (how many watchers, how many pending, etc).

addCategoryToWatchlist.php

Adds every page in a category (or categories) to a user's (or multiple users') watchlist. Called like: php addCategoryToWatchlist.php --usernames=Jamesmontalvo3,Darenwelsh --categories="List of ISS Spacewalks,Astronauts"

Future considerations[edit]

  • Add user preferences to allow users to choose to use Pending Reviews or not
  • Allow user to choose how many results to display in Pending Reviews
  • Add pagination to Pending Reviews (currently no way to see beyond your 20 reviews)
  • Allow disabling of the force-directed graph visualization (since it may not work with large wikis)