This is not a question, but more of an informative post. As developers, have you noticed an increase in queries for any of your add-ons since updating to XF 2.2? If you haven't checked, you should. I'm currently working on updating my contacts add-on, and by a fluke noticed that a guest caused a query that should only happen for a logged in member. The reason is that guests can now post before registering, and so are assigned a user_id (a very big one, but one nonetheless).
That's all, . Happy and safe coding to all.
if ($visitor->user_id)
may return true for a guest depending on where this check is done (forum view in my case) and may cause unnecessary queries. My solution was to do a if ($visitor->username)
, and that removed the query that should not have happened for a guest.That's all, . Happy and safe coding to all.