This topic has 7 replies, 2 voices, and was last updated 6 years by Radu.

  • Author
  • #187340
     MichaelP
    Participant

    On average every 1-2 weeks all theme settings are somehow restored to the default settings. I then import all saved settings from the json file and everything is back to normal. Of course, this is not really a solution.

    My guess is that this happens when the server is under stress. Maybe Kleo resets everything if the options appear to be unavailable for a certain time? We have a second site with Kleo with an almost identical configuration where this problem never occurs. The only difference is that the second site has comparably little traffic.

    Please note that searching for a plugin conflict is not an option because the problem sometimes does not occur for weeks and it never occurs on an identical test system with no production traffic.

    Any ideas? Can I disable the function that resets Kleo to its default settings?

    #187389
     Radu
    Moderator

    Hi,

    There is no function that reset theme options on certain action, did you have any plugin that optimize database in some way ? if yes try to de-activate it and check if that still happens.

    So the settings are stored in database under wp_options table -> kleo_kleo and kleo_kleo_child option names

    Not sure what can cause that, i haven’t hear any other users to report this, if you find out the steps exactly how this can be reproduced tell me to can investigate further.

    You can ask the hosting support to help you to look for what changes had been made in the logs in the time where you theme settings had changed in the database under wp_options table.

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #187436
     MichaelP
    Participant

    Radu, thanks for the quick response.

    We don’t use a database optimization plugin and deactivating and reactivating the kleo child theme works without problems. That is, the settings stay.

    I checked the wp_options table now and it seems the reset was caused by the kleo_kleo-child-transients entry. When is this option_name used?

    I suppose you load the default settings when the theme / child theme is activated the first time? My guess is that the corresponding function is somehow executed by mistake. Where is this function? Can I disable it?

    #187499
     Radu
    Moderator

    Hi,

    Just i’ve spoken with the core developer about this issue and if it’s possible to the kleo_kleo-child-transients to reset that, and that is not posible, we have 2 actions that makes the theme options stored in database in wp_options table 1. It’s the save options button and second it’s the customizer!

    The theme options kleo child/kleo parent are separated, so if you make a certain setting in child this will not be added in parent, you should export from child and import to parent.

    Just give a try to another hosting provider add a stating install there for some time to see that not happens..

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #187535
     MichaelP
    Participant

    There is no hosting provider because we manage the server ourselves.

    Note that the problem could also be caused by the Redux Framework that Kleo is using, or perhaps by the changes you made to Redux.

    Can you please tell me which function is used to load the default settings when the theme is activated for the first time? I will then look into the code myself.

    #187544
     Radu
    Moderator

    Hi,

    We haven’t changed the functionality of redux it’s work in normal way.

    The default ( standard ) values of the every input it’s handled by the redux framework.

    So on theme activation redux do the job so there it’s used the hooks that redux uses.
    here’s the action triggered by the redux after theme switch/activation.

    PATH TO FILE : wp-content/themes/kleo/kleo-framework/options/inc/class.redux_api.php

    https://codex.wordpress.org/Plugin_API/Action_Reference/switch_theme

    On this file we build effective the redux sections with default values : wp-content/themes/kleo/lib/options.php

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #187604
     MichaelP
    Participant

    Thanks! I have an idea now what causes the issue, but I need to verify it when the problem occurs again. I added the code below to functions.php, so I will get an email whenever Kleo options are updated. I will then have a closer look.

    add_action(‘update_option’, function( $option_name, $old_value, $value) {
    if(preg_match(‘/.*kleo.*/’, $option_name)) {
    $old_value = print_r($old_value, true);
    $value = print_r($value, true);
    $log = $option_name . “\nOld value:\n” . $old_value . “\nNew value:\n” . $value;
    wp_mail($admin_mail, $option_name, $log);
    }
    }, 10, 3);

    I will report back if I find something, but it might take a few weeks because the problem only occurs occasionally.

    Thanks a lot for the help!

    #187834
     Radu
    Moderator

    Hi,

    Good!

    Have a nice day

    Cheers
    R

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 8 posts - 1 through 8 (of 8 total)

The forum ‘Bugs & Issues’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?