aaemnnosttv / wp-cli-login-command

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

Lack of error handling for persistMagicUrl #56

Closed brucedevcom closed 1 year ago

brucedevcom commented 1 year ago

Hi there! I had a fairly fun issue earlier related to the wp_options table being crashed which resulted in the set_transient function returning false, which then resulted in a BadMagic exception with a less than useful error message given the circumstances.

I've made a very basic change to just check if set_transient returns false: https://github.com/bruce2409/wp-cli-login-command/commit/9c72ddf4c662a8456b86085c04b3e54aec99e0b0

Assuming there's no issues with this are there any objections to submitting a PR for it?

aaemnnosttv commented 1 year ago

Oh that's interesting. Yes, I don't see any reason why we can't add a condition there similar to what you have. I would want to tweak the wording a bit but happy for you to open a PR if you'd like?

brucedevcom commented 1 year ago

Sure, popped in a PR, happy for any feedback on the wording