User roles being modified every time I “switch”

Thanks for the report.

Fundamentally the way that User Switching works is to create a user authentication cookie and set it in your browser, it doesn’t really do much else. There’s nothing inherent in User Switching that could cause this unexpected behaviour, but it could well be that the custom role handling plugin on your site is unexpectedly performing an action when switching between users, or when the session for the target user is created.

I tested this locally by using WP-CLI to create a user with multiple roles, then switched to that user and back and there was no change to the roles of the user.

Which role management plugin are you using? I recommend getting in touch with the author to see if they can take a look. Also try deactivating your other plugins one by one to see if you can identify a potential culprit.

Thanks John! I guess the issue is nearly impossible for me to test. It seems that switching to the user is causing the issue. If it’s not, than I don’t have any way to really know how 1% of (seemingly random) users are getting their role reversed or removed. I’ve tried to different role editor plugins. Same issue. I’ve tried deactivating them altogether. Same issue. I don’t have any other plugins that interact with users roles

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer