Extension:GlobalUsage

The GlobalUsage extension allows to view the global usage of images in a wiki farm with shared image repository. It adds Special:GlobalUsage as well as a list of pages that include the image on image description pages.

Specific guide on how to link file usage by sites table

 * 1) Make sure that $wgGlobalUsageDatabase and $wgLBFactoryConf were set properly.
 * 2) Use maintenance script importSites.php to build an XML format site list file. (Instruction can be found here: sitelist.txt, sample file can be found here: sitelist-1.0.xsd.)
 * 3) Use $wgSharedDB = 'commonswiki'; and $wgSharedTables[] = 'sites'; to share sites table across all wikis.
 * 4) Clean all cache and force refresh like by refreshGlobalimagelinks.php.

API
Extension:GlobalUsage includes an API extension that allows bots and other programs to query the global usage of a file. For example, this query on Wikimedia Commons returns global uses of File:Example.jpg:

By default, this returns only 10 results. The next 10 results can be retrieved using the gucontinue parameter included in the result above:

The number of results returned is set with the  parameter. The  parameter sets which properties to retrieve. The  parameter, when set to 1, will exclude uses on the same wiki as the file (e.g., on Commons). The following query retrieves all properties and up to 100 results, excluding local uses: