Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent activity from private sites to be visible in sitewide stream #11

Merged
merged 1 commit into from
Jan 25, 2022

Conversation

r-a-y
Copy link
Contributor

@r-a-y r-a-y commented Jan 25, 2022

BuddyPress will record blog post and comments into the activity stream if the Site Visibility setting is not zero:
https://github.com/buddypress/buddypress/blob/fea0e21ecc2847933bebc3b0aa126c519cda1082/src/bp-blogs/bp-blogs-filters.php#L107-L118

Because the More Privacy Options plugin adds visibility options that have negative values, this means that blog post and comment activity from private sites will end up being recorded and visible in the sitewide activity stream.

This PR opts to set the 'hide_sitewide' activity flag to zero for blog posts and comments from private sites.

However, it's worthwhile to note that if the Site Visibility option is set to 0 (Discourage search engines from indexing this site), BuddyPress will not even record the activity item. Instead of hiding the activity item as in this PR, should we be actively blocking the activity item from being recorded in the first place?

Having a record in the activity stream might be beneficial, so I opted to just hide it. But we can switch to blocking if we want to mirror what BuddyPress is doing. Looks like we decided internally to not do what BuddyPress is doing, so this PR should be fine.

@boonebgorges
Copy link
Owner

Thanks for the PR!

@boonebgorges boonebgorges merged commit d515801 into boonebgorges:master Jan 25, 2022
@r-a-y r-a-y deleted the hide-sitewide branch January 25, 2022 17:30
r-a-y added a commit to r-a-y/bp-mpo-activity-filter that referenced this pull request Jan 27, 2022
Previous commit (8e6a0ff) referenced the current site's visibility
setting. However, when a new site is created, it is created from the
main site, which is usually public. This meant the 'new_blog' activity
item could use the wrong 'hide_sitewide' value.

See boonebgorges#11.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants