• Resolved karlemilnikka

    (@karlemilnikka)


    We have a Custom Settings Page with dropdown fields for selecting pages. The permalinks to the selected pages are retrieved by a plugin calling get_permalink( get_option( 'field_name' )[0] ).

    Sometimes, often after updating a non-related plugin, the option is no longer valid. Get_option() returns false. The selected pages are however still set on the Custom Settings Page, and just by saving the Custom Settings Page, everything works again.

    Does anyone have an idea of what could cause this situation? Any hints are welcome. It can take weeks between the times the issue occurs, so it’s quite hard to troubleshoot.   

Viewing 15 replies - 1 through 15 (of 28 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @karlemilnikka

    This sounds like a possible plugin conflict. Maybe your settings name is conflicting? Or maybe it could be a cache issue?

    Cheers, Jory

    Thread Starter karlemilnikka

    (@karlemilnikka)

    Thank you very much for the reply, @keraweb. I’m currently investigating if it could be a Redis cache issue. I’ll update the post if I find out anything.

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @karlemilnikka

    I was wondering whether you have an update for us on this topic. Let me know!

    Cheers, Jory

    Thread Starter karlemilnikka

    (@karlemilnikka)

    Hi @keraweb. Thanks for following up. Not yet. It has happened once again, but I still don’t know what caused it.

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @karlemilnikka

    Thank you for letting me know. I’ll close the ticket for now. In case you might indeed find the conflict and it’s Pods related then please file a bug report with all details for us to reproduce.

    pods.io/submit

    Thanks! Jory

    Thread Starter karlemilnikka

    (@karlemilnikka)

    Absolutely. Thank you.

    Thread Starter karlemilnikka

    (@karlemilnikka)

    This is just a quick update. I haven’t found out what’s causing the issue (yet). I’m just adding more information in case anyone else is experiencing the same issue.

    Earlier today, Pods lost the settings again. Just like before, the pages were still set in wp-admin but they couldn’t be retrieved by calling get_option( ‘field_name’ )[0] until I had resaved the custom settings page. Our other custom settings pages weren’t affected. Clearing Pods cache didn’t help. Neither did running the repair process.

    (Since the last time this happened, we’ve moved from an Apache server on Cloudlinux to a Litespeed server on Ubuntu. We’ve also replaced Krüss’ Redis plugin with Litespeed Cache’s integrated Redis plugin.)

    Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)

    Very interesting issue here, did you already submit this as a bug that I can look over the full details on?

    Thread Starter karlemilnikka

    (@karlemilnikka)

    A couple of minutes later, I actually have some insights to share (@keraweb). I still don’t know what’s causing the bug. I do however have a solution.

    There are two ways to retrieve a setting from a custom settings page: the WordPress way and the Pods way (documentation). It’s just the WordPress way that’s affected. I tested this on a copy of our site with Pods Framework as the only running plugin.

    When the problem occurred, the WordPress way stopped working until I had re-saved the custom settings page.

    get_option( 'opal_pages_academy_settings_general' )[0];

    The Pods way still works just like it’s supposed to.

    $settings = pods('opal_pages');
    $settings->field('academy_settings_general')['ID'];

    Thread Starter karlemilnikka

    (@karlemilnikka)

    @sc0ttkclark. Thanks. I haven’t submitted a bug-report yet since I haven’t found a consistent way to reproduce the issue. I’ll do that as soon as I’ve found a reliable way to do so.

    Thread Starter karlemilnikka

    (@karlemilnikka)

    This is another quick update with a little more information. When the issue occurs, the options are actually missing from the _options table. As soon as I resave the settings page, all options are added back to the _options table (with new IDs).

    Thread Starter karlemilnikka

    (@karlemilnikka)

    On my mission to find what’s causing the issue, I’ve now removed all multi-choice options and all listings for LearnDash’s post types, since that’s two major differences between the settings page that loses the settings and the settings pages that don’t.

    I’ll update the thread again in 30 days with the result.

    Thread Starter karlemilnikka

    (@karlemilnikka)

    We didn’t have to wait 30 days. When I woke up today, the settings were lost again.

    Plugin Author Jory Hogeveen

    (@keraweb)

    Can you find what actions were done this night? Maybe a server update?

    Thread Starter karlemilnikka

    (@karlemilnikka)

    @keraweb, I really wish I could find it. I didn’t update the server that night. There are no traces of any changes in WP Activity Log Pro and I can’t find any cronjobs that trigger the issue. I’ll post more information in this thread as soon as I have any.

    (Please note that I’m not posting here to get support from you and your amazing colleagues. I’m just posting here in case anyone else is experiencing the same issue. I’ll submit a ticket as soon as I have any usable information regarding this plugin and/or server compatibility issue.)

Viewing 15 replies - 1 through 15 (of 28 total)

The topic ‘Custom Settings Page forgets settings’ is closed to new replies.