We are using the BuddyDev Community theme on our site and our host LiquidWeb finally worked out a massive performance issue with our site that was literally bringing PHP and MySQL down regularly and they kept needing rebooting.
We had the feature turned on to show the notification symbol (a bell I think – I’m vision impaired so can’t recall) and the number of notifications next to it.
After only nearly 2 weeks of operating with only minimal activity but 5000 registered users we had 400000 notifications in the DB and every page load for every logged in user was calculating the number of notifications afresh and not caching or storing the result in the DB for the next page load. The server simply couldn’t cope.
We have now removed this notification symbol with the notification count from the pages and the site is fine again. I have also changed the number of days setting on your clear notifications plugin to only 5 days.
My question is regarding the notifications menu item on every page that is still part of the menu we have in place. It doesn’t show initially but when you hover on the menu and display the sub menu – read,unread etc it still has a number there telling you the number of notifications.
Is that still being calculated on every page load, only when people show the full sub menu?
Either way could you add an option to the theme to let us keep the notification menu with all its sub choices but not to calculate or display the number of unread notifications.
We are going to have to work out a way of caching notifications or getting them under control to keep our site working.
Thank you for reporting.
1. Yes, It is still being calculated.
We are not doing it here, BuddyPress is. We are simply scrapping the contents from admin bar and putting it as sub menu there. This needs to be changed in BuddyPress. I will report it on the trac.
For bell icon, we can easily optimize the count by using another function bp_notifications_get_unread_notification_count() which caches notifications count.
I will push an update tomorrow and bell icon will work.
For the sub menu item, since the fix needs to be in BuddyPress, I will share some code here that you may use to optimize it.
Please allow me to assist you on 2nd/3rd April.
Doing a WP update check I see there is a new version of the theme showing at V1.1.7
However the latest download version from the theme page here is 1.1.6
And the release notes page hasn’t been updated yet.
So just checking whether the notifications issue is the only change to see if I should test the update before installing?
I know you are really busy but just wanting to make sure of any potential change issues first.
Thank you for the patience.
In the new update, we have the following changes:-
1. Added support for new data export settings added by BuddyPress 4.0+
2. Added support for privacy on registration page(please make sure to check it). It’s a new feature in BP 4.0+
3. Used a function for cached notification count(supplied by BuddyPress)
The update still not resolves your issue with notification dropdown(fixes count though).
The problem with dropdown is it is supplied by BuddyPress(adminbar, and we scrap it from there to show in the theme). It will be an issue with all BuddyPress theme if you have adminbar enabled.
I have a question for your support team:- Can you ask them what in the notification query is causing the bottleneck? Is it the group by clause? This needs to be reported to BuddyPress team for a fix and I will love to see what is causing the bottlenek.
You must be logged in to reply to this topic.