Make WordPress Core

Opened 9 years ago

Closed 8 years ago

#37007 closed enhancement (fixed)

Allow Ability to Disable Pingbacks and Trackbacks by Protocol

Reported by: dshanske's profile dshanske Owned by: rachelbaker's profile rachelbaker
Milestone: 4.7 Priority: low
Severity: trivial Version: 1.2
Component: Pings/Trackbacks Keywords: has-patch commit
Focuses: Cc:

Description

Related #36576, which covers making it easier to disable sending of linkbacks by protocol in a functional manner..

The form I am thinking this would take would be a filter that filtered an array of protocols to receive and another for protocols to send, hooking this in to the various areas.

Attachments (3)

37007.diff (491 bytes) - added by dshanske 8 years ago.
Add functionality to disable trackback processing
37007.2.diff (944 bytes) - added by dshanske 8 years ago.
Improvements suggested by @rachelbaker
37007.3.diff (821 bytes) - added by rachelbaker 8 years ago.
Included $tb_id in the action parameters

Download all attachments as: .zip

Change History (21)

#1 @dshanske
9 years ago

The function I am thinking would be allowed_ping_protocol and would be filterable.

It would be called in wp_trackback, do_all_pings, and pingback_ping and terminate, skip, or reject if the protocol was not allowed.

This ticket was mentioned in Slack in #core-comments by dshanske. View the logs.


8 years ago

@dshanske
8 years ago

Add functionality to disable trackback processing

#3 @dshanske
8 years ago

  • Keywords has-patch added

In the interest of simplicity, I created a patch for an alternate solution. A hook that runs when wp-trackback is triggered that can either be used to process the trackback in lieu of the existing code(allowing it to be possibly enhanced or moved into a function attached to same, but to simply add an exit which will not process anything.

This ticket was mentioned in Slack in #core by dshanske. View the logs.


8 years ago

This ticket was mentioned in Slack in #core-comments by dshanske. View the logs.


8 years ago

#6 @rachelbaker
8 years ago

@dshanske Looking at 37007.diff I noticed you aren't passing any values for the action. How would you then use this hook to determine if you would allow the trackback?

#7 @rachelbaker
8 years ago

  • Keywords needs-refresh added

@dshanske
8 years ago

Improvements suggested by @rachelbaker

#8 @dshanske
8 years ago

@rachelbaker I moved it to accommodate the 4 parameters extracted from $_POST.

#9 @dshanske
8 years ago

  • Keywords dev-feedback added; needs-refresh removed

This ticket was mentioned in Slack in #core-comments by dshanske. View the logs.


8 years ago

#11 @dshanske
8 years ago

  • Milestone changed from Awaiting Review to 4.7
  • Priority changed from normal to low
  • Severity changed from normal to trivial

#12 @jorbin
8 years ago

@rachelbaker Can you take another look at this patch?

This ticket was mentioned in Slack in #core by chriscct7. View the logs.


8 years ago

@rachelbaker
8 years ago

Included $tb_id in the action parameters

#14 @rachelbaker
8 years ago

@dshanske Looking through 37007.2.diff I started feeling as though this hook would be more useful if we could include a populated $td_id (the comment_post_ID). To do that, the action needs to move lower in the function to occur JUST before the trackback is added. See 37007.3.diff where I move the pre_trackback_post action down several lines and add the $tb_id parameter.
Would this still fit your use-case?

#15 @dshanske
8 years ago

Since the goal is to allow an easy disabling of receiving trackbacks separate from pingbacks and/or allow for an improved trackback handler that is more security sensitive, that would not interfere with that goal.

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


8 years ago

#17 @rachelbaker
8 years ago

  • Keywords commit added; dev-feedback removed
  • Owner set to rachelbaker
  • Status changed from new to assigned

#18 @rachelbaker
8 years ago

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

In 38791:

Pings/Trackbacks: Add new pre_trackback_post action before a trackback is added to a post.

Props dshanske, rachelbaker.
Fixes #37007.

Note: See TracTickets for help on using tickets.