BuddyDev

Search

[Resolved] BuddyPress Activity Spam

  • Participant
    Level: Enlightened
    Posts: 60
    lavish on #4559

    Hello Guys!

    Requesting help / tips against activity spam in BuddyPress. It has really become a headache, people create account just to post a few messages on activity wall which leaves us damage every time.

    Can we only mark a user spam or delete him? It doesn’t really help because they create a new account in a few minutes and post more spam messages again.

    Also, is there anyway to moderate bbPress new topics and replies?

    I wish there was a way to only allow messages from certain level members, earned by them after contributing to the community. All activities of new members should have been kept under moderation.

    Kindly help

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #4577

    Hi Lavish,
    Do you have akismet enabled? Some of the spams will be handled by it. Also, I do recommend limit activity posting rate(We have a plugin for that). Setting the limit to say 3 posts per minute is not going to affect normal users but will be a preventing some spam.

    There are other measures too like using certain parameters( age of registration, no. of friends etc) that can be used but it all depends on the target site. On BuddyDev, we had a lot of message/mention spam, so we disabled mention for non friends(only admins can be mentioned if not friends) and did a few more things to make spammers effort meaningless.

    I will suggest first thinking about some criteria and then writing code to make all users adhere to the criteria.

  • Participant
    Level: Enlightened
    Posts: 60
    lavish on #4587

    Hi Brajesh,

    Yes Akismet is enabled. Can you please help me with disabling mention for non friends(I must tell you that we do not have friends component active). So may be disabling mentions for all users other than admin would work for me.

    So, only admins can mention users and no other users can use mention functionality. I think this fix can greatly help me.

    Thank you

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #4604

    Sure. I will post the code/tutorial in a day 🙂

  • Participant
    Level: Enlightened
    Posts: 60
    lavish on #4647

    Hello @sbrajesh

    Can you kindly help me with that code?

    Thank you very much 🙂

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #4732

    Hi Lavish,

    Try the following code in your bp-custom.php file and let me know if it works or not.

    
    add_filter( 'bp_activity_at_name_do_notifications', 'buddydev_disable_bulk_public_message', 10, 4 );
    function buddydev_disable_bulk_public_message( $do_disable, $usernames, $user_id, $activity ) {
    
    	//if the logged in or the mentioned user is super admin, let the message go, else not
    	if ( is_super_admin() || is_super_admin( $user_id ) ) {
    		return $do_disable;
    	} elseif ( function_exists( 'friends_check_friendship' ) && friends_check_friendship( $user_id, bp_loggedin_user_id() ) ) {
    		return $do_disable;
    	}
    
    	return false;
    }
    
    

    Thank You
    Ravi

  • Participant
    Level: Enlightened
    Posts: 60
    lavish on #4742

    Thank you for the code @ravisharma I tried this code and it did not disable mention function for users.

    I was looking for a way to disable mention functionality for users other than admins. OR may be other than friends if friends component is enabled.

    So for example if I type @ravisharma it should not create a link and notification to you because I am not an admin here or friend with you (friends, if the component is active).

    FYI, I tried the code in functions.php, do you think I should try in bp-custom.php instated?

    Thank you for the help

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #4755

    Hi Lavish,
    Most probably you tested it while you were logged in as admin. Please try testing it with normal user accounts.

    Admins can mention anyone.

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #4756

    Hi Lavish,

    I have checked this code in current theme functions file and working fine for me.

    Notification will receive by user in the following case

    1. User mentioning is Super Admin.
    2. User mentioning to Super Admin.
    3. User is a friend

    No notification will receive in any other case

    Thank You
    Ravi

  • Participant
    Level: Enlightened
    Posts: 60
    lavish on #4761
    This reply has been marked as private.

The topic ‘ [Resolved] BuddyPress Activity Spam’ is closed to new replies.

This topic is: resolved