wp-media / imagify-plugin

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

PHP Deprecated notice for Imagify_Files_Iterator::accept() #734

Closed vmanthos closed 1 year ago

vmanthos commented 1 year ago

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

Describe the bug

The following appears in the debug.log (PHP 8.1):

PHP Deprecated:  Return type of Imagify_Files_Iterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /shared/httpd/wprocketest/htdocs/wp-content/plugins/imagify-plugin/inc/classes/class-imagify-files-iterator.php on line 65

To Reproduce

Steps to reproduce the behavior:

  1. Go to Imagify's settings page (/wp-admin/options-general.php?page=imagify)
  2. Add a custom folder: image
  3. Check the debug.log

Expected behavior

No deprecation notices should be there in the debug.log.

Screenshots

N/A

Additional context

N/A

Backlog Grooming (for WP Media dev team use only)

Mai-Saad commented 1 year ago

Using PHP 8.2, can see the following error with the steps below: [12-Jul-2023 08:37:58 UTC] PHP Deprecated: Return type of Imagify_Files_Recursive_Iterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/new.rocketlabsqa.ovh/htdocs/wp-content/plugins/imagify/inc/classes/class-imagify-files-recursive-iterator.php on line 55 steps: 1- from the settings page, add the theme to the optimization process 2- from bulk optimization, select only custom folders and click imagify all Notes:

Mai-Saad commented 1 year ago

Can see the following error with the following steps: 1- Select folders for optimization at the settings page 2- Visit https://new.rocketlabsqa.ovh/wp-admin/upload.php?page=imagify-files 3- Click scan your selected folders and check logs [13-Sep-2023 09:29:51 UTC] PHP Deprecated: Return type of Imagify_Files_Recursive_Iterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/new.rocketlabsqa.ovh/htdocs/wp-content/plugins/imagify-plugin/inc/classes/class-imagify-files-recursive-iterator.php on line 55 Note: using PHP 8.2.10 and imagify on 2.1.1