Title: lost password not work
Last modified: December 12, 2021

---

# lost password not work

 *  Resolved [csit](https://wordpress.org/support/users/calmsmile/)
 * (@calmsmile)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/lost-password-not-work/)
 * Fatal error: Uncaught Error: Object of class WP_Error could not be converted 
   to string in /var/www/html/wp-content/plugins/user-registration/includes/class-
   ur-emailer.php:605 Stack trace: #0 /var/www/html/wp-content/plugins/user-registration/
   includes/class-ur-emailer.php(605): str_replace() #1 /var/www/html/wp-content/
   plugins/user-registration/includes/class-ur-emailer.php(439): UR_Emailer::parse_smart_tags()#
   2 /var/www/html/wp-content/plugins/user-registration/includes/shortcodes/class-
   ur-shortcode-my-account.php(371): UR_Emailer::lost_password_email() #3 /var/www/
   html/wp-content/plugins/user-registration/includes/class-ur-form-handler.php(
   487): UR_Shortcode_My_Account::retrieve_password() #4 /var/www/html/wp-includes/
   class-wp-hook.php(303): UR_Form_Handler::process_lost_password() #5 /var/www/
   html/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters() #6 /var/www/
   html/wp-includes/plugin.php(470): WP_Hook->do_action() #7 /var/www/html/wp-settings.
   php(600): do_action() #8 /var/www/html/wp-config.php(126): require_o in /var/
   www/html/wp-content/plugins/user-registration/includes/class-ur-emailer.php on
   line 605

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

 *  Plugin Support [Amrit Kumar Shrestha](https://wordpress.org/support/users/shresthauzwal/)
 * (@shresthauzwal)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/lost-password-not-work/#post-15157445)
 * Hi [@calmsmile](https://wordpress.org/support/users/calmsmile/),
 * The user registration plugin does not have such an error or issue. Maybe the 
   plugin conflict generates such an error. Please deactivate all other plugins 
   except User Registration and see if it works or not. If everything works fine,
   you can activate other plugins one after another and do a test lost password 
   feature simultaneously.
 * Thank You!
 *  Thread Starter [csit](https://wordpress.org/support/users/calmsmile/)
 * (@calmsmile)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/lost-password-not-work/#post-15174708)
 * I added the code to my functions.php
 *     ```
       function my_frontend_ur_lostpassword_form_captcha(){
       ......
       }
        add_action('user_registration_lostpassword_form', 'my_frontend_ur_lostpassword_form_captcha', 10, 2);
   
       function my_ur_lostpassword_form_verification($true){
                       if ( isset($_POST['captcha_token']) && isset($_POST['captcha_server']) ) {
                           $captcha_token  = $_POST['captcha_token'];
                           $captcha_server = $_POST['captcha_server'];
                           $myCaptcha    = new myCaptcha();
                           if ( $myCaptcha->$myCaptcha_verification( $captcha_server, $captcha_token ) == true ){
                               return $true;
                           }else{
                               return new WP_Error("Captcha Invalid", __("<strong>ERROR</strong>: Captcha verification failed, please try again.", 'mycaptcha'));
                           }
                       }else{
                           return new WP_Error("Captcha Invalid", __("<strong>ERROR</strong>: Captcha verification failed, please try again. If not then enable JavaScript", 'mycaptcha'));
                       }
                   }
                   return $true;
               }
       add_filter( 'allow_password_reset','my_ur_lostpassword_form_verification', 10, 3);
       ```
   
 * when I test it on the lostpassword page after I input the email address and the
   captcha done, everything works fine, but click the reset password button will
   give this `Fatal error: Uncaught Error: Object of class WP_Error could not be
   converted to string in /var/www/html/wp-content/plugins/user-registration/includes/
   class-ur-emailer.php:605 Stack trace: #0 /var/www/html/wp-content/plugins/user-
   registration/includes/class-ur-emailer.php(605): str_replace('{{key}}', Object(
   WP_Error), 'Someone has req...') #1 /var/www/html/wp-content/plugins/user-registration/
   includes/class-ur-emailer.php(439): UR_Emailer::parse_smart_tags('Someone has
   req...', Array) #2 /var/www/html/wp-content/plugins/user-registration/includes/
   shortcodes/class-ur-shortcode-my-account.php(371): UR_Emailer::lost_password_email('
   someemail@gmail.co...', Object(WP_User), Object(WP_Error)) #3 /var/www/html/wp-
   content/plugins/user-registration/includes/class-ur-form-handler.php(487): UR_Shortcode_My_Account::
   retrieve_password() #4 /var/www/html/wp-includes/class-wp-hook.php(303): UR_Form_Handler::
   process_lost_password('') #5 /var/www/html/wp-includes/class-wp-hook.php(327):
   WP_Hook->apply_filters(NULL, Array) #6 /var/www/html/wp- in /var/www/html/wp-
   content/plugins/user-registration/includes/class-ur-emailer.php on line 605`
 * It seems that the user registration plugin does not allow other plugins to add
   the verification code to the lost password page and I found the filter “allow_password_reset”
   in /var/www/html/wp-content/plugins/user-registration/includes/shortcodes/class-
   ur-shortcode-my-account.php $allow = apply_filters( ‘allow_password_reset’, true,
   $user_data->ID ); ,
    I don’t know why the user registration plugin use the wordpress
   default filter name “allow_password_reset”, is there have any other filter let
   me to add my own custom captcha verification to User Registration lostpassword
   page ?
    -  This reply was modified 4 years, 5 months ago by [csit](https://wordpress.org/support/users/calmsmile/).
 *  Plugin Support [Amrit Kumar Shrestha](https://wordpress.org/support/users/shresthauzwal/)
 * (@shresthauzwal)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/lost-password-not-work/#post-15190328)
 * Hi Csit,
 * We have tried to implement your custom feature request, but according to the 
   current feature of the plugin, it is not possible to apply the custom recaptcha
   on the rest password. Still, we can provide the Google Recaptcha feature on the
   reset password because the Google Recaptcha feature is already implemented on
   the plugin. We have listed this feature on our road map. We will introduce this
   feature in our upcoming update of the plugin.
 * We are going to mark this ticket resolved. If you have any questions about user
   registration, we suggest you create a new ticket. We will get back to you as 
   soon as possible.
 * Regards!

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

The topic ‘lost password not work’ is closed to new replies.

 * ![](https://ps.w.org/user-registration/assets/icon-256x256.gif?rev=3284028)
 * [User Registration & Membership - Free & Paid Memberships, Subscriptions, Content Restriction, User Profile, Custom User Registration & Login Builder](https://wordpress.org/plugins/user-registration/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-registration/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-registration/)
 * [Active Topics](https://wordpress.org/support/plugin/user-registration/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-registration/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-registration/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Amrit Kumar Shrestha](https://wordpress.org/support/users/shresthauzwal/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/lost-password-not-work/#post-15190328)
 * Status: resolved