Skip to:
Content

BuddyPress.org

Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#6274 closed defect (bug) (fixed)

#5669 stops blog post activity being recorded on site where search engines are discouraged

Reported by: rogercoathup's profile rogercoathup Owned by: johnjamesjacoby's profile johnjamesjacoby
Milestone: 2.2.2 Priority: normal
Severity: normal Version:
Component: Activity Keywords:
Cc: roger@…

Description

This is a follow-up to #5669.

These amends have stopped activity items for blog posts from working in multisite installation where the WordPress option "Discourage search engines from indexing this site" is enabled.

In 2.1 with the bp_blogs_record_post approach, we could get activity items generated for these sites (where search engines are discouraged) by filtering bp_is_blog_public() to always return true.

This no longer works in 2.2. -- as the new_blog_post activity type isn't registered initially when search engines are discouraged.

What do you suggest is the best approach to keep activity recording, but also keep the sites hidden from search engines? Is there an alternative function we can filter on to ensure the new_blog_post activity type is registered / generated?

---

p.s.: Not recording activity items if a blog is hidden from search engines, does not seem like a good generic solution -- it satisfies one use case (blog farms with independent users), but fails to satisfy other equally valid use cases. For example, in this case, the client (a multinational) has a network of sites for their employees -- the sites are private (so no search engine indexing), but an activity steam recording blog posts is required.

Change History (5)

#1 @rogercoathup
10 years ago

  • Cc roger@… added

I suggest amending line 84 in bp-blogs-loader.php as the quickest fix:

from:

if ( 0 !== (int) get_option( 'blog_public' )
! is_multisite() ) {

to:

if ( 0 !== apply_filters( 'bp_is_blog_public', (int) get_option( 'blog_public' ) )
! is_multisite() ) {

This is the same code as used in bp-blogs-filters.php line 114, and bp-blogs-functions.php line 594. So, is a consistent solution.

note:
It would be nice to see an approach in the future though that didn't equate search engine visibility with activity tracking.

Last edited 10 years ago by rogercoathup (previous) (diff)

#2 @boonebgorges
10 years ago

  • Milestone changed from Awaiting Review to 2.2.2

Thanks for the report, rogercoathup. What you've described is definitely a regression.

I suggest amending line 84 in bp-blogs-loader.php as the quickest fix

Yes, this looks right to me. We should try to mirror the previous config exactly. imath, could you review this please?

It would be nice to see an approach in the future though that didn't equate search engine visibility with activity tracking.

Yes, I agree wholeheartedly. Related: #3857.

#3 @johnjamesjacoby
10 years ago

Strict checking zero here seems like a mistake. _is_ functions insinuate returning a bool value.

I'm fine fixing this like this in 2.2.2, and think we should introduce a bp_is_blog_public() function that returns a proper bool value instead for 2.3, and adjust our comparisons accordingly.

#4 @johnjamesjacoby
10 years ago

  • Owner set to johnjamesjacoby
  • Resolution set to fixed
  • Status changed from new to closed

In 9603:

Run results of blog_public value through bp_is_blog_public filter in Blogs loader. This fixes a regression preventing activity stream items being created for new posts where search engines are discouraged. Props rogercoathup. Fixes #6274.

#5 @r-a-y
9 years ago

In 9898:

Blogs: Run results of blog_public value through bp_is_blog_public filter.

Mirrors r9603 from 2.2-branch, but for trunk.

See #6274.

Note: See TracTickets for help on using tickets.