Making WordPress.org

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#1688 closed defect (bug) (fixed)

Exempt Admins from comment throttle

Reported by: obenland's profile obenland Owned by: obenland's profile obenland
Milestone: Priority: normal
Component: Plugin Directory Keywords:
Cc:

Description

When leaving internal notes to a plugin, don't prevent admins to add loads of comments in short succession.

Attachments (1)

exempt_plugin_admins_from_comment_throttle.patch (1.8 KB) - added by danieliser 8 years ago.
Patches for admin/class-customizations.php

Download all attachments as: .zip

Change History (20)

This ticket was mentioned in Slack in #meta by obenland. View the logs.


8 years ago

#2 @obenland
8 years ago

  • Milestone set to Plugin Directory v3 - M3

This ticket was mentioned in Slack in #meta by obenland. View the logs.


8 years ago

#4 follow-up: @danieliser
8 years ago

Can you give an example of how to duplicate the issue? If I try to add 1 character notes repeatedly I can't cause it to throttle me.

#5 in reply to: ↑ 4 @obenland
8 years ago

Replying to danieliser:

Can you give an example of how to duplicate the issue? If I try to add 1 character notes repeatedly I can't cause it to throttle me.

/cc @ipstenu

#6 @Ipstenu
8 years ago

1) Post "Mika is a terrible coder"
2) As soon as the page refreshes, post "No she's not!"
3) Get 'slow down' warning

This may be a user-role issue, though, so make sure you're NOT an admin.

#7 @danieliser
8 years ago

Got it thanks, will investigate, likely your right my user role was to high.

This ticket was mentioned in Slack in #meta by obenland. View the logs.


8 years ago

This ticket was mentioned in Slack in #meta by obenland. View the logs.


8 years ago

#10 @danieliser
8 years ago

Ok got 2 possible solutions for this one, I am thinking the second is probably better in terms of being more specific how it is applied.

Simplest may be to simply remove the following action when current users role is plugin admin, or plugin reviewer.

remove_action( 'check_comment_flood', 'check_comment_flood_db', 10, 3 );

Alternatively and probably more ideal as it will only fire in the specific event we are trying to solve, would be to simply filter 'comment_flood_filter' and return false if the user role is whitelisted and the $_REQUEST['comment_type'] == 'internal-note'.

Either solution should do the trick, just depends on how widespread the throttle exemption should be.

#11 @obenland
8 years ago

I think the latter would be the better way to go. Would you mind writing a patch and attaching it to this ticket?

This ticket was mentioned in Slack in #meta by obenland. View the logs.


8 years ago

@danieliser
8 years ago

Patches for admin/class-customizations.php

#13 @danieliser
8 years ago

Patch added.

#14 follow-up: @obenland
8 years ago

Thanks! Looking at check_comment_flood_db(), I think it might be more accurate if we gave plugin reviewers the moderate_comments capability to bypass it. What do you think?

#15 follow-up: @danieliser
8 years ago

Ill give it a shot, will the capabilites routine run automatically or deactivate/reactivate?

Definitely a simpler, more elegant solution. Looking at it now, I must have looked right past it ;)

The only question is, will there be anything else affected by that, does that give them access to anything else they shouldn't have?

#16 in reply to: ↑ 15 @obenland
8 years ago

Replying to danieliser:

Ill give it a shot, will the capabilites routine run automatically or deactivate/reactivate?

After adding the capability in class-capabilities.php uncomment this line for one page load to have it added.

will there be anything else affected by that, does that give them access to anything else they shouldn't have?

Good question, we should try it out and test it, not sure

#17 in reply to: ↑ 14 @danieliser
8 years ago

Replying to obenland:

Thanks! Looking at check_comment_flood_db(), I think it might be more accurate if we gave plugin reviewers the moderate_comments capability to bypass it. What do you think?

Ok, so that definitely does the trick as we suspected. We will need to double check no other extra functionality has been enabled, but since there are no posts for commenting nor standard comments to be moderated on this subsite it may a null point.

I am not 100% aquainted with this particular site, so may be best to get some feedback on the change from those better informed.

Will get a new patch up shortly.

#18 @obenland
8 years ago

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

In 3175:

Plugin Directory: Exempt Admins from comment throttle.

Props danieliser for initial patch.
Fixes #1688.

#19 @samuelsidler
8 years ago

  • Milestone Plugin Directory v3 - M3 deleted

Milestone Plugin Directory v3 - M3 deleted

Note: See TracTickets for help on using tickets.