wp-cli-login-command icon indicating copy to clipboard operation
wp-cli-login-command copied to clipboard

Lack of error handling for persistMagicUrl

Open b-t-927 opened this issue 3 years ago • 2 comments

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?

b-t-927 avatar Jul 21 '22 00:07 b-t-927

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?

aaemnnosttv avatar Jul 25 '22 21:07 aaemnnosttv

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

b-t-927 avatar Jul 26 '22 10:07 b-t-927