lupo49/dokuwiki-plugin-orphanswanted

Slowness due to use of deprecated functions (since Igor)

Closed this issue · 3 comments

This plugin worked perfectly on my wiki, until we upgraded from "Hogfather" to "Jack Jackrum" about a month or so ago. Now, any page that this plugin's syntax is on takes several seconds to load.

I am certain it is this plugin and not anything else causing the issue; creating a new page with only syntax from this plugin exhibits this behavior, while any other page that does not use this plugin loads at normal speed.

Reason

  • The plugin uses a lot of deprecated DokuWiki functions. Dokuwiki logs deprecation warnings to a file, which blocks the page.

Affected versions

  • Every version of the orphanswanted plugin
  • Every version of DokuWiki since the Igor 2022 release:
    • logging of deprecated messages is default enabled, otherwise you need to uncheck deprecated in the dontlog configuration setting

Workaround

Add deprecated to the events not to log. https://www.dokuwiki.org/config:dontlog

Screenshot_2023-05-30_17-42-41

$conf['dontlog'] = 'debug,deprecated';

Solution

Migrate all deprecated function calls to their new functions.

  • trigger_event() (called A LOT)
  • utf8_strtolower() (called A LOT)
  • resolve_pageid() (called A LOT)
  • require(syntax.php) (called just once)

dokuwiki-ophanswanted-deprecations.txt

Will be fixed by #44 which I'm likely going to release this week.
Thanks for the report. This issue is the reason I looked at an awesome Pull Request which fixes many outstanding issues.

Fixed in release 2023-05-30.