DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:orphanswanted

OrphansWanted Plugin

Compatible with DokuWiki

  • 2024-02-06 "Kaos" yes
  • 2023-04-04 "Jack Jackrum" yes
  • 2022-07-31 "Igor" unknown
  • 2020-07-29 "Hogfather" unknown

plugin Find Orphan pages, Wanted pages with reference counts. Also shows reference counts for linked pages (previous authors: Doug Edmunds)

Last updated on
2023-05-30
Provides
Syntax
Repository
Source

Originally by Doug Edmunds.

Description

Use this plugin to find orphan pages and wanted pages.

OrphansWanted show which pages are:

  • Orphans (the page exists, but it has no links to it)
  • Wanted (the page does not exist, but there are link(s) to it elsewhere on the site)
  • Valid (the page exists, and it can be reached through a link)

Each table shows the reference count and a link to backlinks.

Usage

Basic usage is to place one of the following four lines into the page markup:

 ~~ORPHANSWANTED:orphans~~
 ~~ORPHANSWANTED:wanted~~
 ~~ORPHANSWANTED:valid~~    
 ~~ORPHANSWANTED:all~~      << makes all three tables 

Anything other than these 4 words will generate a syntax error message.

Enhanced usage excludes some namespaces, each prefixed with an exclamation point '!' (think 'not')

~~ORPHANSWANTED:orphans|wanted|valid|all[!namespace!another!one:with:subspaces]~~

Example – exclude one namespace:
Shows wanted pages, but none that are under the wiki: namespace

~~ORPHANSWANTED:wanted!wiki~~   

Example – exclude multiple namespaces:
Shows orphan pages, but none in the wiki: or in the sys:personal: namespaces

~~ORPHANSWANTED:orphans!wiki!sys:personal~~  

Version/Requirements

:!: Please check GitHub for most recent version; and please comment on the GitHub version using GitHub 'issues' mechanism. Comments and issues below apply to the code included on the page below.

Changes

Notes

  • I strongly suggest you put ~~NOCACHE~~ on the page where this plugin is used. This helps assure that ACL permissions get applied. Otherwise some other user, with lesser ACL permissions, may see a cached copy of the results.
  • ACL settings are applied first, before any exclusions. Only pages you have permission to view can be listed. To be sure to see everything, log in as superuser.
  • Reference counts (number of links) may include pages that cannot be viewed due to ACL settings.
  • It is fast enough for a site with 200+ short pages.
  • If you see something that you think must have a link, check your spelling. If you typed the page name wrong on the other page, you created a “wanted” page instead of a link to an existing page.
  • Try fixing bad links one by one after you figure out what is wrong. Do this until your orphan/wanted lists are as clean as you need.

Feature Requests

  • It would be nice to be able to sort the list by their namespaces, names or titles instead of only by their backlinks → This can be achieved with plugin sortablejs with Tablesorter.
  • It would be nice to have an option to limit the number of output lines or to only print wanted pages that are requested multiple times.
  • Would it be a big functionality change to add the ability to list broken external links too? I haven't been able to find a plugin that does this yet.
  • Especially in a closed wiki with use of ACLs it would be great if one could define the starting namespace for the search, instead of running through all namespaces. This could avoid ACL errors in the output.
  • It might be useful to add an additional table for pages that have not been updated in a long time.
  • It might be useful to add an additional table for pages with a very small amount of content.
  • In addition to the “exclude”-switch I think an “exclusive” would also make sense; for if when you have a lot of namespaces or sub-namespaces but you only want to check a specific one (namespace or sub-namespace).

Discussion and Bugs

Please raise bugs and requests for enhancements in GitHub. This page is not routinely monitored, so comments here may languish forever.

Compatibility

Only tested on Jack Jackrum but should work on Igor. — jaller 2023-05-30 19:37

Tried to make it work on Hogfather and everything looks OK. — Fiisch 2023-11-03 15:15

Verbose?

I've had this installed before, and didn't have this appear, but after changing permissions to get the plugin to work in a different installment, I'm noticing all of this:

  1. – Checking law:intro
  2. — link='law:intro' MISS A_LINK
  3. - New count for link law:intro: 25
  1. – Checking law:help
  2. — link='law:help' EXISTS A_LINK
  3. - New count for link law:help: 26

Is there any way to prevent this from appearing? -Kendra

Yes - turn off debugging mode. You're seeing these messages because you have the global config item 'allowdebug' checked in the config manager (in the back-end, set to 1 or some other value which PHP will evaluate as true).

plugin/orphanswanted.txt · Last modified: by 103.242.237.138

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki