• Resolved Anam A.

    (@anam198)


    Hi, I found this error log inside Woocommerce -> Status – ?Logs, which i think is related to the coupon affiliates plugin, what does it mean?
    coupon-affiliates-2024-01-30-890a94e3089e63609c40ddcb127db238.log

    2024-01-30T16:32:04+00:00 DEBUG You passed an empty string for ‘account’. We assume empty values are an attempt to unset a parameter; however ‘account’ cannot be unset. You should remove ‘account’ from your request or supply a non-empty value. 2024-01-30T16:33:52+00:00 DEBUG You passed an empty string for ‘account’. We assume empty values are an attempt to unset a parameter; however ‘account’ cannot be unset. You should remove ‘account’ from your request or supply a non-empty value.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Elliot Sowersby / RelyWP

    (@elliotvs)

    Hi,

    Thanks for sharing this, we’ll take a look into it and see if it can be fixed on our end in the next update.

    Thread Starter Anam A.

    (@anam198)

    Hi Elliot,
    I have been facing another issue. When an email is sent for setting up a new password, the link takes the user to the WordPress reset panel. And shows the form that usually WordPress shows for the reset. However, it should take up the link of MY account page: https://magnesiumstore.com/my-account/lost-password/?show-reset-form=true&action=newaccount
    in order to reset the password.
    This is not good, because our branding is not being used and it shows a typical WordPress password reset feature.

    Plugin Author Elliot Sowersby / RelyWP

    (@elliotvs)

    Hi,

    Our plugin uses the default WooCommerce / WordPress login form and password reset functionality.

    So when they click password reset, it should give them the email, with a link to the password reset page. By default this should be the WooCommerce password reset page, however it may be that something on your site is overriding it to go back to the default WordPress reset password page instead.

    A few things to try:

    1. Please check WooCommerce > Settings > Advanced > Account Endpoints. The lost password endpoint should be lost-password: https://d.pr/i/Qv1GZh

    2. Go to Settings > Permalinks and changes changes to flush your permalnks.

    3. Try temporarily deactivating all other plugins except WooCommerce and Coupon Affiliates to see if it’s another plugin causing the issue.

    Be sure to take site backups beforehand just in case.

    Thread Starter Anam A.

    (@anam198)

    The lost-password setting is correct, I have done step 2 also. 

    and it’s like this:

    image.png

    However, if a user is registered from the My account page as a customer, it takes them to the My account page from the email to reset the password as it should and not this WordPress Login. 

    It happens when an affiliate user is registered from the back end form -> Add New Affiliate. 

    So, I do not think it is another plugin that is overriding.?

    If there is any alternative to redirect or anything else please suggest?

    I have to resolve this issue this week, Could you please help?

    • This reply was modified 1 year ago by Anam A..
    • This reply was modified 1 year ago by Anam A..
    Thread Starter Anam A.

    (@anam198)

    I saw this code in the Coupon Affiliates plugin file as you can see it embeds the key at the end, that takes it to the WordPress Login:
    
    
    // Create password reset URL
    function generate_password_reset_url($user_id) {
    
    $user = get_user_by( 'id', $user_id );
    
    if ( is_wp_error( $user ) ) {
    return false;
    }
    
    $user_data = get_userdata( $user_id );
    $user_login = stripslashes($user->user_login);
    $key = get_password_reset_key( $user_data );
    
    if ( is_wp_error( $key ) ) {
    return false;
    }
    
    $login_url = wp_login_url();
    if ( is_wp_error( $login_url ) ) {
    return false;
    }
    
    $rp_link = $login_url ."?action=rp&key=$key&login=" . rawurlencode($user_login);
    
    return $rp_link;
    
    }
    
    BUT IF YOU SEE THE CODE FROM WOOCOMMERCE EMAIL TEMPLATE:
     <a class="link" href="<?php echo esc_url( add_query_arg( array( 'key' => $reset_key, 'id' => $user_id ), wc_get_endpoint_url( 'lost-password', '', wc_get_page_permalink( 'myaccount' ) ) ) ); ?>"><?php // phpcs:ignore ?>
    <?php esc_html_e( 'Click here to reset your password', 'woocommerce' ); ?>
    </a>
    Thread Starter Anam A.

    (@anam198)

    Hi Elliot, I would like to replace this code with the following:

    // Create password reset URL
    function generate_password_reset_url($user_id) {

    $user = get_user_by('id', $user_id);
    
    if (is_wp_error($user)) {
        return false;
    }
    
    $user_data = get_userdata($user_id);
    $user_login = stripslashes($user->user_login);
    $key = get_password_reset_key($user_data);
    
    if (is_wp_error($key)) {
        return false;
    }
    
    // Get the URL of your account page
    $account_page_url = wc_get_page_permalink('myaccount');
    
    // Construct the password reset URL
    $rp_link = add_query_arg(
        array(
            'key' => $key,
            'id' => $user_id
        ),
        wc_get_endpoint_url('lost-password', '', $account_page_url)
    );
    
    return $rp_link;

    }

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Status Error Log’ is closed to new replies.