johnbillion / user-switching

WordPress plugin that provides instant switching between user accounts.
https://wordpress.org/plugins/user-switching/
GNU General Public License v2.0
187 stars 49 forks source link

Fix: Plugin is not compatible with the RegistrationMagic plugin #105

Closed gilitos92 closed 1 year ago

gilitos92 commented 1 year ago

The RegistrationMagic Plugin unconditionally performs a redirect when the "clear_auth_cookie" hook is run, which occurs when the "wp_clear_auth_cookie()" function is executed. This prevents cookie clearing from occurring and prevents the rest of this plugin's code from being executed.

This PR fixes issue #104 and makes both plugins compatible with each other.

johnbillion commented 1 year ago

Thanks for the PR.

I appreciate that this is a pain for you, but this sort of workaround is not something that I can commit to maintaining in User Switching. It might work now but I can't guarantee that it'll work beyond the next release of Registration Magic.

It sounds like the real problem lies in Registration Magic. Performing a redirect on the clear_auth_cookie action is just a plain bug and needs to be fixed. Like I mentioned on #104 I'm sure there are several other login, membership, and user authentication related plugins that don't work as a result of this bug, so fixing it at the source is best solution. If the authors of Registration Magic aren't responsive to requests to fix this then you might want to consider switching to another, better supported plugin.

Cheers!

gilitos92 commented 1 year ago

I understand John, sadly it seems that 99% of WordPress plugins are written like this.

By the way, thank you for the amazing plugin, hopefully this records will help someone in the future. I will keep maintaining my fork and keep it up to date with yours as long as I use RegistrationMagic.

Cheers!