[Membership 2 Pro] Membership 2 Causing Admin Sluggishness

Hello! I connected with Jorge Davis last week regarding this issue and have finally wrangled the site into a staging environment (as noted above in website).

To recap: we have been debugging the site due to speed issues, and have noted an extreme change in speed with Membership 2 is not activated. Though everything on the site should now be up to date (re: software versions, PHP 7+, etc), we're still experiencing 45-60 s load times in our Wordpress dashboard. Any help is greatly appreciated.

  • Adam Czajczyk
    • Support Gorilla

    Hi Luke

    I hope you're well today and thank you for getting back to us!

    I believe the staging site in question is the "mytg....dev.com" one that you assigned to this ticket, correct? I checked it and it seems that there are some slow (Membership 2 Pro related) database queries but also some quite unexpected 404 errors in the browser console in back-end.

    We'll need to do some extensive testing on it then and I assume that since it's a staging site we are allowed to do whatever it takes there (like switching plugins on and off, making some changes to configuration of it and even possibly apply some code patch(es) if necessary), can you confirm that?

    I'll need a full access to that site then in order to investigate this (and I'll include our developers in the case if needed) so could you please provide me with those?

    Note: Don't leave your login details in this ticket.
    Instead, you can send me your details using our contact form https://premium.wpmudev.org/contact/#i-have-a-different-question and the template below:

    Subject: "Attn: Adam Czajczyk"
    - Site login URL
    - WordPress admin username
    - WordPress admin password
    - FTP credentials (host/username/password)
    - cPanel credentials (host/username/password)
    - Folder path to site in question
    - Link back to this thread for reference
    - Any other relevant urls/info

    Kind regards,

  • Luke
    • Site Builder, Child of Zeus

    Hi Adam!

    The information has been sent. Yes, as this is staging, please feel free to do what you need on it to test.

    To give you a little backstory, the live site has been sluggish for some time. We discovered the PHP version was 5.6, and recently updated the PHP to 7.2+ as well as the theme. The sluggishness only improved on the front end of the site, so we then delved into plugin debugging to determine what was slowing down the admin side. Unfortunately, when we have Membership 2 Pro deactivated, the admin portal runs well (typically less than a 2 second load time). With the plugin activated, we're looking at nearly 60 seconds to switch between pages.

    The site itself needs some work that we'll be doing post dev work by your team: we've noted a bunch of spam signups that is bloating the database pretty heavily. But with the sluggishness in the admin panel, we can't get around efficiently to put those changes in place just yet.

    Thank you for your time, and if you have any other questions, please do not hesitate to ask.

  • Adam Czajczyk
    • Support Gorilla

    Hello Luke

    Thank you for the message with credentials and for the additional explanation.

    I've already passed all that info to our developers asking them for help with this. They'll check the site and try to identify the issue, in order to solve it. Please note: it might take them a bit longer to respond than it takes us here on forum but they'll look into it and update us.

    Please keep an eye on this ticket and we'll keep you informed here as soon as we get to know more.

    Kind regards,

  • Panos
    • SLS

    Hi Luke !

    Thanks for reporting this! Membership plugin needs to do several checks in the background which may cause some delay on the admin, but the major delay seems to be coming from the count of unpaid invoices. This is done so you can see the number of unpaid invoices in the Billing menu in the red circle. It seems that it is affecting your site since you have over 15 thousand invoices.

    I have removed that count from your staging site where you should notice that there is some improvement in the load time. Since I don't have access to your live site, if you would like to try it out, you can open file

    and replace lines ~ 511-527 from

    $bill_count 	= MS_Model_Invoice::get_unpaid_invoice_count( null, true );
    			if ( $bill_count > 0 ) {
    				$msg = '%1$s <span class="awaiting-mod count-%3$s"><span class="pending-count"><i class="hidden">(</i>%2$s<i class="hidden">)</i></span></span>';
    			} else {
    				$msg = '%1$s';
    			$pages['billing'] = array(
    				'title' => sprintf(
    					__( 'Billing', 'membership2' ),
    					sanitize_html_class( $bill_count, '0' )
    				'slug' => 'billing',

    to :

    $pages['billing'] = array(
    				'title' => __( 'Billing', 'membership2' ),
    				'slug' => 'billing',

    It will not show the number of unpaid invoices anymore, but you should notice some significant improvement in load time in admin.

    I have reported this to the main developer but until this is changed I can make this change suggested above.

    If you prefer we can do that change on your live site too. In such case please sent in admin and ftp access for your live site. Keep in mind not to share such information in your reply here, as the forum is public. Send in as Adam suggested above, you can Subject: "Attn: Panos Lyrakis" instead.

    Kind regards!

    Kind regards!

  • Luke
    • Site Builder, Child of Zeus

    Hi Panos --

    We'll go ahead and implement that code change to the live site, but it does bring up a question: how are there that many unpaid invoices? The site barely runs 100+ members; is there a way to simply clear that database and if so, wouldn't that increase speed?

    Thank you.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.