Making WordPress.org

Opened 4 years ago

Last modified 5 months ago

#4950 reopened enhancement

Links in Trac tickets should be nofollow'd

Reported by: jonoaldersonwp's profile jonoaldersonwp Owned by: dd32's profile dd32
Milestone: Priority: lowest
Component: Trac Keywords: seo
Cc:

Description

Links in trac tickets should have a rel="nofollow" attribute, in order to reduce the attraction of the platform as a target for spammers.

Change History (11)

#1 @dd32
4 years ago

  • Keywords close added

Unfortunately Trac doesn't allow an easy way to do this.

https://trac.edgewall.org/ticket/3352 was closed as wontfix

The only way to achieve this is to write a Trac plugin, as comment content can't be altered within a Trac template.

#2 @jonoaldersonwp
4 years ago

  • Keywords close removed
  • Type changed from defect to enhancement

Can we write a Trac plugin?
Their legacy bad decisions shouldn't result in us leaving holes in our defences :)

#3 @dd32
4 years ago

We can, but we're not writing/deploying new plugins due to the lack of people to maintain them ongoing.

#4 @dd32
2 years ago

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

In 11548:

Trac: Mark links in ticket descriptions/comments as rel="ugc nofollow".

Fixes #4950.

#5 @dd32
2 years ago

Well, that definitely worked.

$ curl -s https://meta.trac.wordpress.org/ticket/4950 | grep 'ext-link'

<a class="ext-link" rel="ugc nofollow" href="https://trac.edgewall.org/ticket/3352"><span class="icon"></span>https://trac.edgewall.org/ticket/3352</a> was closed as wontfix<br />

#6 @dd32
2 years ago

Oh, also, just noting that you can't do a py:match against a.ext-link, as it seems that it can only match on elements that exist within the templates, not against the dynamic content inserted within those template tags.. although you can filter the template stream within the template tags as shown in the commit above.

#7 @dd32
2 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#8 @dd32
2 years ago

In 11565:

Trac: Revert [11548] to see if it's caused #6112.

See #6112, #4950.

#9 @dd32
2 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 11583:

Trac: Mark links in ticket descriptions/comments as rel="ugc nofollow". Take two.

[11548] was previously applying to all 'searchable' elements which includes the code browser.
The code browser uses a different String class, and being treated as a Markup string caused it to strip content that was unexpected within it.
This implements [11548] again verifying the specific string classes which we can alter, and narrowing it further by only applying to the ticket/comment classes and only when ext-link is present, to reduce potential breakage.

Fixes #4950.

#10 @dd32
5 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Re-opening because this isn't applying now, at least to prbot comments.

This has been causing some problems with the increase in GitHub spam which has been syncing through to WordPress.org Tracs.

Example: This link should be nofollowed, but isn't: https://example.org/

Last edited 5 months ago by dd32 (previous) (diff)

#11 @dd32
5 months ago

Somewhat annoyingly this is still working in my test Trac environment, so I'm not sure what the issue is, or how to debug it.

Note: See TracTickets for help on using tickets.