Panel slow when creating a new page after 2.3 upgrade

I upgraded yesterday to 2.3 and since then the panel is slow when creating a new page, or saving a page.

In particular, the loading white bar at the top of the browser (within Kirby), slowly progresses when I save a page, then finally hangs at 98% or so…

If I refresh the browser, the page seem to have been saved correctly.

Any idea of what could it be?

It seems connected to some hooks I am using in my config.php.

In fact, when I remove these hooks, the pages get saved quickly.

The hook in question is the following. It renames files names to match the page title.

// Rename and sanitize file names on panel save
kirby()->hook('', function($page) {
    $count = 0;
    $title = $page->title();
    $images = $page->images();
    foreach ($images as $image) {

        // Remove dots in name
        $search = array(".");
        $replace = array("");
        $title = str_replace($search, $replace, $title);

        // Add 0 before $count so that it is two digits
        $count = str_pad($count, 2, '0', STR_PAD_LEFT);
        $old_filename = $image->filename();
        $filename = $title . "-" . $count;
        if (strpos($old_filename, 'box') !== false) {
            $filename = $filename . "-box";
        } elseif (strpos($old_filename, 'logo') !== false) {
            $filename = $filename . "-logo";
        } elseif (strpos($old_filename, 'advertising') !== false) {
            $filename = $filename . "-advertising";

I have tried commenting out all the function and leaving kist the empty hook, and it is still slow. If I do remove the hook, the panel returns to be quick … :sweat:

kirby()->hook('', function($page) {

Do you happen to use a plugin that uses a hook as well?

This topic may help: Plugin with hook has slow panel progressbar

Yes indeed! I went in my plugins folder and when I deactivate AutoID ( the panel is again snappy.

The plugin uses the following hooks. Do you notice anything wrong I could try fix?

// Set id for new pages
kirby()->hook('', function($page) use ($plugin) {
    return $plugin->onPageCreate($page);

// Set id for existing pages (if added later)
kirby()->hook('', function($page) use ($plugin) {
    // trigger update only with version 2.2.2 or higher
    $version = intval(str_replace('.', '', panel()->version()));
    if($version >= 222) {
        return $plugin->onPageUpdate($page);
    } else {
        // do nothing, because of a kirby bug:

It seems that since 2.3 we suddenly have this problem with multiple hooks that did not exist before.

If you don’t need the update hook for existing pages in the autoid plugin, you can try to simply remove that hook there. Then your update hook should work again.

Related topics:

@texnixe @lukasbestle

Can we expect a Kirby 2.3.1 release for bug fixes? Soon? :slight_smile:

There will be a 2.3.1 release, but that’s done when it’s done. :slight_smile:


I have updated kirby.php as indicated in the following link and now it works well :slight_smile:

Thanks for the help!