BuddyBoss Home – Web Support Forums Solutions Social Learner BuddyPress for Sensei Database ERROR

Viewing 15 posts - 16 through 30 (of 35 total)
  • Question

    #45804

    Alyssa
    Participant
    @alyssa-buddyboss

    @kahunaburger I need more information. The file being accessed could come from anywhere. Your server logs should show the exact SQL query that was being ran. This Fatal error: Allowed memory size of 262144000 bytes exhausted (tried to allocate 32 bytes) in …/wp-includes/cache.php on line 24 does NOT help to narrow that down.
    Also, can you post the wp-admin url trying to be accessed, for example: /wp-admin/options-general.php?page=sensei-buddypress%2Fincludes%2Fadmin.php

    Answers

    #45808
    @kahunaburger

    This is the url:

    …/wp-admin/options-general.php?page=sensei-buddypress%2Fincludes%2Fadmin.php

    That pages loads half way and stops right at where is says “User Roles”

    BuddyPress for Sensei
    General Settings
    Visibility	Display Profile > Courses content publicly
    User Roles

    I only see these types of issues when a plugin is trying to query the entire user database.

    #45860

    Alyssa
    Participant
    @alyssa-buddyboss

    @kahunaburger I went through all the code for that page and no queries are being executed on the user database unless an option is selected. Can you post your server log or email it to [email protected]?

    #45984

    Alyssa
    Participant
    @alyssa-buddyboss

    @kahunaburger I’ve spoken with the developers and discussed the issue in length. I think I discovered that we are using a separate database query to update each user type via a BP function which is inefficient and resource intensive. But we also confirmed you will not get this error unless you selected the option and hit save, perhaps it was an accident. We are working to update the code. I’m not sure if you are looking to update your member types types to students or you are simply reporting an error, but we are aware of the issue and will let you know when it’s updated, thank you for your patience.

    #45990
    @kahunaburger

    Like I keep saying, the page won’t even load to the point I can check options or have a submit button.

    If I remove this function from the admin.php file the admin page loads (line 233):

    
            public function convert_subscribers_option() {
                $value = buddypress_sensei()->option( 'convert_subscribers' );
                $checked = '';
                if ( $value ) {
                    $this->convert_users_to_bp_member_type( 'subscriber', 'student' );
                    $checked = ' checked="checked" ';
                } else {
                    $this->remove_convertion_users_to_bp_member_type( 'subscriber', 'student' );
                }
                echo "<input " . $checked . " id='convert_subscribers' name='buddypress_sensei_plugin_options[convert_subscribers]' type='checkbox' />  ";
                _e( 'Convert subscribers to user role Student', 'sensei-buddypress' );
            }

    If I change the word subscriber to student in these lines of that same function it will load:

    (line 237)

    $this->convert_users_to_bp_member_type( 'subscriber', 'student' );

    to

    $this->convert_users_to_bp_member_type( 'student', 'student' );

    (and line 240)

    $this->remove_convertion_users_to_bp_member_type( 'subscriber', 'student' );

    to

    $this->remove_convertion_users_to_bp_member_type( 'student', 'student' );

    If there is no interaction with the database I find it hard to know why changing that code would make the page load.

    I’m also not sure what this page can do that the default WP Users page, and the WP Settings New User Default Role can’t. Other than making student course data public.

    #45991
    @kahunaburger

    PS
    As far as what happens after you hit submit… I’m not a database expert but while I think you are right about not having a query for each user, having one big query could be even more harmful if you have a lot of users.

    #45997
    @kahunaburger

    It’s running database queries on page load.

    This is WITHOUT selecting a box or hitting any submit button.

    This is after I changed subscriber to student as described above just so I can get the page to load. We currently have 3 test accounts that are students (because I set the default new role in the WP settings to student). You will notice it is calling wp_get_object_terms() and update_meta_cache() for each of the 3 users. If I edit the function from subscriber to admin which we have 5 it will call those 2 queries 5 times each. Now if I leave everything the way you coded it (subscribers) it will call those 2 50,000+ times. That’s over 100,000 queries before the page will load.

    You will also notice #9 is for Teachers, which we have none, so there are no additional queries.

    You can use this for testing:

    https://wordpress.org/plugins/query-monitor/

    Once again, this is WITHOUT selecting a box or hitting any submit button. This is just what happens when the admin page loads.

    #1
    Query:
    SELECT wp_users.*
    FROM wp_users
    INNER JOIN wp_usermeta
    ON ( wp_users.ID = wp_usermeta.user_id )
    WHERE 1=1
    AND ( ( wp_usermeta.meta_key = ‘wp_capabilities’
    AND CAST(wp_usermeta.meta_value AS CHAR) LIKE ‘%\”student\”%’ ) )
    ORDER BY user_login ASC

    Caller:
    WP_User_Query->query()-
    WP_User_Query->__construct()
    get_users()
    BuddyPress_Sensei_Admin->remove_convertion_users_to_bp_member_type()
    BuddyPress_Sensei_Admin->convert_subscribers_option()
    do_settings_fields()
    do_settings_sections()
    BuddyPress_Sensei_Admin->options_page()
    do_action(‘settings_page_sensei-buddypress/includes/admin’)

    #2
    Query:
    SELECT t.*, tt.*
    FROM wp_terms AS t
    INNER JOIN wp_term_taxonomy AS tt
    ON tt.term_id = t.term_id
    INNER JOIN wp_term_relationships AS tr
    ON tr.term_taxonomy_id = tt.term_taxonomy_id
    WHERE tt.taxonomy IN (‘bp_member_type’)
    AND tr.object_id IN (21898)
    ORDER BY t.name ASC

    Caller:
    wp_get_object_terms()-
    bp_get_object_terms()
    bp_get_member_type()
    BuddyPress_Sensei_Admin->remove_convertion_users_to_bp_member_type()
    BuddyPress_Sensei_Admin->convert_subscribers_option()
    do_settings_fields()
    do_settings_sections()
    BuddyPress_Sensei_Admin->options_page()
    do_action(‘settings_page_sensei-buddypress/includes/admin’)

    #3
    Query:
    SELECT user_id, meta_key, meta_value
    FROM wp_usermeta
    WHERE user_id IN (21898)
    ORDER BY umeta_id ASC

    Caller:
    update_meta_cache()-
    get_metadata()
    get_user_meta()
    WP_User->_init_caps()
    WP_User->for_blog()
    WP_User->init()
    WP_User->__construct()
    WP_User_Query->query()
    WP_User_Query->__construct()
    get_users()
    BuddyPress_Sensei_Admin->remove_convertion_users_to_bp_member_type()
    BuddyPress_Sensei_Admin->convert_subscribers_option()
    do_settings_fields()
    do_settings_sections()
    BuddyPress_Sensei_Admin->options_page()
    do_action(‘settings_page_sensei-buddypress/includes/admin’)

    #4
    Query:
    SELECT user_id, meta_key, meta_value
    FROM wp_usermeta
    WHERE user_id IN (21899)
    ORDER BY umeta_id ASC

    Caller:
    update_meta_cache()-
    get_metadata()
    get_user_meta()
    WP_User->_init_caps()
    WP_User->for_blog()
    WP_User->init()
    WP_User->__construct()
    WP_User_Query->query()
    WP_User_Query->__construct()
    get_users()
    BuddyPress_Sensei_Admin->remove_convertion_users_to_bp_member_type()
    BuddyPress_Sensei_Admin->convert_subscribers_option()
    do_settings_fields()
    do_settings_sections()
    BuddyPress_Sensei_Admin->options_page()
    do_action(‘settings_page_sensei-buddypress/includes/admin’)

    #5
    Query:
    SELECT user_id, meta_key, meta_value
    FROM wp_usermeta
    WHERE user_id IN (21900)
    ORDER BY umeta_id ASC

    Caller:
    update_meta_cache()-
    get_metadata()
    get_user_meta()
    WP_User->_init_caps()
    WP_User->for_blog()
    WP_User->init()
    WP_User->__construct()
    WP_User_Query->query()
    WP_User_Query->__construct()
    get_users()
    BuddyPress_Sensei_Admin->remove_convertion_users_to_bp_member_type()
    BuddyPress_Sensei_Admin->convert_subscribers_option()
    do_settings_fields()
    do_settings_sections()
    BuddyPress_Sensei_Admin->options_page()
    do_action(‘settings_page_sensei-buddypress/includes/admin’)

    #6
    Query:
    SELECT t.*, tt.*
    FROM wp_terms AS t
    INNER JOIN wp_term_taxonomy AS tt
    ON tt.term_id = t.term_id
    INNER JOIN wp_term_relationships AS tr
    ON tr.term_taxonomy_id = tt.term_taxonomy_id
    WHERE tt.taxonomy IN (‘bp_member_type’)
    AND tr.object_id IN (21898)
    ORDER BY t.name ASC

    Caller:
    wp_get_object_terms()-
    bp_get_object_terms()
    bp_get_member_type()
    BuddyPress_Sensei_Admin->remove_convertion_users_to_bp_member_type()
    BuddyPress_Sensei_Admin->convert_subscribers_option()
    do_settings_fields()
    do_settings_sections()
    BuddyPress_Sensei_Admin->options_page()
    do_action(‘settings_page_sensei-buddypress/includes/admin’)

    #7
    Query:
    SELECT t.*, tt.*
    FROM wp_terms AS t
    INNER JOIN wp_term_taxonomy AS tt
    ON tt.term_id = t.term_id
    INNER JOIN wp_term_relationships AS tr
    ON tr.term_taxonomy_id = tt.term_taxonomy_id
    WHERE tt.taxonomy IN (‘bp_member_type’)
    AND tr.object_id IN (21899)
    ORDER BY t.name ASC

    Caller:
    wp_get_object_terms()-
    bp_get_object_terms()
    bp_get_member_type()
    BuddyPress_Sensei_Admin->remove_convertion_users_to_bp_member_type()
    BuddyPress_Sensei_Admin->convert_subscribers_option()
    do_settings_fields()
    do_settings_sections()
    BuddyPress_Sensei_Admin->options_page()
    do_action(‘settings_page_sensei-buddypress/includes/admin’)

    #8
    Query:
    SELECT t.*, tt.*
    FROM wp_terms AS t
    INNER JOIN wp_term_taxonomy AS tt
    ON tt.term_id = t.term_id
    INNER JOIN wp_term_relationships AS tr
    ON tr.term_taxonomy_id = tt.term_taxonomy_id
    WHERE tt.taxonomy IN (‘bp_member_type’)
    AND tr.object_id IN (21900)
    ORDER BY t.name ASC

    Caller:
    wp_get_object_terms()-
    bp_get_object_terms()
    bp_get_member_type()
    BuddyPress_Sensei_Admin->remove_convertion_users_to_bp_member_type()
    BuddyPress_Sensei_Admin->convert_subscribers_option()
    do_settings_fields()
    do_settings_sections()
    BuddyPress_Sensei_Admin->options_page()
    do_action(‘settings_page_sensei-buddypress/includes/admin’)

    #9
    Query:
    SELECT wp_users.*
    FROM wp_users
    INNER JOIN wp_usermeta
    ON ( wp_users.ID = wp_usermeta.user_id )
    WHERE 1=1
    AND ( ( wp_usermeta.meta_key = ‘wp_capabilities’
    AND CAST(wp_usermeta.meta_value AS CHAR) LIKE ‘%\”teacher\”%’ ) )
    ORDER BY user_login ASC

    Caller:
    WP_User_Query->query()-
    WP_User_Query->__construct()
    get_users()
    BuddyPress_Sensei_Admin->remove_convertion_users_to_bp_member_type()
    BuddyPress_Sensei_Admin->convert_teachers_option()
    do_settings_fields()
    do_settings_sections()
    BuddyPress_Sensei_Admin->options_page()
    do_action(‘settings_page_sensei-buddypress/includes/admin’)

    PS
    We cut our development users down to about 20k just to see what will happen and it still crashes.

    #46360
    @kahunaburger

    No progress on this?

    #46396

    Alyssa
    Participant
    @alyssa-buddyboss

    @kahunaburger we can replicate this issue now. Our developers are working on a fix. There is no date when this will be fixed. We are going to need to create a script to run through several hundred users at a time and keep processing unless there is an error and then we will need to allow you to start where you left off. I would recommend, with your in depth knowledge of web technology, to follow directions here to update your user roles in the mean time: http://wordpress.stackexchange.com/questions/175135/how-change-user-type-from-contributor-to-author

    #46404
    @kahunaburger

    I would recommend you start supporting your junk code!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    You are running a scam. Nothing more.

    #46408
    @kahunaburger

    I fight with you idiots for months only to have you finally admit there is an issue then say you won’t do anything about it. THIS IS EVERY TICKET I HAVE FILED WITH YOU. You have never fixed anything NOT ONE ISSUE. NOT ONE!

    #46421

    @kahunaburger

    Dude, chill out. If you’re such an expert, you fix it.

    #46630
    @kahunaburger

    @davejay I don’t know what’s sadder your ignorant devotion to software you don’t understand or your need for acceptance by interjecting yourself into conversations to gain favor from those that lied to you. I’ll fix it myself if they agree to remove “BuddyPress Experts” from their marketing.

    #46631

    @kahunagurger

    Lol.

    #46633
    @kahunaburger

    @davejay Yes that’s what I thought.

Viewing 15 posts - 16 through 30 (of 35 total)
  • The question ‘BuddyPress for Sensei Database ERROR’ is closed to new replies.