BuddyDev

BuddyPress Deactivate Account

BuddyPress Deactivate Account plugin allows users to deactivate/reactivate their account on a BuddyPress based social network. With this plugin, you allow your users to remove themself from any social activity or visibility. This plugin allows them to reactivate their account later without loosing any data.

This plugin can also be used to block users from logging to a BuddyPress site.

Features:-

  • Allow users to deactivate/reactivate account
  • Allow site admins to deactivate/reactivate user account
  • Allow site admins to block users from logging in
  • Option to automatically logout on deactivation(User will be logged out from all devices/sessions).
  • Option to automatically activate account on login
  • Option to send email notification to site admins and users on account activation/deactivation.
  • Easy to use admin panel
  • 100% translatable

You can use this plugin to let users activate/deactivate their account or as a tool to block users from your site.

When an account is deactivated:-

  • The deactivated user can not perform any action unless their account is active again.
  • Deactivated user’s activities are hidden from all user
  • Deactivated user’s profile is hidden from all users
  • Deactivated user can not receive/send friendship requests or messages
  • Deactivated users can not login(If admin enables this option).

This plugin will work if you have BuddyPress Settings component enabled.

Screenshots:-

Admin Settings:-

Front end account:-

 

Admin filtering and status updates:-

 

 

Account deactivate message:-

notice-user

If admin has allowed users to activate/deactivate their account, a user can deactivate/reactivate their account by visiting settings page from their profile.

BuddyPress Deactivate Account Plugin API:-

The BuddyPress deactivate account plugin provides simple api for activating, deactivating account and checking the status of the account using a few lines of code.

Mark a user account inactive:-

Mark the user account active:-

Check if a user account is inactive:-

Check if a user account is active:-

You can use the previous function with a negation, or use the following function:-

Check if logged in user’s account is inactive:-

You can either use bp_account_deactivator()->is_inactive( get_current_user_id() ) or you can use the following:-

The benefit of using is_logged_user_inactive() is that it stores the state in a static variable and repeatative calls are inexpensive.

Check if displayed user account is inactive:-

Like the logged in account, you can check for this using bp_account_deactivator()->is_inactive( bp_displayed_user_id() ) or the following call

The benefit of  using is_displayed_user_inactive() is better performance on repetitive calls.

CSS Classes in Body:-

The following css classes are added on ‘body’ element based on user status.

  • For inactive logged in user :- bp-deactivator-logged-inactive
  • For active logged in user:- bp-deactivator-logged-active
  • For inactive displayed user:- bp-deactivator-displayed-inactive
  • For active displayed user:- bp-deactivator-displayed-active

You can use it to target and style specific elements if you wish to do so.

Release History

  • Version: 1.1.4

    Sunday, 17 June, 2018
    • Tested With: BuddyPress 3.1
    • Compatible With: BuddyPress 2.5+

    Fix admin notification.
    Make sure the pt settings is not loaded early.

  • Version: 1.1.3

    Tuesday, 01 May, 2018
    • Tested With: BuddyPress 2.9.4
    • Compatible With: BuddyPress 2.5+

    1. If logout is enabled, Logout user from all devices on account deactivation.
    2. Added css classes to body to allow easy styling.

  • Version: 1.1.2

    Wednesday, 06 December, 2017
    • Tested With: BuddyPress 2.9.2
    • Compatible With: BuddyPress 2.5+

    Fix the settings notice which needed double saving to show correct message.

  • Version: 1.1.1

    Saturday, 04 November, 2017
    • Tested With: BuddyPress 2.9.2
    • Compatible With: BuddyPress 2.5+

    Fix the settings loader path to be case sensitive.

  • Version: 1.1.0

    Wednesday, 27 September, 2017
    • Tested With: BuddyPress 2.9.1
    • Compatible With: BuddyPress 2.5+

    Major Updates with email notifications for activation/deactivation, user blocking, admin users list of deactivated users and a lot more. Please see plugin page for details.

  • Version: 1.0.6

    Friday, 30 June, 2017
    • Tested With: BuddyPress 2.8.2
    • Compatible With: BuddyPress 2.5+

    Updated to fix translation of the account status tab title.

  • Version: 1.0.5

    Friday, 17 March, 2017
    • Tested With: BuddyPress 2.8.2
    • Compatible With: BuddyPress 2.5+

    Updated and tested with BuddyPress 2.8.2.

  • Version: 1.0.4

    Wednesday, 28 December, 2016
    • Tested With: BuddyPress 2.7.4
    • Compatible With: BuddyPress 2.0+

    Updated to allow admins to set user accounts active/deactive from front end too. Also fix the total number of active users/

  • Version: 1.0.3

    Thursday, 04 August, 2016
    • Tested With: BuddyPress 2.6.1.1
    • Compatible With: BuddyPress 2.0+

    Fix a typo in the notice message.

  • Version: 1.0.2

    Tuesday, 12 July, 2016
    • Tested With: BuddyPress 2.6.1.1
    • Compatible With: BuddyPress 2.0+

    Updated for BuddyPress 2.5.1. Improves code.

  • Version: 1.0.1

    Thursday, 22 October, 2015
    • Tested With: BuddyPress 2.3.4
    • Compatible With: BuddyPress 2.0

    Add translation support.
    Allow Admins to update User account status from Dashboard->Edit user page.

  • Version: 1.0.0

    Monday, 25 May, 2015
    • Tested With: BuddyPress 2.3.4
    • Compatible With: BuddyPress 2.0+

    Initial release

Subscribe