• Kasia

    (@kasia_codeword)


    I keep getting the following line show up in my error log every time the page to retrieve username is loaded:

    wpmem_page_forgot_username() is deprecated as of WP-Members 3.4.0.

    I understand that this function has been deprecated, but it is clearly still part of the plugin, so can you please advise on how to make this stop?

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Chad Butler

    (@cbutlerjr)

    Thanks for bringing this to my attention. You are correct, the plugin should not be using that function.

    Currently, it looks like it is only used in the password reset shortcode. I’ve removed it in the dev version, so this will be included in the next release.

    In the meantime, if you want to correct it so you get rid of the log entry, go to includes/class-wp-members-shortcodes.php and at line 860, you will see the following:

    return wpmem_page_forgot_username( $wpmem_regchk, $content );

    Change that to this:

    return $wpmem->shortcodes->do_forgot_username( $wpmem_regchk, $content );

    That should solve it.

    As I noted, this change will be included in the next release.

    Thread Starter Kasia

    (@kasia_codeword)

    I implemented the change you provided. Now, the username retrieval form doesn’t load at all and I get the following in my error_log file:

    [01-Mar-2022 21:44:32 UTC] PHP Fatal error: Uncaught Error: Call to undefined method WP_Members_Shortcodes::do_forgot_username() in /home/myaccount/public_html/wp-content/plugins/wp-members/includes/class-wp-members-shortcodes.php:860
    Stack trace:
    #0 /home/myaccount/public_html/wp-content/plugins/wp-members/includes/class-wp-members-shortcodes.php(153): WP_Members_Shortcodes->render_pwd_reset(NULL, ”)
    #1 /home/myaccount/public_html/wp-includes/shortcodes.php(356): WP_Members_Shortcodes->forms(Array, ”, ‘wpmem_form’)
    #2 [internal function]: do_shortcode_tag(Array)
    #3 /home/myaccount/public_html/wp-includes/shortcodes.php(228): preg_replace_callback(‘/\\[(\\[?)(wpmem_…’, ‘do_shortcode_ta…’, ‘[wpmem_form pas…’)
    #4 /home/myaccount/public_html/wp-includes/class-wp-hook.php(307): do_shortcode(‘[wpmem_form pas…’)
    #5 /home/myaccount/public_html/wp-includes/plugin.php(189): WP_Hook->apply_filters(‘[wpmem_form pas…’, Array)
    #6 /home/myaccount/public_html/wp-includes/post-template.php(253): apply_filters(‘the_content’, ‘[wpmem_for in /home/myaccount/public_html/wp-content/plugins/wp-members/includes/class-wp-members-shortcodes.php on line 860
    [01-Mar-2022 21:44:47 UTC] PHP Fatal error: Uncaught Error: Call to undefined method WP_Members_Shortcodes::do_forgot_username() in /home/myaccount/public_html/wp-content/plugins/wp-members/includes/class-wp-members-shortcodes.php:860
    Stack trace:
    #0 /home/myaccount/public_html/wp-content/plugins/wp-members/includes/class-wp-members-shortcodes.php(153): WP_Members_Shortcodes->render_pwd_reset(NULL, ”)
    #1 /home/myaccount/public_html/wp-includes/shortcodes.php(356): WP_Members_Shortcodes->forms(Array, ”, ‘wpmem_form’)
    #2 [internal function]: do_shortcode_tag(Array)
    #3 /home/myaccount/public_html/wp-includes/shortcodes.php(228): preg_replace_callback(‘/\\[(\\[?)(wpmem_…’, ‘do_shortcode_ta…’, ‘[wpmem_form pas…’)
    #4 /home/myaccount/public_html/wp-includes/class-wp-hook.php(307): do_shortcode(‘[wpmem_form pas…’)
    #5 /home/myaccount/public_html/wp-includes/plugin.php(189): WP_Hook->apply_filters(‘[wpmem_form pas…’, Array)
    #6 /home/myaccount/public_html/wp-includes/post-template.php(253): apply_filters(‘the_content’, ‘[wpmem_for in /home/myaccount/public_html/wp-content/plugins/wp-members/includes/class-wp-members-shortcodes.php on line 860`

    Plugin Author Chad Butler

    (@cbutlerjr)

    Sorry about that… that was my fault. I was looking at the notes in the deprecated function that indicated it was being replaced with do_forgot_username(), but the function is actually (currently) render_forgot_username(). So same change, but just change “do_” to “render_” in the function method name.

    And again, this is being changed/corrected in the next release of the plugin as well. It was supposed to be in 3.4.0, but evidently was missed in the password form shortcode (it was changed in the user profile shortcode).

    Thread Starter Kasia

    (@kasia_codeword)

    All good now, thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘wpmem_page_forgot_username() is deprecated’ is closed to new replies.