• Dear all,

    i fell in love with your plugin and all the functionalities but since i got a good amount of members my backend page is too slow. While i was investigating the cause of this slowdown i saw that several functions of your plugin slows down the users.php page by about 15 seconds.
    Unfortunately i can not append pictures but i can name the functions

    1. count_users() – 5 seconds

    2. 4 seconds

    SELECT SQL_CALC_FOUND_ROWS gowp_users.ID
    FROM gowp_users
    LEFT JOIN gowp_usermeta
    ON ( gowp_users.ID = gowp_usermeta.user_id
    AND gowp_usermeta.meta_key = 'account_status' )
    WHERE 1=1
    AND ( ( gowp_usermeta.user_id IS NULL ) )
    ORDER BY user_registered desc

    3. 4 seconds

    SELECT SQL_CALC_FOUND_ROWS gowp_users.ID
    FROM gowp_users
    LEFT JOIN gowp_usermeta
    ON ( gowp_users.ID = gowp_usermeta.user_id
    AND gowp_usermeta.meta_key = 'account_status' )
    WHERE 1=1
    AND ( ( gowp_usermeta.user_id IS NULL ) )
    ORDER BY user_registered desc

    I really do not need the count user function and the ability to see if the account is approved or not. But 15 seconds to load the users.php is a way to long

    • This topic was modified 2 years, 5 months ago by 1jd123.
Viewing 15 replies - 1 through 15 (of 16 total)
  • @1jd123

    Yes, I agree with your comments.

    This backend performance issue is reported here:

    https://github.com/ultimatemember/ultimatemember/issues/909

    Thread Starter 1jd123

    (@1jd123)

    But still no solution after 9 Months?

    @1jd123

    Yes, still no solution by UM development.

    I have made a pull request this week for new Hooks in UM so I can release an UM Performance plugin under development. The Plugin is implementing caching for all user status counts.

    Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hi @missveronicatv @1jd123

    Fixes are added for this issue and hopefully released in the next update.
    https://github.com/ultimatemember/ultimatemember/pull/1026

    Thread Starter 1jd123

    (@1jd123)

    Next update went through but still the same issue. This is ridiculous. Waiting 18 seconds to display the user.php is a way to long.

    @1jd123

    The performance fix is still under development.

    You can read about the remaining issues here:

    https://github.com/ultimatemember/ultimatemember/pull/1021

    @1jd123

    What’s your experience with UM version 2.5.0?

    Thread Starter 1jd123

    (@1jd123)

    Nothing Changed, still loading time of 13 seconds. When i deactivate the Plugin it is <1 second

    @1jd123

    Thanks for your feedback.

    I can immediately see when looking at your 5 second response with the count_users function and this time can be removed by the new caching feature.

    https://github.com/ultimatemember/ultimatemember/issues/1080

    The two MySQL queries do they have the same SQL statements today?

    Thread Starter 1jd123

    (@1jd123)

    count users still have like 6.83 seconds and the other mysql query:
    `SELECT SQL_CALC_FOUND_ROWS gowp_users.ID
    FROM gowp_users
    LEFT JOIN gowp_usermeta
    ON ( gowp_users.ID = gowp_usermeta.user_id
    AND gowp_usermeta.meta_key = ‘account_status’ )
    WHERE 1=1
    AND ( gowp_usermeta.user_id IS NULL )
    ORDER BY user_registered desc’ have like 5 seconds.

    @1jd123

    In the “Query Monitor” plugin what sources do you have in the Caller and Component columns for this SQL statement?

    Thread Starter 1jd123

    (@1jd123)

    count_users from ultimate member <- This takes about 7 seconds
    and
    WP_User_Query->query() from WordPress core.

    missveronica

    (@missveronicatv)

    @1jd123

    Thanks for your reply.

    You can try this code snippet together with a change to the UM function call to WP for counting the number of users via UM cache instead of a DB query:

    Change line 337 in
    /plugins/ultimate-member/includes/core/class-query.php
    from
    $result = count_users();
    to
    $result = count_users( 'um_cache' );

    Install this code snippet to your active theme’s functions.php file
    or use the “Code Snippets” plugin.

    add_filter( 'pre_count_users', 'pre_count_users_by_um_caching', 10, 3 );
    
    function pre_count_users_by_um_caching( $null, $strategy, $site_id ) {
    
        if( $strategy != 'um_cache' ) return null;
    
        $result = array();
        $result['total_users'] = 0;
        $array = array( 'approved', 
                        'rejected', 
                        'awaiting_admin_review', 
                        'awaiting_email_confirmation', 
                        'inactive',
                     );
    
        foreach( $array as $status ) {
            $result['total_users'] += intval( UM()->query()->count_users_by_status( $status ));
        }
    
        return $result;
    }
    Thread Starter 1jd123

    (@1jd123)

    Changed nothing. I totally do not understand why there is no fix in your plugin? I mean if i deactivate it, my users.php page is loading in like 1 second. Isnt there a possibility to deactivate everything ultimate member is doing on the users.php page?

    • This reply was modified 1 year, 10 months ago by 1jd123.

    @1jd123

    Can you verify that the second DB Query is gone now with the code snippet above installed?

    SELECT SQL_CALC_FOUND_ROWS gowp_users.ID
    FROM gowp_users
    LEFT JOIN gowp_usermeta ....

    The first DB Query is a WP Query and must remain.

    Do you have UM User cache enabled?
    UM Settings -> Misc -> "Disable Cache User Profile"

    Try to disable the UM User cache and display the WP All Users page.

    If you get improved response time now you can get a fix to only remove UM backend caching. UM is also caching the WP meta cached content and can rely for the backend on the WP meta cache. This will reduce UM DB queries from about 75 to 34 and now without 20 DB Inserts at my site.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Horrible Performance of users.php’ is closed to new replies.