MediaWiki extension


MediaWiki extensions allow MediaWiki to be made more advanced and useful for various purposes. These extensions vary greatly in complexity. The Wikimedia Foundation operates a Git server where many extensions are hosted, and a directory of them can be found on the MediaWiki website. Some other sites also are known for development of—or support for—extensions are MediaWiki.org, which maintains an extension matrix; and Google Code. MediaWiki code review is itself facilitated through a Gerrit instance. Since version 1.16 MediaWiki also used the jQuery library.

Usage

A person with administrative FTP or file system access to the wiki directories can install extensions manually by downloading them to the appropriate directories and using a text editor to add require once lines to the LocalSettings.php file to cause the extension code to be included and evaluated. Some extensions also have configuration settings that are set and changed by editing this file. There is also an extension, Configure, that allows other extensions to be more easily managed. A better extension management platform is under development.

Kinds of extensions

Parser functions

Among the most popular extensions is a parser function extension, ParserFunctions, that allows different content to be rendered based on the result of conditional statements. These conditional statements can perform functions such as evaluating whether a parameter is empty, comparing strings, evaluating mathematical expressions, and returning one of two values depending on whether a page exists. It was designed as a replacement for a notoriously inefficient template called . Schindler recounts the history of the ParserFunctions extension as follows:
Another parser functions extension, StringFunctions, was developed to allow evaluation of string length, string position, and so on. Wikimedia communities, having created awkward workarounds to accomplish the same functionality, clamored for it to be enabled on their projects. Much of its functionality was eventually integrated into the ParserFunctions extension, albeit disabled by default and accompanied by a warning from Tim Starling that enabling string functions would allow users "to implement their own parsers in the ugliest, most inefficient programming language known to man: MediaWiki wikitext with ParserFunctions."

Academic and encyclopedia-related data display

Another very popular extension is a citation extension that enable footnotes to be added to pages using inline references. This extension has, however, been criticized for being difficult to use and requiring the user to memorize complex syntax. A tool called ProveIt was proposed as a replacement. A gadget called has also been created to make it easier to create citations using common templates. MediaWiki has some extensions that are well-suited for academia, such as mathematics extensions and an extension that allows molecules to be rendered in 3D.

Integration

A generic Widgets framework has been created that allows MediaWiki to integrate with virtually anything. Other examples of extensions that could improve a wiki are category suggestion extensions and extensions for inclusion of Flash Videos, YouTube videos, and RSS feeds. An extension to integrate with Facebook is forthcoming. Metavid, a site that archives video footage of the U.S. Senate and House floor proceedings, was created using code extending MediaWiki into the domain of collaborative video authoring. One extension, Viskimap, makes use of graphic organizers to visualize the relationships between content pages, so that students can easily get an understanding of the content elements and their relations, as they navigate through the wiki pages.

Combating spam

There are many spambots that search the Internet for MediaWiki installations and add linkspam to them, despite the fact that MediaWiki uses the nofollow attribute to discourage such attempts at search engine optimization. Part of the problem is that third party republishers, such as mirrors, may not independently implement the nofollow tag on their websites, so marketers can still get PageRank benefit by inserting links into pages when those entries appear on third party websites. Anti-spam extensions have been developed to combat the problem by introducing CAPTCHAs, blacklisting certain URLs, and allowing bulk deletion of pages recently added by a particular user.

Searches, queries and data processing and aggregation

MediaWiki's weak query functionality, based mostly upon text searches, has inspired the creation of extensions adding complex new behavior to the wiki syntax. Systems which assist in analyzing relationships among editors, articles, revisions, topics, and words have attracted considerable attention from the academic community, both in terms of papers published and programming projects attempted. They have been deemed necessary in order for the software to be suitable for applications such as some scientific databases.
Example of extensions facilitating such analyses include Semantic MediaWiki, which provides the ability to add structured and searchable relations and attributes to wiki pages, and WikiTrust, which implements a system for checking the author, origin, and reliability of wiki text. SNPedia, NeuroLex, and DBpedia are projects along these lines. A Software Organization Platform, intended to support specific software engineering activities such as experience management, requirements engineering, or project management, was based upon Semantic MediaWiki. Another wiki, SynBioSS Wiki, whose purpose is to enable the scientific community to store and retrieve information related to synthetic biology efforts, likewise sought to overcome MediaWiki's limitations in this regard by creating database fields for species ids, complex ids, etc.; new species and such could be added through a special page. A modified MediaWiki search engine was also part of that project. SMW was itself extended by the introduction of content types, bidirectional relationships, controlled vocabularies, user-friendly user interfaces, and Web 2.0 techniques for visualization and interaction options.
An extension called Woogle was created in an attempt to combine the advantages of wikis in capturing new information in a lightweight and collaborative fashion and of enterprise search engines in locating existing documents and information in an organization. Since by default, creating and changing tables is a manual process, with inconsistencies likely to occur among tables that display the same data in different ways, the DynaTable extension was created to provide wiki users with a convenient way to define data in a separate namespace, resulting in the data being stored in a database table, and have it be dynamically retrieved from the database at the time of the wiki page parsing or rendering, to pages that have the appropriate tag. The extension also allows users to filter tables by selecting a subset of columns and rows to display.
An extension-based system known as Annoki was developed to help attribute specific parts of articles to specific authors. If more than 50% of a sentence was added by a particular editor, that sentence was deemed to be "owned" by that editor. If less than 50% was added by an editor, that editor was deemed to be a proofreader of that sentence. The system also viewed a series of edits made by the same author as a continuous editing effort and defined a wiki page "release" as the last of these sequential revisions.