Support » Plugin: BuddyPress Registration Options » 500 error on plugins ajax form

  • Hello, once this plugin is activated, it’s no longer possible to search for Plugins as the admin-ajax file returns a 500 error. To re-create go to Plugins > Add New plugin and type something in the plugin search box.

    Wordpress also captured this error and sent a “Your Site is Experiencing a Technical Issue” email.

    WordPress version 5.8.3
    Current theme: Themify Basic (version 5.4.6)
    Current plugin: BP Registration Options (version 4.4.0)
    PHP version 7.3.33

    There are a few additional error details reported:

    An error of type E_ERROR was caused in line 258 of the file /wp-content/plugins/bp-registration-options/includes/core.php. Error message: Uncaught Error: Call to undefined function bp_displayed_user_id() in /wp-content/plugins/bp-registration-options/includes/core.php:258
    Stack trace:
    /wp-content/plugins/bp-registration-options/includes/core.php(285): bp_registration_hide_ui_for_approved_users()
    /wp-content/plugins/bp-registration-options/bp-registration-options.php(51): require_once('/...')
    /wp-content/plugins/bp-registration-options/loader.php(40): BP_Registration_Options->__construct()
    /wp-includes/class-wp-hook.php(303): bp_registration_options_init('')
    /wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array)
    /wp-includes/plugin.php(470): WP_Hook->do_action(Array)

    Thanks

    • This topic was modified 5 months, 2 weeks ago by Web Assembler.
Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hmm, must be a detail only happening during ajax requests, as I know I tested general browsing and experienced no errors for that function in question.

    Regardless, I can definitely get a function exists check in place for that one.

    See: https://github.com/WebDevStudios/BuddyPress-Registration-Options/issues/209

    If you need to get it resolved ASAP, you should be able to get around the error by changing that area of the file to something like this:

    
    if ( ! function_exists( 'bp_displayed_user_id' ) {
        return;
    }
    
    $current_user   = get_current_user_id();
    $displayed_user = bp_displayed_user_id();
    

    This way it won’t try to go further and just exit out of our function early.

    Thread Starter Web Assembler

    (@webassembler)

    Thanks for the update Michael, it’s not particularly easy to edit the plugin code on the site I’m working on so I will probably wait for the next plugin release.

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Noted, but also noted that I can’t promise a for sure timeline of when it’ll get done and released either. I’ll try to get it done soon-ish though.

    Thread Starter Web Assembler

    (@webassembler)

    Thanks, I think that’s perfectly reasonable for a free plugin! Cheers for your proactive support.

    Guessing the above is related to what I am seeing. An overactive admin-ajax.php call is draining memory … ymptoms in the backend include:- 1) media library in grid mode you get a perpetual spinning wheel, 2) media search fails to pull up any results and 3) customizer options that interact with the media library prevent uploading (Post-processing of the image likely failed because the server is busy or does not have enough resources … ) or view/select media. Apart from the obvious 500 internal server one, nothing I can understand. I also was unable to login to the subsite, without going through the main site. I have a clone of the site, if that helps.

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    @ecce-homo Only thing I am able to suggest to you is trying to add in my quick fix mentioned in my first reply in the thread. If you’re still experiencing all your site symptoms and whatnot afterwards, then you or someone else available to you will need to keep working to deduce issues.

    OK thanks.

    Adding

    if ( ! function_exists( 'bp_displayed_user_id' ) {
        return;
    }

    just before

    $current_user   = get_current_user_id();
    $displayed_user = bp_displayed_user_id();

    in includes/core.php

    breaks the subsite completely with a 500 error.

    For now I may just deactivate it on the active site and wait for an update idc.

    Thanks

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Looking back over that snippet, I actually missed a closing ) which would have been caught before the actual release, but not in this case just on the forums.

    Please try again with this version:

    if ( ! function_exists( 'bp_displayed_user_id' ) ) {
        return;
    }
    

    That has fixed it for now, thanks Michael

    🙂

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Going to try to get this handled this week, or on Friday at the latest.

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Have this queue’d up for a 4.4.1 release, but have a separate issue or two to figure out before I want to release that. Hopefully this week still.

Viewing 11 replies - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.