Title: PHP Warning : $user_login and $error
Last modified: April 28, 2023

---

# PHP Warning : $user_login and $error

 *  Resolved [Fantou](https://wordpress.org/support/users/fantou/)
 * (@fantou)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-warning-user_login-and-error/)
 * Hello
 * In my error.log file, I have these messages when I use “the forget password submission”
   with an invalid email in the login popup window of a WooCommerce Site:
 * PHP Warning: Undefined variable $user_login in /wp-login.php on line 1428
   PHP
   Warning: Undefined variable $user_login in /wp-login.php on line 1512PHP Warning:
   Undefined variable $error in /wp-login.php on line 1534
 * And instead of having the message “invalid email” I have the regular message “
   Go check your mails for the link”. Sometimes, I have no message at all
 * Is there a way to fix this?
 * Have a nice day
    -  This topic was modified 3 years, 1 month ago by [Fantou](https://wordpress.org/support/users/fantou/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-warning-user_login-and-error%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [Igor H](https://wordpress.org/support/users/ihereira/)
 * (@ihereira)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-warning-user_login-and-error/#post-16699402)
 * Hello,
 * > PHP Warning: Undefined variable $user_login in /wp-login.php
 * The error message suggests that the _wp-login.php_ file has been (perhaps) modified
   incorrectly. I recommend restoring the file to its original condition by following
   these steps below:
 * 1. Determine your WordPress version by checking your admin dashboard.
   2. Download
   the corresponding WordPress version as a .zip file from this link: [https://wordpress.org/download/releases/](https://wordpress.org/download/releases/).
   3. Extract the wp-login.php file from the downloaded .zip file.4. Upload the 
   extracted wp-login.php file to your server, replacing the existing one.
 * By doing this, you’ll ensure the wp-login.php file is in its correct state to
   prevent further issues.
 * Let us know if this worked for you.
 *  Thread Starter [Fantou](https://wordpress.org/support/users/fantou/)
 * (@fantou)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-warning-user_login-and-error/#post-16699506)
 * Hello [@ihereira](https://wordpress.org/support/users/ihereira/)
 * Thanks for your reply. Unfortunatly, does not change the problem.
 * Finally it seems to be a problem with Wordfence and/or with security options 
   from the host.
 * I can’t find precisely the exact origin for the moment, do you have already encounter
   this type of problem?
 *  [xue28 (woo-hc)](https://wordpress.org/support/users/xue28/)
 * (@xue28)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-warning-user_login-and-error/#post-16701572)
 * Hi [@fantou](https://wordpress.org/support/users/fantou/)
 * Going back to your original inquiry here, I understand that you are receiving
   the error logs above when you input an invalid email address under the Password
   Reset page, correct?
 * I replicated the scenario on my personal site running on the [default Storefront theme](https://woocommerce.com/storefront/),
   however, I am unable to reproduce the issue on my end. As you can see below, 
   this is the error message I received when inputting an invalid email:
 * ![](https://i0.wp.com/snipboard.io/7mNp8i.jpg?ssl=1)
 * Furthermore, there were no error logs produced afterwards as well:
 * ![](https://i0.wp.com/snipboard.io/1R7MEz.jpg?ssl=1)
 * For us to investigate this further, can you please try to switch to the [default Storefront theme](https://woocommerce.com/storefront/)
   and only WooCommerce plugin is enabled, input an invalid email under the Password
   Reset page and see if this works?
 * If so, then this kind of problem is usually caused by your theme or a third-party
   plugin present on your site. We can run a conflict test to verify this. I’d recommend
   cloning your site to a staging environment and performing the tests described
   on this [guide](https://woocommerce.com/document/how-to-test-for-conflicts/) 
   without modifying your live site or impacting customers. Many hosts provide staging
   facilities, so it’s worth checking in with them. It’s also possible to do it 
   using the free [WP Staging](https://wordpress.org/plugins/wp-staging/) plugin.
 * If this was caused by a third-party plugin present on your site, it would be 
   best to reach out to the developers for further assistance here.
 * If this did not resolve the issue, please share your **System Status Report**,
   that will help us further troubleshoot.
 * You can find it via `WooCommerce > Status`. Select `Get system report` and then`
   Copy for support`. Once you’ve done that, you can paste it into your reply here.
 * If you could also provide the **fatal error logs** (if any) under `WooCommerce
   > Status > Logs`.
 * You could copy and paste your reply here or paste it via [https://gist.github.com/](https://gist.github.com/)
   and send the link here.
 * Let us know how it goes!
 *  Thread Starter [Fantou](https://wordpress.org/support/users/fantou/)
 * (@fantou)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-warning-user_login-and-error/#post-16704704)
 * Hi [@xue28](https://wordpress.org/support/users/xue28/)
 * Thanks a lot for your help and your time.
 * I tried with StoreFront theme and it seems that I have the same problem only 
   when the plugin Wordfence is activated.If not, I have the normal error message“
   wrong email” I will ask them if they have already encounter this issue
 * Thanks again for your help and I will tell you if I have something new about 
   this 🙂
 *  [xue28 (woo-hc)](https://wordpress.org/support/users/xue28/)
 * (@xue28)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-warning-user_login-and-error/#post-16706348)
 * Hi [@fantou](https://wordpress.org/support/users/fantou/)
 * I’m glad you were able to find the culprit of your issue here which is the [WordFence](https://www.wordfence.com/)
   plugin.
 * Since this is a third-party plugin that we don’t provide support for based on
   our [Support Policy](https://woocommerce.com/support-policy/), I recommend that
   you reach out to the developers of the plugin for further assistance. They will
   be better equipped to help you resolve any issues you’re experiencing with the
   plugin.
 * [https://www.wordfence.com/help/](https://www.wordfence.com/help/)
 * All the best and hopefully, the issue will be fixed soon.
 *  [xue28 (woo-hc)](https://wordpress.org/support/users/xue28/)
 * (@xue28)
 * [3 years ago](https://wordpress.org/support/topic/php-warning-user_login-and-error/#post-16744258)
 * Hi [@fantou](https://wordpress.org/support/users/fantou/)
 * We haven’t heard back from you in a while, so I’m going to go ahead and mark 
   this thread as resolved. If you have any other questions please start a new topic.
 * Thanks!
 *  [demosvalera](https://wordpress.org/support/users/demosvalera/)
 * (@demosvalera)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/php-warning-user_login-and-error/#post-16881844)
 * Undefined variable $user_login in **wp-login.php** on line **1428**
 * Undefined variable $user_login in **wp-login.php** on line **1512**
 * Warning: Undefined variable $error in **wp-login.php** on line **1534**
 *  [Beauty of Code (woo-hc)](https://wordpress.org/support/users/beautyofcode/)
 * (@beautyofcode)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/php-warning-user_login-and-error/#post-16894585)
 * Hi [@demosvalera](https://wordpress.org/support/users/demosvalera/) ,
 * It seems like you are experiencing an issue similar to the one above.
 * Since each site setup differs, and in order to align with[ forum best practices](https://wordpress.org/support/forum-user-guide/faq/#i-have-the-same-problem-can-i-just-reply-to-someone-elses-post-with-me-too),
   please can you [start your own topic ](https://wordpress.org/support/plugin/woocommerce/#new-topic-0)
   so that we can address your issue(s) separately.
 * Thanks!
 *  Thread Starter [Fantou](https://wordpress.org/support/users/fantou/)
 * (@fantou)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/php-warning-user_login-and-error/#post-16894660)
 * Hi [@xue28](https://wordpress.org/support/users/xue28/), Hi [@beautyofcode](https://wordpress.org/support/users/beautyofcode/)
 * Thanks for your concern. I post this little message to keep you up to date with
   my problem : I did not have an accurate answer from WordFence.
   So I’ve switched
   to BulletProof Security and I have no more this issue.About the security of the
   host (when the security plugin is deactivated) : seems to be the option “hide
   connexion’s error’s message” which causing the issue.
 * Have a nice day!

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘PHP Warning : $user_login and $error’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 9 replies
 * 5 participants
 * Last reply from: [Fantou](https://wordpress.org/support/users/fantou/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/php-warning-user_login-and-error/#post-16894660)
 * Status: resolved