FixPP
Adds missing protection templates and removes them after the protection expired.
To disable, set /Run to anything other than true
(link)
Errors are logged at /Error log
Functionality can be tweaked at /config. Configuration data is in the form of JSON.
IMPORTANT:
"option": true
instead of option: true
."option"
instead of 'option'
.true
or false
with no quotations around it.Name | Description |
---|---|
remove_all_if_expired | Remove all protection templates if the page is not protected in any form, plain and simple. |
remove_individual_if_expired | Remove any individual protection templates for which there is no corresponding protection type. E.g. if the page is move-protected but not edit-protected, remove pp-blp but leave pp-move, if present, as opposed to taking no action at all. remove_all_if_expired has precedence over this option. |
auto_generate | If the bot is unable to figure out what the protection template is supposed to represent, replace it with valid auto-generated protection templates based on the current protection. E.g. if the page is edit-protected and ((pp|action=invalid_action)) is present, it will be replaced with ((pp-protected|expiry=00:00, 1 January 1970|small=yes)) (with the correct expiry). |small=yes is assumed to be desirable if no falsy value for small is provided.
|
noinclude_in_template_space | Wraps protection templates in <noinclude>...</noinclude> if the page is in the template namespace, or places it in an existing <noinclude>...</noinclude> if one is present at the very beginning of the template source.
|
remove_from_template_space_if_doc_present | Remove protection templates from pages in the template namespace if the page contains ((documentation)) (or any of it's redirects) or ((collapsible option)) (or any of it's redirects), as these templates automatically generate the padlock icon. |
normalize_pp_template | Normalize usage of ((pp)). E.g. ((pp|sock|expiry=January 1, 1970)) will be converted to ((pp-sock|expiry=00:00, 1 January 1970)). Strips out usage of non-critical parameters such as |user= , |section= , |category= , etc., as these may not be supported in the normalized template.
|
The bot's ability to handle all types of protection templates depends on it knowing what the core templates are, from which it collects all of their redirects. The base_protection_templates hash specifies each of these templates, none of which are redirects, and their type of protection. For example, ((pp-semi-BLP)) redirects to ((pp-blp)), and pertains only to edit protection, as opposed to ((pp-move)) which pertains to move protection.
There is, or should only be, a single template that can represent multiple types of protection, which is ((pp)). For this, the corresponding value in the hash is an empty string. If another key is added to the has with an empty string value it will be treated and parsed the same way ((pp)) is. Note many templates redirect here, such as ((pp-protected)).
This set of templates and their types should very rarely change. It should more or less match the table at Template:Protection templates, with some important exceptions.
IMPORTANT:
Some protection templates are deliberately left out. These include:
Name | Description |
---|---|
small_values | Valid truthy values that can be passed to |small= in protection templates
|
pp_reasons | List of reasons from Template:Pp#Reasons that can be mapped to their own template. E.g. ((pp|sock)) can be normalized to ((pp-sock)). See info on core templates above, as some are deliberately excluded such as "mainpage" and "office" |