Page MenuHomePhabricator

Special:NamespaceInfo should include counts of {{PAGESINNAMESPACE}}
Open, LowPublicFeature

Description

Feature summary:

In [[Special:Namespaceinfo]], it would be useful to know how many pages there are in each namespace.

There is a magic word {{PAGESINNAMESPACE}} but this is enabled by $wgAllowSlowParserFunctions which is false by default. This is old Technical-Debt that could be calculated more easily with some back-end changes; see T226667: Register namespaces in the database and T228559: Remove $wgAllowSlowParserFunctions.

This (or similar) could be still called here, even if the numbers are only updated periodically (e.g. once every 24 hours) to give a ballpark estimate.

There was an older suggestion to include this information in Special:Statistics, (T228554: Add pages per namespace counts to Special:Statistics) but this has been merged here since it seems to make more sense in Special:NamespaceInfo, which was fixed in 2020 with T263513: Create a Special:NamespaceInfo page, so didn't exist in 2019 when T228554 was filed.

Event Timeline

enabled by $wgAllowSlowParserFunctions which is false by default.

Please note https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#mw.site.stats.pagesInNamespace bypasses $wgAllowSlowParserFunctions and can be used in Wikimedia wikis.

only updated periodically (e.g. once every 24 hours) to give a ballpark estimate.

We can updated it real time if we have a place to store the count. Previously I suggest a new table (T228559, T226667), but I think T402854: Add a high-throughput counter system to MediaWiki can be an alternative solution.

enabled by $wgAllowSlowParserFunctions which is false by default.

Please note https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#mw.site.stats.pagesInNamespace bypasses $wgAllowSlowParserFunctions and can be used in Wikimedia wikis.

I have noted it, but I also think that Lua shouldn't be used for things that should rather be hard-coded into MediaWiki core. The reason, being, as I've stated elsewhere but have to reiterate again, is that MediaWiki should not only be considered an internal WMF project, but one written within the ethos of the Free Software Movement for the benefit of humanity. It's possible for third parties to set up MediaWiki without Extension:Scribunto, as that's an extension, so it's optional. That suggests:

  1. Integrate Scribunto into MediaWiki core.
  2. Hard-code this separately.

I'm not sure that anyone would advocate for #1 in this circumstance.