Skip to:

Opened 4 years ago

Closed 4 years ago

#8326 closed enhancement (fixed)

Apply UGC attribute for activity links

Reported by: vapvarun's profile vapvarun Owned by: imath's profile imath
Milestone: 7.0.0 Priority: normal
Severity: normal Version: 6.1.0
Component: Activity Keywords: has-patch 2nd-opinion


Recently Google has updated its policy for nofollow attributes and they will be considered as hints.

Link attribution can be done in three ways: "nofollow", "sponsored", and "ugc" — each signifying a different meaning. (The fourth way, default, means no value attributed).

Activities are in general user-generated content, we can use UGC instead of nofollow or combination of both attributes.

for example, rel="nofollow ugc" is also valid.

Attachments (1)

8326.patch (982 bytes) - added by vapvarun 4 years ago.
nofollow with UGC

Download all attachments as: .zip

Change History (9)

4 years ago

nofollow with UGC

#1 @imath
4 years ago

  • Keywords has-patch commit added
  • Milestone changed from Awaiting Review to 7.0.0

Thanks a lot @vapvarun let’s do it!

#2 @imath
4 years ago

  • Keywords 2nd-opinion added; commit removed

I just had another look into it, what happens for activities containing links before this patch is applied ? I believe they shouldn't have the ugc rel attribute.

We should probably do str_replace( array( ' rel="nofollow"', " rel='nofollow'", ' rel="nofollow ugc"', " rel='nofollow ugc'"), '', $text ). What do you think?

#3 @vapvarun
4 years ago

@imath yes it will be more general scope, I had considered that Nofollow is added using the above filter almost all activities as HTML is not allowed in general unless admins have added with Nofollow manually on purpose.

With the initial approach, it will allow them to keep those links with nofollow only without UGC on which they have added Nofollow manually. eg

Last edited 4 years ago by vapvarun (previous) (diff)

#4 @imath
4 years ago

@vapvarun I'm now wondering: should we only add this ugc attributes for the activity_update activity type ? Or should it be all activity type, some activity types, if so which ones ?

#5 @vapvarun
4 years ago

@imath, we can go with all activities in general terms. All activities are UGC, whether it's a specific activity type or added by any user role.

This ticket was mentioned in Slack in #buddypress by imath. View the logs.

4 years ago

This ticket was mentioned in Slack in #buddypress by imath. View the logs.

4 years ago

#8 @imath
4 years ago

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

In 12756:

Activity: adds the ugc rel attribute to activity item links

Props vapvarun

Fixes #8326

Note: See TracTickets for help on using tickets.