• Resolved Broome Arts

    (@broome-arts)


    I have the settings for Sucuri as I want them. However, sporadically, some of them change without action from me. The API key disappears, the alert recipients changes from the internal tech person to the primary admin account, the time zone, alerts per hour and the selection of security alerts change, I would guess to the default. The last time this happened was about 2:00 am local time Sunday. I’ve fixed the settings several times, but after a few days they’re back (and my boss is again finding his inbox with the alerts). This started just in the last couple of weeks. I’ve uninstalled and reinstalled Sucuri, with no effect. All my plugins and themes are up to date, I can’t correlate any activity with the resets. Any ideas?

    MJ

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Let’s try to answer this question taking a look at the code:

    First of all, we need to understand how does the plugin determines the state of the options in the settings page, for this we will take a look at the code that is executed when the security alert options are displayed in the dashboard. This function “sucuriscan_settings_alerts_events” [1] is used to render the HTML of all those checkboxes, and using an iterator we go through all the available options and retrieve the current value from the database [2] (actually, from the settings file, the plugin doesn’t stores the settings in the database).

    If we take a look a the definition of this function “SucuriScanOption::getOption()” [3] the first thing that it does is to load all the data contained in the settings file located here [4] and checks if the requested option is contained in this file, if yes then the function returns that value, otherwise it returns the default value.

    Considering this information, we can assume that the failure point is with the “read the settings file” step, because according to what you are saying, the plugin is randomly “resetting” the settings to their default values. For some reason, in your web server, this file [4] is not being readable by the PHP interpreter at certain moment — we don’t know when yet.

    Since this seems to be an edge case involving specific details about the structure of your hosting account, I cannot do much to investigate. Right now I am unable to reproduce the problem in my server, so I cannot provide a fix. What I suggest you, is to monitor the permissions and content of the settings file, something in your server is either removing the read access or completely deleting the file, that’s why the plugin falls-back to show the default settings.

    Let me know if you can find the reason for this, I will be happy to help if you provide more information so I can reproduce the issue in my server.

    [1] https://github.com/Sucuri/sucuri-wordpress-plugin/blob/cf06eee/src/settings-alerts.php#L386-L392
    [2] https://github.com/Sucuri/sucuri-wordpress-plugin/blob/cf06eee/src/settings-alerts.php#L483-L525
    [3] https://github.com/Sucuri/sucuri-wordpress-plugin/blob/cf06eee/src/option.lib.php#L229-L305
    [4] /wp-content/uploads/sucuri/sucuri-settings.php

    Marking as resolved after no response from the original poster.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Settings reset’ is closed to new replies.