boonebgorges / buddypress-docs

GNU General Public License v3.0
106 stars 44 forks source link

Activity stream protection should take place only when activity query may turn up Docs items #645

Closed boonebgorges closed 5 years ago

boonebgorges commented 5 years ago

bp_docs_access_protection_for_activity_feed() filters all activity queries to ensure that no off-limits Docs-related content gets into the activity feed. But the query introduces some database/cache overhead, and doesn't need to be performed if there's no chance that the activity query will include any Docs-related activity. We can generally tell this by looking at some combination of the activity query params and the SQL itself. Basically:

boonebgorges commented 5 years ago

@dcavins I've gone ahead and pushed this in, but please feel free to review - I think it's sufficiently cautious.