Updated with the following:

1) Added die statement
2) Added $plainPassword =  ... before the if statement
3) Changed if (!user) to (!plainPassword)
Done, I believe this is what you want
Merge pull request #26 from keefekwan/patch-14

Updated with the following: