`($user['username']) ?: '')` seems very pointless - it assumes that the username key is set, otherwise it'll throw an error. But if it's empty you use an empty string which it would be anyway, so this might as well just be replaced with $user['username'] and will have the same effect. I imagine you meant to set isset? And the same probably goes for the user_email and user_jabber checks in the ifs?