Closed Mai-Saad closed 3 months ago
We declare maybe_generate_missing_nextgen
as a callback to update_option_imagify_settings
. However, update_option_xxx hooks seem to only run when updating an option, not creating it. This is explained here and here, and can be seen in WP Core code.
I think we should declare maybe_generate_missing_nextgen
as a callback to add_option_imagify_settings as well
Also, don't know if it is related:
@Tabrisrp I am not sure to understand the meaning of this line in maybe_generate_missing_nextgen
if ( isset( $old_value['convert_to_avif'] ) && isset( $value['convert_to_avif'] ) ) {
return;
}
Don't we risk to bail out when both are set, but old value is set to 0, and new value to 1?
discussing here
Before submitting an issue please check that you’ve completed the following steps:
Describe the bug When we enable AVIF for the 1st time after fresh activation, AVIF won't be automatically generated (reactivate avif will make the creation works automatically)
To Reproduce Steps to reproduce the behavior:
Expected behavior Automatic creation of avif works even when activating the option for the 1st time
Screenshots Video and sample images screen-capture (84).webm
![mountain](https://github.com/wp-media/imagify-plugin/assets/76941962/36aab1b3-0937-4ddb-b575-7e377991140f)
Additional context Add any other context about the problem here.
Acceptance Criteria (for WP Media team use only) Clear instructions for developers, to be added before the grooming