The process of registration is taking way too long (22 secs) so I've been profiling the plugin execution to see what is happening. My registration process is something I do with a custom component (for mobile registration). I've also got a couple of plugins that are fired with onUserAfterSave
and a third custom plugin. So I though the problem was with my plugins but they seem pretty quick. What is slow is the time between and the fact that my plugins are called twice. This is the execution flow:
2014-05-06T18:39:50+00:00 INFO - mobileregister..START Joomla save
2014-05-06T18:39:56+00:00 INFO - Start of onUserAfterSave in RegRedirect 2014-05-06T18:39:56+00:00 INFO
2014-05-06T18:40:02+00:00 INFO - Start of onUserAfterSave in RegRedirect 2014-05-06T18:40:02+00:00 INFO
- End of onUserAfterSave in RegRedirect2014-05-06T18:40:02+00:00 INFO - ResetToken START - onUserAfterSave 2014-05-06T18:40:02+00:00 INFO -
ResetToken END - onUserAfterSave2014-05-06T18:40:11+00:00 INFO - ResetToken START - onUserAfterSave 2014-05-06T18:40:11+00:00 INFO -
ResetToken END - onUserAfterSave2014-05-06T18:40:12+00:00 INFO - mobileregister..END Joomla save
My plugins RegRedirect and ResetToken are being called twice (not SetLimits). The time between that is several seconds. Any ideas on what I can do to figure out what is going on?
EDIT:
I have a bit more clues of what is going on. It seems the code to add a user to a group triggers all the onUserAfterSave events again. This is the code I have in RegRedirect.
JUserHelper::addUserToGroup($user['id'], $service_provider["usergroup_id"]);
Is there any way to avoid this?
End of onUserAfterSave in RegRedirect
so I'm wondering if it's more something odd with your log dumps?End of onUserAfterSave in RegRedirect
. You can also see that there are 2ResetToken
plugins called as well. Very confused...addUserToGroup
then launches all theonUserAfterSave
events again. Makes sense but it is duplicating things. Seems like a good practice is to never useaddUserToGroup
inonUserAfterSave
. I need to figure out how to add a user to a group during registration withoutaddUserToGroup
.