Matomo user synchronisation error

Hello all,
we use the matomo wordpress plugin on the website of our business club. We have over 8000 members who are all wordpress users. Now we have the problem that every time a user should be edited or deleted, a 500 error is returned and the action is not feasible. a look into the logfiles shows that matomo wants to synchronise all users every time and actually creates a matomo user for all wordpress users (and because of the limited maximum script execution time, the synchronisation stops). Is it possible to change this behaviour? only administrators and editors should be matomo users, as only they have backend access. Or is the standalone variant necessary for this?

Translated with www.DeepL.com/Translator (free version)

Hi @ruth.n

sorry about that! Generally speaking I would say the standalone version of Matomo On-Premise may be better suited but we can still try to make this work. The sync would already only synchronise the users that have access to Matomo but it will need to check for all 8000 members whether they have access or not.

Are you able to make changes to a plugin file in your WordPress installation by any chance? We could try something to see if this fixes the issue and then we could offer this as an option. Matomo would then no longer synchronise the users every time you edit or add a user but only sync them during the background. This mostly means if you create for example a new admin then it may take a while for this change to be reflected in Matomo but such users might be created rarely.

In case you are familiar with editing files, could you edit the file wp-content/plugins/matomo/classes/WpMatomo/User/Sync.php and remove these six lines? https://github.com/matomo-org/matomo-for-wordpress/blob/4.3.0/classes/WpMatomo/User/Sync.php#L51-L56

This may fix the issue for you. Be great to let us know if this helps.

Hi @thomas_matomo , thanks for the reply. I was a little afraid that this is a normal behavior. For our new website we will install the standalone variant, I had installed the plugin on ours because my employer needed a tracking tool ‘fast’. As soon as I get to it, I will make the change you suggested and tell the again what it brought. many greetings,

Ruth

Thanks for this. Let me know how this goes and I could potentially add a fix to improve this automatically in the future.

Hi @thomas_matomo,

i have commented out the lines in question and it seems to be working. i have asked my staff, who are responsible for our user administration, to give me feedback again during the week if any problems arise.

thanks for the quick help!

Thank you for testing and confirming it @ruth.n. Very appreciated. I’ve created an issue for it here and put it in the current milestone https://github.com/matomo-org/matomo-for-wordpress/issues/460 . It may take a few months but we’ll be working on this.

Hi @thomas_matomo, the plugin works with the changes as it should.
Thanks for the help!