MediaWiki extensions manual
Release status: beta
Implementation Special page , Database
Description Adds includable Special:Petition to collect signatures for a petition, and Special:PetitionData for authorised users to download signatures as a CSV file.
Author(s) Peter Coombe (Pcoombe (WMF)talk)
MediaWiki 1.33+
PHP 5.4+
Database changes Yes
Tables petition_data
License GNU General Public License 2.0 or later
  • $wgPetitionCountCacheTime
  • $wgPetitionDatabase
Quarterly downloads 2 (Ranked 162nd)
Translate the Petition extension if it is available at translatewiki.net
Issues Open tasks · Report a bug

The Petition extension allows the collection of signatures (consisting of name, email, country and an optional personal message) for a petition. It adds Special:Petition which provides a form for signature collection, this is includable (and will normally be used that way). The extension also adds Special:PetitionData where authorized users can download the signatures as a csv file. The extension is initially intended to be deployed on https://wikimediafoundation.org.

Installation Edit

  • Download and place the file(s) in a directory called Petition in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'Petition' );
    $wgGroupPermissions['petitiondata']['view-petition-data'] = true;
  • Run the update script which will automatically create the necessary database tables that this extension needs.
  • Yes 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( 'Petition' );, you need to use:

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

User rights Edit

  • view-petition-data allows a user to view the log of signatures, and to download signatures for all petitions. Note that this can include real names and email addresses, so should be granted only to trusted users.

Features Edit

  • Multiple named petitions can be created e.g. {{Special:Petition/freepuppies}} The petition name will be recorded with each signature.
  • A second parameter can be provided which will be recorded with signatures as the 'source'. So for example it is possible to include {{Special:Petition/freepuppies/a}} on one page and {{Special:Petition/freepuppies/b}} on another. Then in the results all signatures will be under the "freepuppies" petition, but it will also be possible to see which page the signatures were made on. This makes A/B testing possible.
  • Petition signatures (time and username/IP address) are logged in a private log, only visible to users with the view-petition-data right. There is also integration with Extension:CheckUser if it is installed on the wiki.

Dependency Edit

See also Edit