lucamauri/recentactivity

Adds parser functions for listing recently created and edited articles

Maintainers

Package info

gitlab.com/lucamauri/RecentActivity

Homepage

Issues

Wiki

Documentation

Type:mediawiki-extension

pkg:composer/lucamauri/recentactivity

Transparency log

Statistics

Installs: 72

Dependents: 0

Suggesters: 0

Stars: 0

v1.10.0 2026-07-26 23:29 UTC

This package is auto-updated.

Last update: 2026-08-10 21:24:34 UTC


README

GPL-2.0-or-later License Built with Visual Studio Code MediaWiki

Adds a parser function for listing recently created or edited articles on a MediaWiki wiki.

Why the fork

This fork was created by Luca Mauri from the original RecentActivity extension by Aran Dunkley, hosted on GitLab at gitlab.com/lucamauri/RecentActivity.

The goals of this fork are:

  • PHP 8.x compatibility — the original extension used APIs deprecated or removed in PHP 8 and MediaWiki 1.36+
  • MediaWiki 1.39+ API modernisation — replaced wfGetDB(), IDatabase::select(), Title::newFromId(), and rev_user_text column references with current equivalents
  • Namespace filtering — added $wgRANamespaces configuration variable to allow filtering results by namespace (e.g. exclude File: pages from results)
  • Dependency injection — converted the hook handler to use constructor-based dependency injection via HookHandlers in extension.json, following modern MediaWiki extension standards
  • Wikibase-aware labels — on wikis running Wikibase Repository, entity pages (Q42, P17) are shown with their human-readable label instead of the bare entity code (see Wikibase integration below)
  • Code quality — improved docblocks, comments, i18n of error messages, and overall code readability

The original GitLab repository is preserved for attribution purposes.

Requirements

  • MediaWiki 1.39.0 or later
  • PHP 8.0 or later
  • (Optional) Wikibase Repository, if you want entity pages to display with their label instead of their raw Qxxx / Pxxx code — see Wikibase integration below

Installation

Via Composer (recommended)

Add the following to composer.local.json at the root of your MediaWiki installation (create the file if it does not exist):

{
    "require": {
        "lucamauri/recentactivity": "^1.10"
    },
    "extra": {
        "merge-plugin": {
            "include": []
        }
    }
}

Then run Composer in the root of your MediaWiki installation:

composer install --no-dev

Manual installation

Download the source code from the GitHub releases page and decompress it into a folder named RecentActivity inside the extensions/ directory of your MediaWiki installation.

Activate the extension

Add the following line near the rest of the extension loading calls in LocalSettings.php:

wfLoadExtension( 'RecentActivity' );

Then add any configuration variables you need, as described in the Configuration section below.

Configuration

All configuration variables are optional. Add them to LocalSettings.php after the wfLoadExtension call.

$wgRAExclusionsCat

Pages belonging to this category will be excluded from all results.

  • Type: string
  • Default: 'Excluded from RecentActivity'
$wgRAExclusionsCat = 'My exclusion category';

$wgRANamespaces

Restrict results to pages in specific namespaces. Use an array of namespace ID integers. If empty (the default), pages from all namespaces are returned.

  • Type: array of integers
  • Default: [] (all namespaces)
// Show only pages from the main namespace (0) and the Project namespace (4)
$wgRANamespaces = [ 0, 4 ];

This is the recommended way to exclude media files from results — set it to [ 0 ] to return only main-namespace articles.

Usage

The extension adds the {{#RecentActivity:}} parser function. All parameters are optional and passed as named arguments.

Parameters

ParameterDescriptionDefault
typeedits for recently edited pages, new for recently created pages(empty — returns nothing)
userFilter results to edits or creations by this username(all users)
countNumber of results to return5
formatWikitext list marker prepended to each result*

Examples

Show the last five recently edited articles:

{{#RecentActivity:type=edits}}

Show the last five recently created articles:

{{#RecentActivity:type=new}}

Show the last five articles created by user Foo:

{{#RecentActivity:type=new|user=Foo}}

Show the last ten recently edited articles:

{{#RecentActivity:type=edits|count=10}}

Show recently edited articles with a double-asterisk prefix (useful for tree views):

{{#RecentActivity:type=edits|format=**}}

Wikibase integration

Added in 1.10.0.

If your wiki has the Wikibase Repository extension installed, Item and Property pages are normally titled with their raw entity ID (e.g. Q42, P17), because Wikibase stores human-readable labels separately from the page title itself. Without this integration, such pages would show up in RecentActivity's list as bare Q42 / P17 codes.

RecentActivity detects this automatically — no configuration is needed. When a listed page is a Wikibase entity, it is displayed as:

Label (Q42)

The label is resolved in the viewing user's own interface language first, then falls back through MediaWiki's normal language fallback chain (e.g. Italian → English → the wiki's content language) if no label exists in the user's language. If no label exists in any language, the bare entity code is shown instead, so the output never breaks — it simply behaves as it did before this feature existed.

On a wiki without Wikibase Repository installed, this section doesn't apply and nothing changes: RecentActivity behaves exactly as in earlier versions.

Debugging

Log output is written to the RecentActivity log group. To enable it, add the following to LocalSettings.php:

$wgDebugLogGroups['RecentActivity'] = '/var/log/mediawiki/recentactivity.log';

Credits

Originally developed by Aran Dunkley. Modernised and maintained by Luca Mauri.

Icon

The project icon © 2014 Andreas Kainz & Uri Herrera & Andrew Lake & Marco Martin & Harald Sitter & Jonathan Riddell & Ken Vermette & Aleix Pol & David Faure & Albert Vaca & Luca Beltrame & Gleb Popov & Nuno Pinheiro & Alex Richardson & Jan Grulich & Bernhard Landauer & Heiko Becker & Volker Krause & David Rosca & Phil Schaf / KDE

License

This extension is released under the GNU General Public License, version 2 or later.