Remove backend updates from Cache_Enabler::on_ce_update() as this is actually not achieving the desired results. This method is currently called from Cache_Enabler::on_upgrade(), which is hooked to the upgrader_process_complete action. When Cache Enabler is the plugin under upgrade this action will run the old version of Cache Enabler, which means the database is not being updated here. Updating the backend is not actually required in this method with the recent changes brought in PR #147 that automatically updates the database. If Cache Enabler is active after being updated the first request to any page belonging to that site, whether that is an admin or site page (logged in or out), will trigger the settings in the database to be called, which will update the backend, which then triggers the settings file to be created.
Update creating settings file fallback in Cache_Enabler::update_backend(). This builds upon what was added in 661e827 to now check that the action is registered to our hook function that creates the settings file. This will force create the settings file if the action is not yet registered, like during the plugin activation hook, regardless of whether or not that action would have been fired from the option being added or updated.
Remove Cache_Enabler::install_backend() in favor of Cache_Enabler::update_backend(). Using update_option() will add the option if it does not exist. Leaving the hook on the add_option_cache_enabler action because it will fired instead of update_option_cache_enabler if the option is added and not updated. However, it is only required to check if one of the actions is registered when force creating the settings file.
Remove backend updates from
Cache_Enabler::on_ce_update()
as this is actually not achieving the desired results. This method is currently called fromCache_Enabler::on_upgrade()
, which is hooked to theupgrader_process_complete
action. When Cache Enabler is the plugin under upgrade this action will run the old version of Cache Enabler, which means the database is not being updated here. Updating the backend is not actually required in this method with the recent changes brought in PR #147 that automatically updates the database. If Cache Enabler is active after being updated the first request to any page belonging to that site, whether that is an admin or site page (logged in or out), will trigger the settings in the database to be called, which will update the backend, which then triggers the settings file to be created.Update creating settings file fallback in
Cache_Enabler::update_backend()
. This builds upon what was added in 661e827 to now check that the action is registered to our hook function that creates the settings file. This will force create the settings file if the action is not yet registered, like during the plugin activation hook, regardless of whether or not that action would have been fired from the option being added or updated.Remove
Cache_Enabler::install_backend()
in favor ofCache_Enabler::update_backend()
. Usingupdate_option()
will add the option if it does not exist. Leaving the hook on theadd_option_cache_enabler
action because it will fired instead ofupdate_option_cache_enabler
if the option is added and not updated. However, it is only required to check if one of the actions is registered when force creating the settings file.