aaemnnosttv / wp-cli-login-command

Log in to WordPress with secure passwordless magic links.
https://aaemnnost.tv/wp-cli-commands/login/
MIT License
294 stars 47 forks source link

Plugin conflict with CiviCRM #24

Closed MegaphoneJon closed 6 years ago

MegaphoneJon commented 6 years ago

Thanks for this great package!

I've found that it fails when CiviCRM is installed on a site. I tracked it down to this line, which checks that the $_GET supervariable is empty. CiviCRM sets an element in that array on every page load.

What is the use case that this line is trying to prevent? Is it necessary, or can I submit a PR to remove it?

aaemnnosttv commented 6 years ago

Thanks @MegaphoneJon ! This is the first report of a conflict with another plugin, although I would say though that CiviCRM is conflicting with the login command.

The purpose of the conditional that you're referencing is to minimize the footprint of the login server on page load time, since it is running on every page load. Since magic login URLs don't have any query string, checking that $_GET is empty is an easy way to qualify the request early on if it is one that should be looked at more closely as a potential login request.

I would say that CiviCRM is being a bit careless in adding a parameter to every request; I find it hard to see why that would really be necessary.

I see you have an issue+PR open with them as well which looks like the right solution to me, so let's see how things go there. I will likely not change this conditional until there is an actual use case for it by the login server itself. Thanks for your help and understanding 👍

aaemnnosttv commented 6 years ago

Closing this one for now.