wp-media / imagify-plugin

Speed up your website with lighter images without losing quality.
https://imagify.io
73 stars 26 forks source link

Closes #875 Add new option to select next-gen format #879

Closed remyperona closed 7 months ago

remyperona commented 7 months ago

Description

Add a new UI setting option to select the next-gen format to generate, or disable it.

Fixes #875

Checklists

Feature validation

Code style

Observability

Mai-Saad commented 7 months ago

@Tabrisrp Thanks for the PR, please find exploratory test notes below (WIP)

Screenshot from 2024-04-17 19-25-59

[18-Apr-2024 07:27:09 UTC] PHP Fatal error:  Uncaught TypeError: Imagify\Optimization\Process\AbstractProcess::get_suffix_from_format(): Argument #1 ($format) must be of type string, null given, called in /var/www/mai.rocketlabsqa.ovh/htdocs/wp-content/plugins/imagify-plugin/classes/Optimization/Process/AbstractProcess.php on line 1554 and defined in /var/www/mai.rocketlabsqa.ovh/htdocs/wp-content/plugins/imagify-plugin/classes/Optimization/Process/AbstractProcess.php:1570
Stack trace:
#0 /var/www/mai.rocketlabsqa.ovh/htdocs/wp-content/plugins/imagify-plugin/classes/Optimization/Process/AbstractProcess.php(1554): Imagify\Optimization\Process\AbstractProcess->get_suffix_from_format()
#1 /var/www/mai.rocketlabsqa.ovh/htdocs/wp-content/plugins/imagify-plugin/classes/Optimization/Process/AbstractProcess.php(500): Imagify\Optimization\Process\AbstractProcess->is_size_next_gen()
#2 /var/www/mai.rocketlabsqa.ovh/htdocs/wp-content/plugins/imagify-plugin/classes/Job/MediaOptimization.php(181): Imagify\Optimization\Process\AbstractProcess->optimize_size()
#3 /var/www/mai.rocketlabsqa.ovh/htdocs/wp-content/plugins/imagify-plugin/classes/Job/MediaOptimization.php(66): Imagify\Job\MediaOptimization->task_optimize()
#4 /var/www/mai.rocketlabsqa.ovh/htdocs/wp-content/plugins/imagify-plugin/inc/classes/Dependencies/deliciousbrains/wp-background-processing/classes/wp-background-process.php(516): Imagify\Job\MediaOptimization->task()
#5 /var/www/mai.rocketlabsqa.ovh/htdocs/wp-content/plugins/imagify-plugin/inc/classes/Dependencies/deliciousbrains/wp-background-processing/classes/wp-background-process.php(333): Imagify_WP_Background_Process->handle()
#6 /var/www/mai.rocketlabsqa.ovh/htdocs/wp-includes/class-wp-hook.php(324): Imagify_WP_Background_Process->maybe_handle()
#7 /var/www/mai.rocketlabsqa.ovh/htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#8 /var/www/mai.rocketlabsqa.ovh/htdocs/wp-includes/plugin.php(517): WP_Hook->do_action()
#9 /var/www/mai.rocketlabsqa.ovh/htdocs/wp-admin/admin-ajax.php(192): do_action()
#10 {main}
  thrown in /var/www/mai.rocketlabsqa.ovh/htdocs/wp-content/plugins/imagify-plugin/classes/Optimization/Process/AbstractProcess.php on line 1570