• Resolved wbenterprises

    (@wbenterprises)


    Hello,

    I was wondering if there is a way, or if I can request an option, to require user accounts be disabled/archived instead of deleted (when the user requests to delete their account). I would like delete to occur manually with human intervention before the username information is completely lost (for logging and abuse purposes).

    Thank you.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @wbenterprises

    Unfortunately, this requires customization on your end. Let’s see if others in the forum have done something similar and share their solution here.

    Regards,

    @wbenterprises

    I have made an archive solution for deleted user accounts.
    You can install the PHP code for testing and give me feedback and suggest improvements.

    https://github.com/MissVeronica/UM-archive-users

    Thread Starter wbenterprises

    (@wbenterprises)

    @missveronicatv

    Hello missveronica and thank you for doing this. I will try the code but I have a question. On the github link, it states I can use code-snippets to add the code. I prefer to do this, but could you please add instructions for adding it to that plugin? For example, where to run the code (e.g. front-end? everywhere?) and any Priority change it may need.

    Also, it mentions to remove member directory display for the Archive role but I don’t see that option. Is this supposed to be under “WP Capabilities” in the User Roles settings?

    @champsupertramp

    OK, I understand, but if it’s a fundamental change required on WordPress coding, I think it’s important that plugin developers also request this feature because it’s an important security function!

    • This reply was modified 3 years, 4 months ago by wbenterprises.

    @wbenterprises

    You can run the code snippets in front-end only or everywhere
    but it’s important that you must use a priority of 9.

    The priorities can be seen from the add_action 3rd parameter.

    The role setting is a warning not to include the “Archived” role for display in:
    UM -> Member Directories -> Edit -> User Roles to Display

    By UM definition a new created role is not included in this listing.

    Thread Starter wbenterprises

    (@wbenterprises)

    @missveronicatv

    I tested this code but it does not remove the user’s access, it only adds them to the Archived role for UM. They still have Subscriber role and can log in.

    • This reply was modified 3 years, 4 months ago by wbenterprises.

    @wbenterprises

    Now I have updated the code snippet to also remove any other WP Roles for the users deleting their account.

    Replace with the new code from:

    https://github.com/MissVeronica/UM-archive-users

    Thread Starter wbenterprises

    (@wbenterprises)

    @missveronicatv

    I really appreciate your effort on this! Thank you very much of helping out.

    I think it could be super helpful to others reading this thread if you added comments on the code you made so that it can be customized to different need. Or make it a plug-in! ??

    For example, some sites may want it to just mark an account for deletion so they can then do some other actiosn, whereas I’d like to just disable login and then take an action (like archive). I’m not very proficient (yet) on coding for WordPress but I’ve cut my teeth on PHP before.

    Again, thank you, and I’ll try this new code out and see where it lands me.

    UPDATE EDIT: Unfortunately, it still doesn’t disable logins for me. Perhaps it may be due to my site having a 2FA plugin as well. However, I found another plugin that adds “disable account” to the user settings and at least your code sets off the UM email notifications which I can use to my advantage.

    • This reply was modified 3 years, 4 months ago by wbenterprises.

    @wbenterprises

    Thanks for your feedback.

    Now I have updated the code again to disable WP logins as well and not only UM logins.

    https://github.com/MissVeronica/UM-archive-users

    Thread Starter wbenterprises

    (@wbenterprises)

    @missveronicatv

    Thank you, again! This is great code. It works lovely now. I hope you will consider placing comments in the coding for reference! ??

    I will mark this thread resolved for now, but I hope UM will consider making this option permanent. I don’t see how it could be a bad thing, especially for security and auditing purposes.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Disable/archive user instead of delete?’ is closed to new replies.