Extension:SpecialDeleteOldRevisions2
|
|
WARNING: the code or configuration described here poses a major security risk.
Problem: Vulnerable to SQL injection attacks, because it passes user input directly into SQL commands. This may lead to user accounts being hijacked, wiki content being compromised, private data being leaked, malware being injected, and the entire wiki content being erased, among other things. |
|
SpecialDeleteOldRevisions2 Release status: unstable |
|
|---|---|
| Implementation | Special page |
| Description | delete old revisions of all, or of specified articles |
| Author(s) | http://jehy.ru/index.en.html (JehyTalk) |
| Last version | 1.4.4 (2010-09-14) |
| MediaWiki | 1.13 ; not compatible with 1.19 |
| License | GPL |
| Download | version 1.4.4 readme |
|
Check usage (experimental) |
|
SpecialDeleteOldRevisions2 deletes permanently all old revisions of some or all article(s), meaning only the current version will remain in the system. This function is useful for systems, where you do not need a history of the articles and want to reduce the size of the database.
What it does not do: You can not choose a certain revision (check Oversight for that functionality).
This extension adds a special page accessible to sysops only. Note: Recent changes records are not cleared! If you want to delete them, just truncate table "recentchanges"
To do this from sqlite, use "delete from recentchanges;" If you're purging the deletion log, and everything else, during a wiki wipe/redeployment, then also use "delete from logging;"
Contents |
[edit] Disclaimer
This extension is a fixed version of abandoned extension Extension:SpecialDeleteOldRevisions. Since it has not been updated for several years, I took responsibility, fixed known bugs and published it here. I will continue to monitor and update it in the future. This extension does not work on mediawiki extensions earlier than 1.12. For earlier versions, use the original extension.
If you have any questions - look at original extension page and discussion page first.
[edit] Usage
First please make a backup of your database for safety reasons. You need to be logged in as sysop. Under special pages you will find the Delete old revision page in the sysop section.
- page: specify the pages to be deleted, % for all pages.
- namespace: specify the namespace for the articles, check all for all namespaces.
- up to date: specify the date of the revisions. All revision before and on that date will be deleted.
- Delete archived articles: If this is checked all already deleted articles will be permanently deleted.
This extension will clear the tables: archive, page, revision, text, recent changes and logging.
If you for example want to delete all unused MediaWiki-Texts (which have been deleted after upgrading to 1.8) to shrink the database significantly, choose
- namespace
MediaWiki - article name
%
[edit] Installation
- Extract the archive into /extensions directory
- Add the following lines near the end in the LocalSettings.php file:
// Extension DeleteOldRevisions $wgGroupPermissions['sysop']['DeleteOldRevisions'] = true; require_once("$IP/extensions/specialdeleteoldrevisions2/SpecialDeleteOldRevisions2.php");
You can now access the Special:DeleteOldRevisions page as a sysop.
[edit] Optimizing tables
Since version 1.4.3, you don't need to optimize tables - it is done automatically.
[edit] Language tips
You can also translate this extension(here languages/messages/MessagesLANG.php), where LANG is your language code.
Inside $messages array add:
# Custom 'deleteoldrevisions' => 'Apagar Histórico', //'Delete old revisions' 'deleteoldrevisions-label' => 'Clique em \'Delete\' para apagar o histórico do wiki selecionado.', //'Click on \'Delete\' to delete the selected wiki\'s old revisions.' 'deleteoldrevisions-button' => 'Apagar histórico', //'Delete history' 'deleteoldrevisions-confirm' => "Tem certeza que deseja apagar todas as revisões selecionadas?\\nEssa operação não poderá ser desfeita.", //"Are you sure you want to delete all the selected revisions ?\\nThis operation cannot be undone." 'deleteoldrevisions-removalok' => "O histórico foi apagado com sucesso.", //"The old revisions were successfully deleted."
Inside $specialPageAlias array add:
# Custom 'DeleteOldRevisions' => array( 'Apagar Histórico', 'Eliminar Histórico' ),
[edit] Changelog
V1.2 Feb. 11, 2007: Gunter Schmidt Added deletion of recent changes, text and archive table Added selection on specific article name, namespace and date of revision Fixed bug with moved articles
V1.3 Feb. 24, 2007: Gunter Schmidt Small interface changes Bug with articles containing ' resolved Permission reworked
V1.4 Nov. 12, 2008: Jehy Took maintenance, fixed bugs for mediawiki 1.13
v1.4.1 March 23, 2010: Jehy Fixed for last wiki release. Thanks to User:Athinker Changed class name from "HTMLForm" to "DeleteOldRevisions_HTMLForm" for compatibility with other plugins Also fixed one timestamp bug.
v1.4.2 ??? Some very anonymous guy made several fixes. Looked through those - those are fine. Also, he added French translation. Thanks to him.
v1.4.3 September 12, 2010: Jehy Several little fixes: for strict warning, page title. Added automatic table optimization.
v1.4.4 September 21, 2010: Jehy Added MySQL database detection to avoid crashes when using other databases. Fixed setting wrong page title for pages other then extension's. Also, replaced "distinctrow" with "distinct" for compatibility with Postgres.
