• Resolved csit

    (@calmsmile)


    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

    (@shresthauzwal)

    Hi @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

    (@calmsmile)

    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('[email protected]...', 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 3 years, 3 months ago by csit.
    Plugin Support Amrit Kumar Shrestha

    (@shresthauzwal)

    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.