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

Invalid argument supplied for foreach #114

Open
benoitchantre opened this issue May 16, 2022 · 6 comments · May be fixed by #145
Open

Invalid argument supplied for foreach #114

benoitchantre opened this issue May 16, 2022 · 6 comments · May be fixed by #145
Labels
bug Something isn't working

Comments

@benoitchantre
Copy link
Contributor

benoitchantre commented May 16, 2022

What WordPress, PHP and Simple SMTP versions are you using?
e.g. WordPress 5.6, PHP 7.3, Simple SMTP 1.0.0. The more, the better.

  • WordPress 5.8.3
  • Simple SMTP 1.3.1

Describe the bug
In src/mail/class-mail.php on line 13

Steps to reproduce

  1. Enable WP_DEBUG and WP_DEBUG_LOG
  2. Enable debug log in Simple SMTP
  3. Send a test email
  4. Check debug.log for errors
@benoitchantre benoitchantre added the bug Something isn't working label May 16, 2022
@soup-bowl
Copy link
Owner

soup-bowl commented May 16, 2022

Line 13 of class-mail.php is an import statement?

use wpsimplesmtp\Log;

I'm also not able to replicate the bug on my test copy of 1.3.1. Perhaps a screenshot of the error will help to collaborate the issue? There's a foreach statement in class-mail.php on line 135 that I'm wondering it might be referring to.

@benoitchantre
Copy link
Contributor Author

Sorry, I made a typo. The error is on line 135.

@soup-bowl
Copy link
Owner

Sorry, I made a typo. The error is on line 135.

No worries - looks like the error will be coming from the attachment segment. Will run some trials when time permits.

@soup-bowl
Copy link
Owner

It actually didn't strike me that an issue on line 13 could've been 135... Ahh, it's been a long day.

@benoitchantre
Copy link
Contributor Author

I can't reproduce that anymore.

@benoitchantre benoitchantre closed this as not planned Won't fix, can't repro, duplicate, stale Jul 28, 2022
@benoitchantre benoitchantre reopened this May 10, 2023
@benoitchantre
Copy link
Contributor Author

I still get some warnings on a website using the latest available version of WordPress (6.2) and Simple SMTP (1.3.2.2).

On this website, the logs are enabled.

Here are the related warnings:

PHP message: PHP Warning: foreach() argument must be of type array|object, string given in /home/clients/1234567789/sites/loremipsum/releases/4/public/plugins/simple-smtp/src/log/class-log.php on line 169
PHP message: PHP Warning: foreach() argument must be of type array|object, string given in /home/clients/1234567789, referer https://loremipsumdomain.net/wp/wp-admin/options-general.php?page=wpsimplesmtp&wpss_page=103&ssnonce=e615b19cbb 

benoitchantre added a commit to benoitchantre/wp-simple-smtp that referenced this issue Jul 27, 2023
@benoitchantre benoitchantre linked a pull request Jul 27, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants