Extension:ExternalLinks

Description


This extension adds  which lists all external links used on the wiki including dynamic URLs by templates.

The results table lists the pages which use the URL (edit link with preview).

URLs can be filtered with a truncated text string.

URL validation
The extension also works as link checker by validating the reported URLs.

For each result page you can let PHP check the availability of each URL target by reporting its server response header (requires the  setting, see below).

You could also use a browser plugin like Pinger for Firefox.

Although e-mail addresses cannot be validated too easily, they can be added to the report list.

Download
Download and extract it into your extensions folder:

MediaWiki > 1.27

 * ExternalLinks1.1.3.zip

MediaWiki > 1.21
https://github.com/roman-1983/mediawiki-ExternalLinks

Mediawiki < 1.21

 * ExternalLinks1.1.2.zip

Installation
Add this to LocalSettings.php in your wiki installation folder.

should appear on your Special:Version.

Configuration

 * Override the default user right "edit" which is required to view the page.
 * Override the default user right "edit" which is required to view the page.


 * Add class names to the result table.
 * Add class names to the result table.


 * Add class names to the page (article) links.
 * Add class names to the page (article) links.


 * Overrides the default 200 results per page.
 * Overrides the default 200 results per page.


 * Enables the options
 * Mark all URLs on result pages as "checked today"
 * Last validation older than: X days
 * Requires a new date row 'el_last_validated' in table 'externallinks' (see ).
 * Requires a new date row 'el_last_validated' in table 'externallinks' (see ).

In  "cURL support" should be "enabled". In  "allow_url_fopen" should be "on".
 * Define the validation mode, e.g..
 * If enabled, this setting will ignore your $wgMiserMode setting and can slow down your server.
 * Options:
 * " " uses cURL as PHP extension. This validation mode is recommended.
 * " " uses cURL as PHP extension. This validation mode is recommended.
 * " " uses PHP's get_headers and requires (security risk!) and only supports the  -protocol.


 * Validating URLs with a  can take very long. If   is set, the default number of results (or  ) is overwritten with a new maximum of 25. Override these 25 with.
 * Validating URLs with a  can take very long. If   is set, the default number of results (or  ) is overwritten with a new maximum of 25. Override these 25 with.


 * Adds a toolbox link in the sidebar to "validate external URLs" used on the current page. The link will appear on non-special pages to users allowed by.
 * Adds a toolbox link in the sidebar to "validate external URLs" used on the current page. The link will appear on non-special pages to users allowed by.

Skip previously checked URLs
Optional: When you validate URLs you can store the date and skip these URLs next time, e.g. by hiding all URLs which have been validated (and stored) in the past X days.

will add the option Mark all URLs on result pages as "checked today".

To store the date you need to add a new row  to the  -table. Run this SQL command:

With stored dates you can later use the option Last validation is older than: [___] days

Translations
Translations can be posted here.

Coding
Please post if you have a working solution for


 * grouping results of different wiki pages with the same URL (same URLs should only be listed once with a list of the pages they're used on, should also work with )
 * a page name filter that excludes pages with a given string (like URL string filter)
 * a namespace selector as on Special:Search
 * validating https-URLs
 * validating flash-URLs
 * removing the toolbox link if the page doesn't use external URLs
 * This can be tricky since a simple javascript check for a link is not enough. An URL could be used in a templare to produce some content without a link of that URL (varying link, flash content, etc.).

MW version tests
In theory this should work in MediaWiki 1.5+ where the "externallinks"-table was introduced. Nontheless it would be nice if this was tested.


 * Not working on MW 1.27.1 --Rob Kam (talk) 09:48, 6 September 2016 (UTC)
 * Tested and working on MW 1.23.14 (only missing ExternalLinks-page in SpecialPages, but manually OK) --DikkieDick
 * Tested and working on MW 1.19.2 --Stefahn (talk) 16:32, 25 October 2012 (UTC)
 * Tested and working on MW 1.19.1 --Nrobbins (talk) 19:50, 9 October 2012 (UTC)
 * Tested and working on MW 1.18.1 --Subfader (talk) 21:11, 29 June 2012 (UTC)
 * Tested and working on MW 1.16alpha --Subfader (talk) 21:11, 29 June 2012 (UTC)

Versions

 * 1.1.2 (2012-11-16) bug fix ( is now really optional and falls back to 'edit', thanks User:Stefahn)
 * 1.1.1 (2012-10-19) bug fix of 1.1 for MW 1.15 and below
 * 1.1 (2012-10-16) Postgres support (thanks User:Hbswn),  adds a new toolbox-link to validate all URLs on the current page, i18n improvements
 * 1.0 (2012-07-14) cURL support,, URL exclude input,
 * 0.1 (2012-06-29) Extension added