Text has been copied to or from this page; see the list below. The source pages now serve to provide attribution for the content in the destination pages and must not be deleted as long as the copies exist. For attribution and to access older versions of the copied text, please see the history links below.
Template:High-use is permanently protected from editing because it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases.
Use on taxonomy templates
Taxonomy templates, i.e. templates like Template:Taxonomy/Otophysi, are part of the WP:Automated taxobox system. They function like database entries and are used by the system to construct automated taxoboxes. Neither sandboxes nor testcases make much sense for taxonomy templates, because the potential effects of a change to a taxonomy template can only be fully seen by looking at the resulting taxoboxes created by the automated taxobox system. Accordingly, I'm experimenting in this module's sandbox with constructing a different message when invoked from a taxonomy template.
Instead of just taking the number of transclusions and dividing by {{NUMBEROFPAGES}} (which is currently 63,227,481), I was thinking it might make for a more cautionary warning to also show how big the number is compared to {{NUMBEROFARTICLES}}. See [1] for the sandboxed change. Basically, this would cause the template to look like this:
Naturally, not all templates that use {{High-use}} are used in mainspace, so I can see how this change could be a little confusing, but I think it would still make the percent number more meaningfully cautionary. For example, Template:Short description says that the template is used on "10% of all pages", which honestly feels like not a big number—it would more clearly impress upon the layperson the gravity of the situation if it said "92% of all mainspace articles". Template:WikiProject banner shell would say: "This template is used on approximately 11,300,000 pages, which is roughly 161% of all mainspace articles or 18% of all pages." Mz7 (talk) 06:50, 29 May 2025 (UTC)[reply]
@Mz7 I'm worried that would be a bit misleading, as it would result in things like {{WikiProject banner shell}} saying that it's being used on 163% of mainspace articles. If there's a strong desire to include this information I could look into having Ahechtbot tabulate mainspace transclusions in addition to all transclusions, but that would cause a significant increase in runtime and require breaking changes to the data pages. --Ahecht (TALK PAGE)18:13, 29 August 2025 (UTC)[reply]
TemplateStyles
There are a few high-use template styles, e.g., Template:Sister project/styles.css, which have no such indication (as they do not have documentation subpages). In my own private wiki, I have provided an analogous notice via the top icon indicator as these are still processed within CSS comments. My Module:High-use has been changed as follows:
localfunctionshowIndicator()returnmw.getCurrentFrame():preprocess([=[{{#tag:indicator|<spanclass="plainlinks"style="background-color:pink;">[[WP:High-risk templates|High-use]]:[https://linkcount.toolforge.org/?project=en.wikipedia.org&page={{urlencode:{{FULLPAGENAME}}}}#transclusions{{#invoke:transclusioncount|fetch}}]</span>|name=High-use}}]=])endfunctionp._main(args,nocat)localcontentModel=mw.title.getCurrentTitle().contentModelifcontentModel=="css"orcontentModel=="sanitized-css"thenreturnshowIndicator()end-- remainder of function
This template must be followed by a complete and specific description of the request, so that an editor unfamiliar with the subject matter could complete the requested edit immediately.
Edit requests to template-protected pages should only be used for edits that are either uncontroversial or supported by consensus. If the proposed edit might be controversial, discuss it on the protected page's talk page before using this template. Consider making changes first to the module's sandbox before submitting an edit request. To request that a page be protected or unprotected, make a protection request. When the request has been completed or denied, please add the |answered=yes parameter to deactivate the template.
Description of suggested change: I've refactored the module code to make it:
easier to understand (added comments)
easier to localize
have less repeated code
use |demo= as the title everywhere, including in the Toolforge link, if provided
use the base page for /testcases pages as well as /doc and /sandbox
Add require('strict') which will help find globals that ought not be globals, etc.
For i18n, consider rewriting count_from_args() (lines 18–36 – permalink); mayhaps sommat like this:
require('strict');locallang_obj=mw.getContentLanguage()-- this here because the language object is used multiple places in the modulelocalfunctioncount_from_args(args_t)iftonumber(args_t.count)then-- check if function has already been usedreturncount;-- early exit if already usedendlocalcount;ifcount==nilandyesno(args_t['fetch'])==truethen-- '== true' instead of '~= false'count=_fetch(args_t)-- fetch transclusion countendifcount==nilandargs_t[1]~=nilandargs_t[1]~=''then-- use explicitly-provided count when fetch failscount=math.floor(lang_obj:parseFormattedNumber(args_t[1]));-- convert local language number string to a number understandable by luaendreturncount>0andcountornil;-- incase someone writes a negative numberend
It looks like you've implemented hooks to show percentage of articles in addition to all pages. See the section above for my concerns there. We can tabulate mainspace usage separately with the bot, but it's not worth the effort unless there's actual consensus to include it. --Ahecht (TALK PAGE)19:09, 29 August 2025 (UTC)[reply]
@CalendulaAsteraceae My only concern is using the base page name for the sandbox. There are sub-templates that are listed in Module:Transclusion_count/data/ that likely have their own sandboxes. For example, the "high use" message at Module:Adjacent stations/Amtrak correctly links to Module:Adjacent stations/Amtrak/sandbox. For the sandbox, the existing logic that only uses the basePageTitle if it ends in "doc" or "sandbox" is fine. For the testcases, I might see an argument to strip "doc" and "sandbox", check if that testcases page exists (although I'd do it with getContent() since for some reason exists is expensive but getContent() isn't), and if not use the base page title. --Ahecht (TALK PAGE)15:39, 14 September 2025 (UTC)[reply]