User:The Earwig/Sandbox/TIF

Template Influence Factor (TIF) is a metric that can be used to identify high-risk templates for protection against vandalism. It is more effective than plain transclusion count because it is concerned with the expected number of readers who will see vandalism before it is removed. A template transcluded on ten of the top-100 most visited pages is substantially higher risk than one transcluded on 10,000 pages that receive only a few views per week.

A template's TIF is defined as the total number of page views received over a period of time by all articles that transclude the template. We use views per minute by convention, averaged over the past thirty days for each article. For simplicity, we are only concerned with pages that currently transclude the template.

Suppose template X has a TIF of 100 views/minute. If it is vandalized and reverted within a minute, we can estimate that 100 readers will have seen the vandalism. Similarly, if vandalism to template Y with a TIF of 0.5 views/min takes an hour to be reverted, about 30 readers will have seen it.

A TIF calculator is available.

Data
The TIFs, mainspace transclusion counts, and current edit protection level of sample templates is provided below for comparison.

The quartiles of the TIFs for all templates with each protection level is given below:

Last updated: 01:56, 2 February 2016 (UTC)

Caveats
Protecting high-risk templates shouldn't be an automated process only based on transclusion count, TIF, or any other single factor. Important things to consider:


 * Are the template's main contributors non-admins/TEs/autoconfirmed users?
 * Is it something a novice would want to edit (for example, data subpages of modules), or is it fairly esoteric?
 * Is it complex enough to warrant frequent changes or is it mostly a wrapper around other code?

In other words: this process is an exception to the usual rule against preemptively protecting pages, and should be treated carefully. Avoid using template-editor protection just because you can; it should be reserved for especially high-risk pages, and semi-protection is usually more than sufficient unless there is real evidence of vandalism coming from autoconfirmed accounts.

Beans?
Security through obscurity. Persistent template vandals are not stupid; they know how to find unprotected templates that will cause a lot of damage if abused. By raising awareness of methods for detecting these in advance, we can better secure ourselves and prevent messes like all of these.