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

Fix generation of next gen images with first settings save of avif option #834

Merged

Conversation

wordpressfan
Copy link
Contributor

@wordpressfan wordpressfan commented Mar 1, 2024

Description

Run next gen generation for the first settings save and add few comments in code to explain what is going on there.

Fixes #825

Documentation

User documentation

This will trigger generating next generation images when enabling the avif option and rewrite rules.

Technical documentation

Explain how this code works. Diagram & drawings are welcomed.

Type of change

Delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue).

New dependencies

List any new dependencies that are required for this change.

Risks

List possible performance & security issues or risks, and explain how they have been mitigated.

Checklists

Feature validation

  • I validated all the Acceptance Criteria. If possible, provide sreenshots or videos.
  • I triggered all changed lines of code at least once without new errors/warnings/notices.
  • I implemented built-in tests to cover the new/changed code.

Documentation

  • I prepared the user documentation for the feature/enhancement and shared it in the PR or the GitHub issue.
  • The user documentation covers new/changed entry points (endpoints, WP hooks, configuration files, ...).
  • I prepared the technical documentation if needed, and shared it in the PR or the GitHub issue.

Code style

  • I wrote self-explanatory code about what it does.
  • I wrote comments to explain why it does it.
  • I named variables and functions explicitely.
  • I protected entry points against unexpected inputs.
  • I did not introduce unecessary complexity.
  • I listed the introduced external dependencies explicitely on the PR.
  • I validated the repo-specific guidelines from CONTRIBUTING.md.

Observability

  • I handled errors when needed.
  •  I wrote user-facing messages that are understandable and provide actionable feedbacks.
  • I prepared ways to observe the implemented system (logs, data, etc.).

Risks

  •  I explicitely mentioned performance risks in the PR.
  • I explicitely mentioned security risks in the PR.

…nts in code to explain what is going on there.
@wordpressfan wordpressfan self-assigned this Mar 1, 2024
@piotrbak piotrbak linked an issue Mar 1, 2024 that may be closed by this pull request
@MathieuLamiot
Copy link
Contributor

Don't block the PR for this, but it could be nice to update the doc string or comment the method here to clearly state:

  • the expected behavior (only run when moving the avif conversion for off to on)
  • the parameter's expected value (not set / 1)
    That could avoid some headache next time we work on this :D

@Mai-Saad
Copy link

Mai-Saad commented Mar 3, 2024

Now AVIF is created for 1st activation. with the following note:

  • on main branch: when deactivate avif, we will automatically generate missing webP for existing image => on PR we won't automatically create webP for existing image in this case => in this case the generate missing next-gen will keep loading but nothing will be generated
    @piotrbak what do you think? In this case, either we need to automatically generate webp for existing images when deactivate avif or not automatically clicking generate missing next-gen btn.

@piotrbak
Copy link

piotrbak commented Mar 3, 2024

@Mai-Saad This behaviour is acceptable for the initial 2.2

@piotrbak
Copy link

piotrbak commented Mar 4, 2024

@Mai-Saad @wordpressfan I can see that the PR is still a draft/in-progress. Where are we with this one?

@wordpressfan wordpressfan marked this pull request as ready for review March 4, 2024 13:33
@wordpressfan
Copy link
Contributor Author

I think we are fine here based on the comments above but I requested a review from @Mai-Saad @Tabrisrp and @MathieuLamiot to add their review.

@Mai-Saad Mai-Saad merged commit 610acc3 into feature/avif Mar 4, 2024
1 check passed
@Mai-Saad Mai-Saad deleted the fix/825-run-nextgen-generation-for-first-settings-save branch March 4, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1st activation of avif won't run automatically in the background
5 participants