Skip to:

Best way to limit friend requests to avoid spam

  • Avatar of tifire


    One new member of our site sent friend requests to almost all other members. Even though he may not be a spammer, this did get me nervous. A spammer could just do the same and send friend requests to hundreds of members and ruin the site quickly.

    To avoid spam, I would like to limit the number of friend requests a member can send per hour. I have a couple of questions and hope someone can help:
    1) what’s the best way to get the number of friend requests a member has already sent in given period. Is there a buddypress function to return the number of friend request, or shall I do a WP database query?
    2) After getting the number, the next step is to check if this is bigger than the maxium. The function friends_action_add_friend() seems to be the one that decides if a friend request can be sent, but I didn’t find any action there. Can someone tell me if friends_action_add_friend() is the correct function to look at?

    I would like to do the same to limit the number of updates, comments posted or groups created per hour. I hope similar method can be used.

    Thanks a lot.

Viewing 6 replies - 26 through 31 (of 31 total)
Viewing 6 replies - 26 through 31 (of 31 total)

You must be logged in to reply to this topic.