Settings being reset in multisite
-
Hi there,
for quite some time now, I experience a weird issue where Imagify settings are being reset. Especially noticeable for the option Display images in Next-Gen format on the site, since that’s where I usually notice it.
I added a logging mechanism to the action
update_site_option_imagify_settingsso that I can check when and where the settings are being updated (as it doesn’t happen manually).This log stores the following data:
[
'new_value' => $new_value,
'site' => \home_url(),
'trace' => \debug_backtrace( \DEBUG_BACKTRACE_IGNORE_ARGS ),
'user_id' => \get_current_user_id(),
],The result was this:
Array
(
[new_value] => Array
(
[version] => 2.2.6
[api_key] => *snip*
[optimization_level] => 2
[lossless] => 1
[auto_optimize] => 1
[backup] => 1
[resize_larger] => 0
[resize_larger_w] => 2560
[display_nextgen] => 0
[display_nextgen_method] => picture
[display_webp] => 0
[display_webp_method] => picture
[cdn_url] =>
[disallowed-sizes] => Array
(
)
[admin_bar_menu] => 1
[partner_links] => 0
[convert_to_avif] => 0
[convert_to_webp] => 0
[optimization_format] => webp
)
[site] => https://subsite.example.com
[trace] => Array
(
[0] => Array
(
[file] => /srv/apache2/example.com/htdocs/wp-includes/class-wp-hook.php
[line] => 326
[function] => log_settings_update
[class] => *snip*
[type] => ::
)
[1] => Array
(
[file] => /srv/apache2/example.com/htdocs/wp-includes/class-wp-hook.php
[line] => 348
[function] => apply_filters
[class] => WP_Hook
[type] => ->
)
[2] => Array
(
[file] => /srv/apache2/example.com/htdocs/wp-includes/plugin.php
[line] => 517
[function] => do_action
[class] => WP_Hook
[type] => ->
)
[3] => Array
(
[file] => /srv/apache2/example.com/htdocs/wp-includes/option.php
[line] => 2463
[function] => do_action
)
[4] => Array
(
[file] => /srv/apache2/example.com/htdocs/wp-includes/option.php
[line] => 1984
[function] => update_network_option
)
[5] => Array
(
[file] => /srv/apache2/example.com/htdocs/wp-content/plugins/imagify/inc/classes/class-imagify-abstract-options.php
[line] => 367
[function] => update_site_option
)
[6] => Array
(
[file] => /srv/apache2/example.com/htdocs/wp-content/plugins/imagify/inc/classes/class-imagify-abstract-options.php
[line] => 233
[function] => set_raw
[class] => Imagify_Abstract_Options
[type] => ->
)
[7] => Array
(
[file] => /srv/apache2/example.com/htdocs/wp-content/plugins/imagify/inc/admin/upgrader.php
[line] => 316
[function] => set
[class] => Imagify_Abstract_Options
[type] => ->
)
[8] => Array
(
[file] => /srv/apache2/example.com/htdocs/wp-includes/class-wp-hook.php
[line] => 324
[function] => _imagify_new_upgrade
)
[9] => Array
(
[file] => /srv/apache2/example.com/htdocs/wp-includes/class-wp-hook.php
[line] => 348
[function] => apply_filters
[class] => WP_Hook
[type] => ->
)
[10] => Array
(
[file] => /srv/apache2/example.com/htdocs/wp-includes/plugin.php
[line] => 517
[function] => do_action
[class] => WP_Hook
[type] => ->
)
[11] => Array
(
[file] => /srv/apache2/example.com/htdocs/wp-content/plugins/imagify/inc/admin/upgrader.php
[line] => 69
[function] => do_action
)
[12] => Array
(
[file] => /srv/apache2/example.com/htdocs/wp-includes/class-wp-hook.php
[line] => 324
[function] => _imagify_upgrader
)
[13] => Array
(
[file] => /srv/apache2/example.com/htdocs/wp-includes/class-wp-hook.php
[line] => 348
[function] => apply_filters
[class] => WP_Hook
[type] => ->
)
[14] => Array
(
[file] => /srv/apache2/example.com/htdocs/wp-includes/plugin.php
[line] => 517
[function] => do_action
[class] => WP_Hook
[type] => ->
)
[15] => Array
(
[file] => /srv/apache2/example.com/htdocs/wp-admin/admin.php
[line] => 176
[function] => do_action
)
[16] => Array
(
[file] => /srv/apache2/example.com/htdocs/wp-admin/index.php
[line] => 10
[args] => Array
(
[0] => /srv/apache2/example.com/htdocs/wp-admin/admin.php
)
[function] => require_once
)
)
[user_id] => 58
)So to me, it looks like there is an issue if a site has no version information about Imagify (probably when I first visit the admin area of a site that has been around already before installing the plugin). It then triggers the
imagify_upgradeaction and updates the network options, even though there is just a single site where the version information is missing. To me, this sounds wrong, since a single site should not automatically (re)set any network-wide setting that has been made before.Please look into this, as it’s quite annoying for me whenever this happens. 😬
Best regards,
Matthias
You must be logged in to reply to this topic.