BuddyDev

Search

BP Deactivate Account – Bugs

  • Keymaster
    (BuddyDev Team)
    Posts: 24694
    Brajesh Singh on #53614

    Hi Katrine,
    Thank you for your patience.
    I have check the replies now and here is my answers for all the questions from above:-

    1. I will still need time to look into global search.

    2. For the forums part, we are not able to hide user efficiently. We are unable to support it currently.

    3. As explained, It is a bug in the theme’s companion plugin

    4. I was mistaken on this earlier. It is already restricted by settings. This is working for me, Please see the screenshot. I will suggest updating your configuration to restrict profile access for inactive user.
    The visitor gets redirected ot their own profile and see this
    https://i.ibb.co/6HBZD8f/Selection-393.png

    5. BuddyPress Activity privacy:- I am not sure how you got access to it(is it ours?), Our plugin is not intended for use beyond Community Builder theme due to various limitations/variations in the BuddyPress eco system.

    6. For MediaPress, It will create wall gallery automatically when a user tries to upload to group.

    7. For profile completion, Please put the standard role(name not label) in the white list. These user’s won’t be forced. Once they upgrade membership, Please change their role and they will be forced to complete.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 68
    Katrine Spencer on #53615

    Hello again

    Thank you for getting back on this and looking into everything – I really appreciate all your time and effort on this!

    1. It would be highly appreciated if we could make the Global Search and Deactivate user compatible, since this is currently making me unable to use the deactivate plugin. 🙂

    2. I totally understand, this is also a bit more complex I could imagine with the build of topics/replies within the forum. I will leave them visible for now (when using the deactivate plugin at some point) – it would be amazing if it was supported in the future for sure – but Global Search / Deactivate plugin compatibility is my no. 1 concern right now.

    3. Thank you for looking into this. Would anything happen if I changed to the file you provided? – even if I decided not to give them access to login when deactivated? – In this case I would just update the code and leave it at that.

    4. I see, didn’t even notice this. That should work! 🙂

    5. Yes, it was downloaded from your site directory:
    https://buddydev.com/plugins/activity-privacy-for-buddypress/

    6. This makes sense, in this case I just decided to hide the option to include/exclude galleries when people are creating groups. There is no reason for that option to be in there, if the gallery is created automatically. For now I just used the following:

    #buddypress .standard-form label[for="mpp-enable-gallery"] {
      display: none;
    }
    
    .mpp-group-gallery-enable {
        display: none !important;
    }

    7. There is no setting on the settings-page where I can setup this, so in this case I did add the following code that seems to have solved the issue (using Paid Membership Pro).

    // Skip profile completion checks for users with 'pmpro_role_1' role
    add_action( 'wp', 'skip_profile_completion_for_pmpro_role_1', 1 );
    function skip_profile_completion_for_pmpro_role_1() {
        if ( is_user_logged_in() ) {
            $user = wp_get_current_user();
    
            // If the user has the 'pmpro_role_1' role, skip the profile completion logic
            if ( in_array( 'pmpro_role_1', (array) $user->roles ) ) {
    
                // Remove hooks that trigger profile completion checks on login or profile updates
                remove_action( 'bp_profile_completion_check_on_login', 'bp_profile_completion_check_on_login_action', 10 );
                remove_action( 'profile_update', 'bp_profile_completion_check_on_update', 10 );
    
                // Disable the notice and redirection logic for this user role
                remove_action( 'bp_profile_completion_show_notice_and_redirect', 'show_notice_and_redirect', 10, 2 );
    
                // Prevent BuddyPress Profile Completion from triggering any unnecessary checks
                add_filter( 'bp_force_profile_completion_skip_check', '__return_true' );
            }
        }
    }
    
    // Ensure that profile completion checks are skipped for users with 'pmpro_role_1' during login
    add_action( 'bp_profile_completion_check_on_login', 'skip_profile_completion_on_login_for_pmpro_role_1', 10, 1 );
    function skip_profile_completion_on_login_for_pmpro_role_1( $user_id ) {
        $user = get_user_by( 'ID', $user_id );
    
        // If the user has the 'pmpro_role_1' role, skip the profile completion check
        if ( in_array( 'pmpro_role_1', (array) $user->roles ) ) {
            // Do not trigger any profile completion check or redirect for this user role
            return;
        }
    
        // Otherwise, the profile completion check can proceed as normal
    }
    
    // Prevent BuddyPress Profile Completion actions from affecting 'pmpro_role_1' users
    add_filter( 'bp_profile_completion_skip_check', 'skip_profile_completion_for_pmpro_role_1_filter', 10, 1 );
    function skip_profile_completion_for_pmpro_role_1_filter( $skip ) {
        // If the user has 'pmpro_role_1', skip the profile completion check globally
        if ( is_user_logged_in() ) {
            $user = wp_get_current_user();
            if ( in_array( 'pmpro_role_1', (array) $user->roles ) ) {
                $skip = true;
            }
        }
    
        return $skip;
    }

    Regarding the last issue (from previous post) with compatibility with MediaPress and Anonymous plugin, what is the status on this? – For now I just have an warning showing up, whenever members pick the “anonymous” checkbox, but it would be awesome to have this compatible too, so members are not able to upload media when anonymous is checked.

    For me the things that I still needs fixed/looked into is the following:

    A. MediaPress x Anonymous compatibility

    B. BuddyPress Global Search x Deactivate compatibility (if possible)

    C. BuddyPress Activity Privacy (added into container on page).

    I appreciate all your help on this and once again thank you for the support so far! 🙂

  • Participant
    Level: Enlightened
    Posts: 68
    Katrine Spencer on #53616

    Hello again

    I’m not sure if it is possible, but regarding the BuddyPress Global Search and Deactivate plugin.

    I don’t mind if the content is shown on the search page. If the users click on the content it should return to their own profile with the error “Sorry, that profile is not accessible.” anyway, right?

    So, in this case, would it be a solution to “exclude” the deactivate plugin from the search page in general?

    In this scenario it would just show all content and work with the BuddyPress Global Search.

    The main issue I’m having right now is that content that is hidden (when user is marked inactive) is preventing pages that show hidden content from being accessed in the first place on the search page.

    Is this possible to achieve?

  • Keymaster
    (BuddyDev Team)
    Posts: 24694
    Brajesh Singh on #53637

    Hi Katrine,
    I am sorry, I haven’t been of much help last week. I will ensure we resolve these issues by this snday.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 24694
    Brajesh Singh on #53903

    Hi Katrine,
    Thank you for your patience.

    1. Global search issue:- Can you please provide me more details about the issue, your Global search settings and deactivate account settings and how to reproduce it. I tried it today and I could not reproduce it.

    3. You can override but it will be gone in next update of that plugin. will suggest posting it to the plugin/theme author for adding it in future update.

    5. I am sorry, the activity privacy is not supported beyond Community Builder pro by us.

    I have enabled the role whitelisting here
    https://github.com/buddydev/bp-profile-completion
    Can you please check and let me know if it works for you?

    I am still looking into Anonymous activity and MediaPress.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 68
    Katrine Spencer on #53905

    Hello Brajesh 🙂

    **// 1. Global search issue:- Can you please provide me more details about the issue, your Global search settings and **// deactivate account settings and how to reproduce it. I tried it today and I could not reproduce it.

    See images of settings here:
    https://ibb.co/gwRP4cV
    https://ibb.co/M6XpH1P
    https://ibb.co/1TCvGCP
    https://ibb.co/0jg0jqz

    The issue is when users search for something on the search page (in this case “test”).
    The user “JaneDoe” is marked as inactive (by Deactivate plugin) and this user has an activity that contains the word “test” in this case. When the “Deactivate” plugin is activated it seems to cause an issue where the page that contains activity/items from a user that is inactive will not show. I can’t even click on “activity” tab because this content contains the activity from JaneDoe (that is inactive). I can use the pagination until I get to a page where the next page contains content that is from a user that is marked inactive.

    Once the “Deactivate” plugin is deactivated it has no problems loading the pages/content on the search page.

    So in short it can’t show pages where content from inactive users is available.

    See images:
    https://ibb.co/tQPgrWR
    https://ibb.co/k6jgwdf
    https://ibb.co/55TnywT
    https://ibb.co/ZMCLFRB
    https://ibb.co/kJfCdmB

    You should be able to replicate this by:
    1: create a user and publish an activity with the word “test” (or whatever you like).
    2. Check that the search page works and that the content is shown.
    3. Make the user “inactive” using the “Deactivate” plugin.
    4. Check the search page again.
    Also This might require more test content to replicate the pagination functions too.

    **// 3. You can override but it will be gone in next update of that plugin. will suggest posting it to the plugin/**// theme author for adding it in future update.
    I’ll keep this in mind. I don’t believe they plan any further updates at the moment on this.

    **// 5. I am sorry, the activity privacy is not supported beyond Community Builder pro by us.
    This makes sense, I’ll configure it myself in the code when I got the time to look at it.

    **// I have enabled the role whitelisting here
    **// https://github.com/buddydev/bp-profile-completion
    **// Can you please check and let me know if it works for you?
    I tested this on my staging site and it dosen’t quite seem to work. I assume the “whitelisted” accounts are the ones who should NOT be forced to complete their profile?

    It seems to be running into some issues like I also ran into earlier (before I setup the coded provided earlier).
    The issue seems to be that the user is being forced into their user account/profile page when a profile image is not provided/or deleted.

    This is an issue since I’ve got restrictions with the “Paid Membership Pro” and “Control Content” plugin that dosen’t allow “basic” users (despite it being whitelisted in your new plugin) access to that part with their role.

    It seems like it causes an error because of “too many requests” since it tries to force the user into their profile – but at the same time they’re being restricted from not going into that page.

    I did manage to solve this (like mentioned) with the previous code/snippet I provided. It solved the (at least my) issue. But from what I can tell, my current setup and this new plugin dosen’t quite work because of conflicts in it not whitelisting that user despite them being on the list.

    This might be different for other users though – not sure. 🙂

    **// I am still looking into Anonymous activity and MediaPress.
    Sounds great, I’m looking forward for some updates on this when you got some news on this. 🙂

  • Participant
    Level: Enlightened
    Posts: 68
    Katrine Spencer on #53906

    Ignore this part (turns out it didn’t check the yes box on the whitelist page – I was sure I did that lol):
    ** Seems to be working – yes ** 🙂

    I have enabled the role whitelisting here
    https://github.com/buddydev/bp-profile-completion
    Can you please check and let me know if it works for you?
  • Keymaster
    (BuddyDev Team)
    Posts: 24694
    Brajesh Singh on #53907

    Hi Katrine,
    Thank you.

    I am glad the Profile completion worked.

    There is a bug in BuddyBoss global search causing the fatal error.

    Please open wp-content/plugins/buddypress-global-search/includes/search-types/class.BBoss_Global_Search_Type.php this and change line number 105 from this

    
    			return isset( $this->search_results['items'][$itemid] ) ? @$this->search_results['items'][$itemid]['html'] : '';
    

    to

    
    	return isset( $this->search_results['items'][ $itemid ] ) && is_array( $this->search_results['items'][ $itemid ] ) && isset( $this->search_results['items'][ $itemid ]['html'] ) ? $this->search_results['items'][ $itemid ]['html'] : '';
    		
    

    That will fix it.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 68
    Katrine Spencer on #53909

    This worked! – Amazing! 😀

    Thank you so much! 🙂

    No the only thing left on the wishlist (I believe) is the Annonymous x Mediapress (that would be amazing). 🙂

    I would love for this to be fixed before the launch on 1st og january (if possible).

    I understand if you’re busy at this time of the year and it would not be the end of the world if this is not possible within this point. Like mentioned I got a warning showing at the moment, but would love for them to be compatible if feasable. 🙂

    Thank you for the amazing support once again! 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 24694
    Brajesh Singh on #53911

    Hi Katrine,
    Thank you.
    I am glad it worked.

    I will look into the MediaPress and Anonymous activity issue again this weekend and let you know early Monday. We already did one way disabling, achieving two way is a bit complicated but I will give it another try this weekend.

    Have a great day.

    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved