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

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

Closed
4 tasks
vmanthos opened this issue Jul 6, 2023 · 2 comments · Fixed by #748
Closed
4 tasks

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

vmanthos opened this issue Jul 6, 2023 · 2 comments · Fixed by #748
Assignees
Milestone

Comments

@vmanthos
Copy link
Contributor

vmanthos commented Jul 6, 2023

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

  • Made sure you’re on the latest version 👍 2.1.1
  • Used the search feature to ensure that the bug hasn’t been reported before 👍

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)

  • Reproduce the problem
  • Identify the root cause
  • Scope a solution
  • Estimate the effort
@Mai-Saad
Copy link

Mai-Saad commented Jul 12, 2023

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:

  • happening on Imagify 2.1.1 and 2.1.2
  • to reproduce the error in main issue, the custom folder shall have subfolder or just click add folder then cancel

@Mai-Saad
Copy link

Mai-Saad commented Sep 13, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants