#1688 closed defect (bug) (fixed)
Exempt Admins from comment throttle
Reported by: | obenland | Owned by: | 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)
Change History (20)
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
#5
in reply to:
↑ 4
@
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
@
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.
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
@
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
@
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
#14
follow-up:
↓ 17
@
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:
↓ 16
@
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
@
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
@
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 themoderate_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.
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.