Thomas
Forum Replies Created
-
Thanks. I’ll comment here once it’s done.
Just wanted to keep you updated that we’ll very likely fix this as part of our Matomo 4 update in about 2 months time. We’ll be trying to change how we’re sending emails quite a bit and hoping that it will be possible to workaround this issues then.
Hi @volkhardv
we have noticed the bug is really in the PHPMailer library that WordPress is using to send emails. We have created an issue to let them know and explained the problem in detail here: https://github.com/PHPMailer/PHPMailer/issues/2134
We have also created an internal issue for us here: https://github.com/matomo-org/wp-matomo/issues/347
As of right now there isn’t really anything more we can do but waiting to see what the people at PHPMailer say and hoping they fix it and WordPress to eventually include that fix. This could be all a quite long procedure unfortunately.
So far this seems to mostly only impact Outlook in Office 365 as we haven’t seen the issue anywhere else yet. Do you mind if we resolve this issue for now and we keep track of this in our internal issue where we will proceed when/if needed?
Sorry I don’t have better news right now. The only workaround right now be to use the reports maybe without PDF and instead choose “HTML” in the email report.
Just to keep you updated @volkhardv I’ve been troubleshooting this and signed up for an office 365 account. I’ve kind of found the problem but not sure yet if/how I can workaround it as it’s a problem in the PHP Mailer library that WordPress is using. I’ll keep you updated.
@shaodan1997 sorry about that. I reproduced it now and found the problem. Adjusted this line to make it work: https://github.com/matomo-org/wp-matomo/pull/345/files#diff-3ec228aed8229a7c92536865c7cef670R172
The patch will also be included in the next release. Thanks for noticing this and creating this issue.
@shaodan1997 thanks for this.
Are you familiar with editing files in your WordPress? If so, could you try to add the lines of code as shown in https://github.com/matomo-org/wp-matomo/pull/345/files to the file
wp-contnet/plugins/matomo/classes/WpMatomo/User/Sync.phpor replace the entire file with the content of this URL: https://raw.githubusercontent.com/matomo-org/wp-matomo/52129cc1d3cf5edae65d65e4288964ce5be3860c/classes/WpMatomo/User/Sync.phpThen, once the file was updated, go to
Matomo Analytics -> Diagnostics -> Troubleshooting -> Sync usersin your WP Admin and check if the language is now shown correctly?If you aren’t familiar with updating files let me know.
@shaodan1997 it should automatically use the same language as configured for your user in your WordPress Admin. What language is used in the WordPress Admin when you log in?
Hi @rovanov
I see you created the issue also in https://wordpress.org/support/topic/statistics-at-the-front-end/ which be the right place. Unfortunately we have to mark the issue as resolved here as it’s a different plugin and not related to this plugin and also not really a feature of Matomo On-Premise itself. Thanks for your understanding.
@rovanov Thanks for the offer. Because the data structure is quite simple and we can collect similar data when needed we won’t need to risk any privacy issues there. Very much appreciated the offer though.
@volkhardv I was trying various different SMTP plugins to see if they all have the same issue and this might be the case. It’s possible the problem is with the underlying PHPMailer used in WordPress and I’m quite certain this used to work nicely in WP 5.4 but maybe they introduced some regressions there with WP5.5. It’s a bit hard to say for me though since I’m not 100% sure if what I’m guessing is actually the issue (as I don’t have an Office365 email account).
Are you familiar with editing files in WordPress? Any chance you could edit the file in
wp-content/plugins/matomo/app/classes/WpMatomo/Email.phpand add a newline similar to what is shown here? https://github.com/matomo-org/wp-matomo/pull/344/files If you are familiar with this be great to make the change and see if this changes anything.It might be generally a rare issue since it seems most email clients don’t seem to have an issue except office 365 so far.
Thanks for the update @marcusschwarze
sorry about this. Things should work automatically if “default tracking” is enabled. Do you mind posting your system report (or sending it to wordpress at matomo.org) see https://matomo.org/faq/wordpress/how-do-i-find-and-copy-the-system-report-in-matomo-for-wordpress/ ? The report should be anonymised automatically. If you send us an email be great to let us know here in case it goes into spam.
If you can send us a URL to your website by email to wordpress at matomo.org as well then I’d check if the tracking code is embedded on the site or not. This would help identify where the problem might be (tracking code not embedded or tracking maybe not working).
@volkhardv I have been making some progress after comparing the raw data of the sent email with WP Mail SMTP and without.
For some reason, WP Mail SMTP seems to be sending the content type multipart header twice. First correct, and then wrong.
X-Mailer: WPMailSMTP/Mailer/smtp 2.3.1 Subject: Bericht matomo.org - Sonntag, 6. September 2020 To: XXXXX Date: Mon, 07 Sep 2020 00:59:34 +0000 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Content-Type: multipart/mixed; boundary="=_b6b583db8517f04c97054e73b519e750" MIME-Version: 1.0 Content-Type: multipart/mixed; charset=UTF-8 --=_b6b583db8517f04c97054e73b519e750 Content-Type: text/html; charset=utf-8It should look eg like this:
Date: Mon, 07 Sep 2020 01:06:07 +0000 Content-Type: multipart/mixed; boundary="=_d5ab96fc034189f00986380fc6767415" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline MIME-Version: 1.0 Message-Id: <...> --=_d5ab96fc034189f00986380fc6767415 Content-Type: text/html; charset=utf-8I’m assuming that most email clients are able to still handle this case but not all. Eg Office 365 might have problems with this.
I wonder if with this information WP Mail SMTP plugin developers could investigate what is going on. The header we’re passing to wp_mail is
From: Matomo Analytics <noreply@mytest.matomo> Subject: Bericht WP Single - Sonntag, 6. September 2020 Reply-To: root <yyy@zzz.com> To: yyy@zzz.com Date: Mon, 07 Sep 2020 01:14:14 +0000 Content-Type: multipart/mixed; boundary="=_f46657f72ef401aa1116d51b913469a0" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline MIME-Version: 1.0The same problems also seems to happen when sending this as header:
From: Matomo Analytics <noreply@mytest.matomo> Subject: Bericht WP Single - Sonntag, 6. September 2020 Reply-To: root <yyy@zzz.com> To: yyy@zzz.com Date: Mon, 07 Sep 2020 01:14:14 +0000 Content-Type: multipart/mixed; boundary="=_f46657f72ef401aa1116d51b913469a0" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline MIME-Version: 1.0Where there is no newline in the content type header (see change in https://github.com/matomo-org/wp-matomo/compare/develop…wpmailstmpnonewline?quick_pull=1 )
This resulted in WP Mail SMTP sending
Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Content-Type: multipart/mixed; boundary="=_8212204be310bf9d8a1ca054755ae8f9" MIME-Version: 1.0 Content-Type: multipart/mixed; charset=Thanks for suggesting this @rovanov
It’s not possible just yet.
I have installed that plugin and looked at their data structure to see how we can do this. I have for now created https://github.com/matomo-org/wp-matomo/issues/341 and we might work on this. It’s a bit of work but potentially not too complicated.
Do you mind if we mark this issue here as resolved and keep track of this on our GitHub: https://github.com/matomo-org/wp-matomo/issues/341 ?
We would develop this as a plugin and put it on our marketplace. We’d automatically detect when WP Statistics is installed and suggest to install it. We’d let you know here as soon as it is available.
Hi @marcusschwarze have you had a chance to look at my previous comment? Or is it maybe working by now?