Manual:Hooks/ParserLimitReport

ParserLimitReport
Available from version 1.12.0
Removed in version 1.32.0 (Gerrit change 465792)
called at the end of Parser::parse() when the parser will add a report about size and complexity of the text parsed as a HTML comment
Define function:
public static function onParserLimitReport( $parser, $limitReport ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"ParserLimitReport": "MediaWiki\\Extension\\MyExtension\\Hooks::onParserLimitReport"
	}
}
Called from: File(s): Parser.php
Function(s): makeLimitReport
Interface: ParserLimitReportHook.php

For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:ParserLimitReport extensions.

Details

edit

Used to create the NewPP parser report. Parameters:

  • $parser: Parser object
  • $limitReport: text that will be included (without comment tags); extensions are expected to append their own lines.

Hints

edit

When adding some limts to a page and show that limit in the limit report, you should also add a limitation warning (Parser::limitationWarn) with a tracking category to get all pages, which reach that limit.