buddyboss-platform
buddyboss-platform copied to clipboard
Fixing bug that results in object cache not being used for check_user_suspend, resulting in hundreds of duplicate queries
I am getting hundreds of duplicate queries as a result of this function. When a user is not suspended, the wpdb query returns null
, which the wp_cache_get mechanism in some object caching plugins treat as not existing.
The plugin that I am using is Redis Object Cache, and I submitted a pull request to them which was already merged. But there are surely other plugins that BB users are using that behave similarly and they'll never know.
If we instead store 0
when the user is not suspended, then it will work appropriately with any object caching plugin.