Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1st activation of avif won't run automatically in the background #825

Closed
Mai-Saad opened this issue Feb 28, 2024 · 3 comments · Fixed by #834
Closed

1st activation of avif won't run automatically in the background #825

Mai-Saad opened this issue Feb 28, 2024 · 3 comments · Fixed by #834
Assignees
Labels
AVIF Avif branch/feature priority: medium Issues which are important, but no one will go out of business. severity: moderate type: bug
Milestone

Comments

@Mai-Saad
Copy link

Before submitting an issue please check that you’ve completed the following steps:

  • Made sure you’re on the latest version => commit 324c4fa
  • Used the search feature to ensure that the bug hasn’t been reported before

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:

  1. install and activate imagify
  2. upload some images (small, medium, big)
  3. activate avif => (notice that bulk notice isnot displayed)
  4. check media library => generate next-gen link displayed (nothing generated in background)

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
download (33)
file_example_JPG_100kB (1)
mountain

Additional context
Add any other context about the problem here.

  • Reactivate AVIF will work

Acceptance Criteria (for WP Media team use only)
Clear instructions for developers, to be added before the grooming

@Mai-Saad Mai-Saad added type: bug priority: medium Issues which are important, but no one will go out of business. severity: moderate AVIF Avif branch/feature labels Feb 28, 2024
@Mai-Saad Mai-Saad changed the title !st enable of avif won't run automatically in the background 1st enable of avif won't run automatically in the background Feb 28, 2024
@Mai-Saad Mai-Saad changed the title 1st enable of avif won't run automatically in the background 1st activation of avif won't run automatically in the background Feb 28, 2024
@piotrbak piotrbak added this to the 2.2 milestone Mar 1, 2024
@MathieuLamiot
Copy link
Contributor

MathieuLamiot commented Mar 1, 2024

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

@MathieuLamiot
Copy link
Contributor

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?

@MathieuLamiot
Copy link
Contributor

discussing here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AVIF Avif branch/feature priority: medium Issues which are important, but no one will go out of business. severity: moderate type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants