Not included in official Wikka version

This is the documentation page for the Checklinks action.
 

Documentation


Short description
This administration tool checks the validity of hyperlinks on some or all of the wiki pages and displays a report of broken links.

Parameters
nametyperequired?defaultdescription
scopestringoptionaluserAllowed values are 'page' (check only this page), 'user' (check all pages owned by current user) and 'all' (check all pages for which current user has ACL-read-access)
sortstringoptionaltagAllowed values are 'tag' (sort on page tag), 'type' (sort on link type) and 'cnt' (sort on occurences count)
optsstringoptionalOptions: any combination of 'i' (internal=do not check external web pages), 't' (terse=show only summary report) and 'w' (check page tag format, i.e. that it is formatted as a valid WikiWord)

Long description
Link checkers are a standard administration tool for webmasters and can be run on a wiki site. However, a standard link checker has the following drawbacks when used with WikkaWiki:

This action is a link checker adapted to the wiki context. It goes over the latest version of all wikka pages accessible in read mode to the current user and checks for the validity of various types of hyperlinks appearing on these pages.

Link categories checked are:

When run by a Wiki Admin with a scope="all" parameter value, it checks the integrality of the wiki content.

Usage
{{checklinks [scope="page"] [sort="type"] [opts="[i][t][w]"]}}


Example

Let's create on purpose on this page a NonExistentWikiPageLink, a non-existent external link and a non-existent file link.

The output of {{checklinks scope="page"}} would look like:

Link typeValid links #Broken links #
Action10
External11
Inter-wiki00
Wiki page31
File01
Total53

Detailed report

Link typePage nameLink valueError messageOccurences
FileChecklinksActionInfo./files/nonexistentfile.abcFile not found1
ExternalChecklinksActionInfohttp://www.nonexistentdomain.org/foo.htmNot Found1
Wiki pageChecklinksActionInfoNonExistentWikiPageLinkPage non-existent1

To-do, bugs and limitations


Other considerations


Author
DomBonj


CategoryDocumentation
Comments
Comment by DaC
2007-01-14 00:02:03
Great Extension! This helps to clean up all the link garbage inside a wiki! Thanks!

But sometimes (not always) I get the following errors:

Warning: asort() expects parameter 1 to be array, null given in /home/xxx/wiki2/actions/checklinks.php on line 339

Warning: Invalid argument supplied for foreach() in /home/xxx/wiki2/actions/checklinks.php on line 77

Any tips? I thought it is related to other actions on the page but it isn't.
Comment by DarTar
2007-01-14 13:25:01
looks yummie, I look forward to testing this, thanks for contributing!
Comment by DomBonj
2007-01-14 16:20:08
DaC, please check revised v0.91. I could reproduce the bug and hopefully it is now fixed.
Comment by DaC
2007-01-16 07:30:04
Hi DomBonj,

works fine on my site altought it somehow locked up the mySQL DB when I placed the action on "FormattingRules" with "scope=page". But as nobody will do that I doubt that this is a real problem. Guessing from the logs the script got locked up in a loop.

One suggestion: I suggest excluding all "edit, history, info, revisions, referrers, backlinks etc."-links as they are not "real" links in the sense of pages or outgoing links. This reduces the time needed to check all links significantly.

----

HEAD /HomePage/revisions HTTP/1.0" 200 - "-" "WikkaCheckLinks/1.0"
83.136.81.242 - - [15/Jan/2007:01:36:53 +0100] "HEAD /HomePage/history HTTP/1.0" 200 - "-" "WikkaCheckLinks/1.0"
83.136.81.242 - - [15/Jan/2007:01:36:53 +0100] "HEAD /HomePage HTTP/1.0" 200 - "-" "WikkaCheckLinks/1.0"
83.136.81.242 - - [15/Jan/2007:01:36:54 +0100] "HEAD /RecentChanges/revisions HTTP/1.0" 200 - "-" "WikkaCheckLinks/1.0"
83.136.81.242 - - [15/Jan/2007:01:36:54 +0100] "HEAD /RecentChanges/history HTTP/1.0" 200 - "-" "WikkaCheckLinks/1.0"
83.136.81.242 - - [15/Jan/2007:01:36:54 +0100] "HEAD /RecentChanges HTTP/1.0" 200 - "-" "WikkaCheckLinks/1.0"
83.136.81.242 - - [15/Jan/2007:01:36:54 +0100] "HEAD /RecentlyCommented/revisions HTTP/1.0" 200 - "-" "WikkaCheckLinks/1.0"
83.136.81.242 - - [15/Jan/2007:01:36:54 +0100] "HEAD /RecentlyCommented/history HTTP/1.0" 200 - "-" "WikkaCheckLinks/1.0"
83.136.81.242 - - [15/Jan/2007:01:36:54 +0100] "HEAD /RecentlyCommented HTTP/1.0" 200 - "-" "WikkaCheckLinks/1.0"
83.136.81.242 - - [15/Jan/2007:01:36:54 +0100] "HEAD /UserSettings/revisions HTTP/1.0" 200 - "-" "WikkaCheckLinks/1.0"
83.136.81.242 - - [15/Jan/2007:01:36:54 +0100] "HEAD /UserSettings/history HTTP/1.0" 200 - "-" "WikkaCheckLinks/1.0"
83.136.81.242 - - [15/Jan/2007:01:36:54 +0100] "HEAD /UserSettings HTTP/1.0" 200 - "-" "WikkaCheckLinks/1.0"
83.136.81.242 - - [15/Jan/2007:01:36:54 +0100] "HEAD /PageIndex/revisions HTTP/1.0" 200 - "-" "WikkaCheckLinks/1.0"
83.136.81.242 - - [15/Jan/2007:01:36:54 +0100] "HEAD /PageIndex/history HTTP/1.0" 200 - "-" "WikkaCheckLinks/1.0"
etc.
Comment by DomBonj
2007-01-18 17:55:49
DaC,
Thank you for your feedback.
On issue #1, I tested checklinks with both the 1.1.6.0 (http://wikkawiki.org/FormattingRules) and 1.1.6.2 (http://wikkawiki.org/FormattingRules1162) FormattingRules pages, and it worked OK, so I do not know what you experienced.
On issue #2, the behavior you report should definitely not happen. I believe this is due to mod_rewrite (which I had not tested and it seems you are using), so I have uploaded v0.92 which should settle this issue.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki