Plugin -> Updates menu malfunction / performance issue

Hello,

Following up on our previous conversation, we’re opening a topic regarding the “Updates” menu not working as expected.

/admin.php?page=UpdatesManage&tab=plugins-updates is currently listing all plugins on the same page, which means that when managing a lot of sites, it causes performance issues.

The page takes about 10 min to load all the plugins and only after we had to allocate 8G of PHP memory, otherwise it exhausts it all. But even if it eventually loads, the expand option for each plugin doesn’t work - which makes it impossible to see the sites using it.

A video explaining the issue - mainwp-load2.mov - Google Drive

While an alternative to this would be using the ‘Manage Plugins’ page instead, it is still not a viable solution since it searches through all sites or a tag takes a very long time.

A possible fix for this would be to have pagination and a search field at the top, like the one available in the “Sites” menu.

Thank you!
Martin G.

1 Like

Hey @Fixed

Thank you for bringing this to our attention, and thanks for making the screen recording.

At this moment, we don’t believe this is a bug per se, but we do intend to take a closer look at the Updates page and see what we can do to optimize it.

Adding pagination and/or a search field is also on our to-do list for that page.

@Fixed Just out of curiosity: why are there so many updates open? Especially so many different plugins, all with just a few sites needing these updates. That looks like you have a few sites with a lot of plugins installed. So I wonder how you’re update process is working… :thinking:

I’ve had situations where I had hundreds of updates available, but that were a few popular plugins and with 300+ websites it can add up rather quickly. I didn’t notice any performance issues at these times. So it looks like it’s not really the total number of updates but the number of different plugin with updates. I guess it’s taking too much time to load the information for all the different plugins. Another guess is that this might be caused by collecting the information from the WordPress repository and it might even be extra slow, because of rate limiting by the WordPress servers.

Hi,

Thanks @bojan.

The issue definitely “prevents normal/typical use of MainWP” (as mentioned in the “Bugs” category).

@josklever, it’s the other way around. We managed a lot of sites (thousands), which as you can imagine use all kinds of different plugins. And yes, the issue is with the amount of plugins listed on the page, not the number of available updates.

I’m sharing some more technical details that might help the dev team to narrow down the exact root of the issue. This is an “strace” of the running PHP process that loads the page.

sendto(14, "\1\0\0\0\16", 5, MSG_DONTWAIT, NULL, 0) = 5
poll([{fd=14, events=POLLIN|POLLERR|POLLHUP}], 1, 86400000) = 1 ([{fd=14, revents=POLLIN}])
recvfrom(14, "\7\0\0\1\0\0\0\2\0\0\0", 32768, MSG_DONTWAIT, NULL, NULL) = 11
sendto(14, "d\0\0\0\3SELECT name, value FROM wp_options WHERE wpid = 497 AND name IN ('rollback_updates_data')", 104, MSG_DONTWAIT, NULL, 0) = 104
poll([{fd=14, events=POLLIN|POLLERR|POLLHUP}], 1, 86400000) = 1 ([{fd=14, revents=POLLIN}])
recvfrom(14, "\1\0\0\1\2S\0\0\2\3def\rmanage2_2_wp1\24wp_options\24wp_options\4name\4name\f\366\0\374\377\3\0\374\21\20\0\0\0U\0\0\3\3def\rmanage2_2_wp1\24wp_options\24wp_options\5value\5value\f\366\0\377\377\377\377\374\21\20\0\0\0\5\0\0\4\376\0\0\2\0\5\0\0\5\376\0\0\2\0", 32768, MSG_DONTWAIT, NULL, NULL) = 199
sendto(14, "\1\0\0\0\16", 5, MSG_DONTWAIT, NULL, 0) = 5
poll([{fd=14, events=POLLIN|POLLERR|POLLHUP}], 1, 86400000) = 1 ([{fd=14, revents=POLLIN}])
recvfrom(14, "\7\0\0\1\0\0\0\2\0\0\0", 32768, MSG_DONTWAIT, NULL, NULL) = 11
sendto(14, "d\0\0\0\3SELECT name, value FROM wp_options WHERE wpid = 993 AND name IN ('rollback_updates_data')", 104, MSG_DONTWAIT, NULL, 0) = 104
poll([{fd=14, events=POLLIN|POLLERR|POLLHUP}], 1, 86400000) = 1 ([{fd=14, revents=POLLIN}])
recvfrom(14, "\1\0\0\1\2S\0\0\2\3def\rmanage2_2_wp1\24wp_options\24wp_options\4name\4name\f\366\0\374\377\3\0\374\21\20\0\0\0U\0\0\3\3def\rmanage2_2_wp1\24wp_options\24wp_options\5value\5value\f\366\0\377\377\377\377\374\21\20\0\0\0\5\0\0\4\376\0\0\2\0\5\0\0\5\376\0\0\2\0", 32768, MSG_DONTWAIT, NULL, NULL) = 199
sendto(14, "\1\0\0\0\16", 5, MSG_DONTWAIT, NULL, 0) = 5
poll([{fd=14, events=POLLIN|POLLERR|POLLHUP}], 1, 86400000) = 1 ([{fd=14, revents=POLLIN}])
recvfrom(14, "\7\0\0\1\0\0\0\2\0\0\0", 32768, MSG_DONTWAIT, NULL, NULL) = 11
sendto(14, "e\0\0\0\3SELECT name, value FROM wp_options WHERE wpid = 1253 AND name IN ('rollback_updates_data')", 105, MSG_DONTWAIT, NULL, 0) = 105
poll([{fd=14, events=POLLIN|POLLERR|POLLHUP}], 1, 86400000) = 1 ([{fd=14, revents=POLLIN}])
recvfrom(14, "\1\0\0\1\2S\0\0\2\3def\rmanage2_2_wp1\24wp_options\24wp_options\4name\4name\f\366\0\374\377\3\0\374\21\20\0\0\0U\0\0\3\3def\rmanage2_2_wp1\24wp_options\24wp_options\5value\5value\f\366\0\377\377\377\377\374\21\20\0\0\0\5\0\0\4\376\0\0\2\0\5\0\0\5\376\0\0\2\0", 32768, MSG_DONTWAIT, NULL, NULL) = 199
sendto(14, "\1\0\0\0\16", 5, MSG_DONTWAIT, NULL, 0) = 5

This keeps running for about ~5 min which looks to loop over all the sites (wipd) in the “rollback_updates_data” row (wp_options) table. In the row, there was only 1 mentioned plugin which I suspected was causing the issue - we removed the site using it and re-tested the menu. It still struggling the same and the strace is also the same (going over the “rollback_updates_data” row, however it doesn’t exist anymore?), so not quite sure what it does exactly but it runs for very long.

It looks to be used in quite a few functions but my guess would be it’s from (could be wrong):

mainwp/pages/page-mainwp-plugins.php
mainwp/pages/page-mainwp-updates-handler.php

Thanks again!
Martin G.

I know lots of plugins get updates in a week or so, but I was just wondering how you can have so many open at the same time, while I miss popular plugins that I would expect to be installed on many sites that would drive up the number of open updates big time.

I do think this is a rare situation not many MainWP users experience. Both because of the large number of sites as the number of different plugins. I can’t help you with the optimization, but I’m sure they will have a look at this trying to optimize it.

One think I did notice was some whitespace that appeared in the top left of the screen while loading all the plugins. I’ve seen that happen when some kind of error occurs that’s partly hidden behind the navigation menu, so maybe you can find something about that. It would also be good to check your browser console for errors. And maybe the Query Monitor plugin can help you find some steps that take a lot of time.

Finally I’m almost certain that Bojan will ask you to post a systems report as that can help to understand your setup:

Can you please post the community system report from your MainWP Dashboard for review? The report is located in your Dashboard under Info → Server, on the top right of the page.

Be sure to use the button like the one below; this button hides all your private information:

image

Pressing the button auto-copies the report to your clipboard then just paste it in a reply here.

1 Like

@Fixed I have to agree with @Bojan.

From my perspective, I don’t see this as a bug, but I would agree that it is a usability problem that we will resolve for sure.

Optimization is an ongoing task for us so our dev team will take a closer look.

Before we can add new updates, as @josklever suggested, we can check the system report from your dashboard and see what can be improved to improve the Updates page loading.

Thanks

@josklever could you clarify what you mean by “open at the same time”? Is there a way to limit the displayed plugins, since once we click on the “Updates” page it just starts listing all of them?

We have checked the running query before and it’s the same table/row mentioned in the strace provided above.

It is going over "wpid"s , which seem to be the sites, BUT “rollback_updates_data” does not exist, so I’m not sure why it would still be running queries in this row.

Here’s the full system report as well.


### WordPress Check                Required                                               Detected                                     Status   ###

FileSystem Method                  = direct                                               direct                                       Pass        
MultiSite Disabled                 =true                                                  true                                         Pass        
WordPress Memory Limit             >=64M                                                  6144M                                        Pass        
WordPress Version                  >=6.2                                                  6.5.5                                        Pass        

### PHP                            Required                                               Detected                                     Status   ###

cURL Extension Enabled             =true                                                  true                                         Pass        
cURL Timeout                       >=300 seconds                                          1000                                         Pass        
cURL Version                       >=7.29.0                                               7.81.0                                       Pass        
OpenSSL Version                    >=OpenSSL/1.1.0                                        OpenSSL/3.0.2                                Pass        
OpenSSL Working Status             Yes                                                    Yes                                          Pass        
PCRE Backtracking Limit            >=10000                                                1000000                                      Pass        
PHP Allow URL fopen                N/A                                                    YES                                                      
PHP Disabled Functions             N/A                                                    No functions disabled.                                   
PHP Exif Support                   N/A                                                    YES                                                      
PHP IPTC Support                   N/A                                                    YES                                                      
PHP Loaded Extensions              N/A                                                    Core, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, bcmath, calendar, cgi-fcgi, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imagick, imap, intl, json, ldap, libxml, mailparse, mbstring, mysqli, mysqlnd, openssl, pcntl, pcre, pdo_mysql, pdo_sqlite, posix, random, readline, redis, session, soap, sockets, sodium, sqlite3, standard, tidy, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, zlib            
PHP Max Execution Time             >=30 seconds                                           3000                                         Pass        
PHP Max Input Time                 >=30 seconds                                           -1                                           Pass        
PHP Memory Limit                   >=256M                                                 8192M                                        Pass        
PHP Post Max Size                  >=2M                                                   1024M                                        Pass        
PHP Safe Mode Disabled             =true                                                  true                                         Pass        
PHP Upload Max Filesize            >=2M                                                   1024M                                        Pass        
PHP Version                        >=7.4                                                  8.2.18                                       Pass        
PHP XML Support                    N/A                                                    YES                                                      
SSL Extension Enabled              =true                                                  true                                         Pass        
SSL Warnings                       = empty                                                                                             Pass        

### MySQL                          Required                                               Detected                                     Status   ###

MySQL Client Encoding              N/A                                                    utf8                                                     
MySQL Mode                         N/A                                                    NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION            
MySQL Version                      >=5.0                                                  8.0.37                                       Pass        

### Server Configuration           Detected Value                                      ###

Accept Content                     text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Accept-Charset Content             N/A                                                    
Architecture                       64         bit                                         
Gateway Interface                  CGI/1.1                                                
HTTPS                              ON                                                     
Memory Usage                       52.72 MB                                               
Operating System                   Linux                                                  
Request Time                       1720578827                                             
Server Protocol                    HTTP/2.0                                               
Server self connect                Not expected HTTP response body: 403 Forbidden

Forbidden
You don't have permission to access this resource.
Server Software                    Apache                                                 
User Agent                         Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

### MainWP Dashboard Settings      Detected Value                                      ###

Abandoned plugins/themes tolerance 365                                                    
Basic uptime monitoring enabled    Yes                                                    
MainWP Dashboard Version           Latest: 5.1.1 | Detected: 5.1.1 Pass                   
MainWP legacy backups enabled      No                                                     
Maximum number of pages to return                                                         
Maximum number of posts to return                                                         
Maximum simultaneous install and update requests6                                                      
Maximum simultaneous requests      4                                                      
Maximum simultaneous requests per ip2                                                      
Maximum simultaneous sync requests 13                                                     
Minimum delay between requests     200                                                    
Minimum delay between requests to the same ip1000                                                   
Number of connected sites          662                                                    
Optimize data loading              Yes                                                    
Plugin advanced automatic updates enabledYes                                                    
Primary backup system              MainWP Legacy Backups                                  
REST API enabled                   Yes                                                    
Site health monitoring enabled     No                                                     
Theme advanced automatic updates enabledYes                                                    
Use WP Cron                        Yes                                                    
WP Core advanced automatic updates enabledYes                                                    

### Extensions                     Version                                                License                                      Status   ###

Dashboard Lock                     5.0.1                                                  Active                                       Pass        
MainWP Database Updater Extension  5.0.4                                                  Active                                       Pass        
MainWP Pro Reports Extension       5.0.4                                                  Active                                       Pass        
MainWP Team Control                5.0.1                                                  Active                                       Pass        
MainWP White Label Extension       5.0                                                    Active                                       Pass        

### Plugin                         Version                                                Status                                    ###

Activity Log for MainWP            2.1.3                                                  Inactive                                     
Admin CSS MU                       2.10                                                   Active                                       
MainWP Dashboard                   5.1.1                                                  Active                                       
MainWP Pro Reports Extension       5.0.2                                                  Inactive                                     
Query Monitor                      3.16.3                                                 Active                                       
Redis Object Cache                 2.5.2                                                  Active                                       
Wordfence Security                 7.11.6                                                 Active                                       
WP Activity Log                    5.1.0                                                  Inactive                                     
WP Mail SMTP                       4.0.1                                                  Active                                       

With open updates I mean updates that haven’t been installed yet. For example: I install updates daily or even a couple of times a day for all my clients. So my open updates are never older than 24 hours (with a few exceptions). This means I never see a long list of many different plugins, unless they all would publish updates at the same time. So what I was asking is how old are the updates that you have listed and how often do you install updates. It’s mainly a procedural question than a technical one. :wink:

Thank you for the system report.

Your server seems to well configured to handle your amount of child sites.

If you wish, please open a private Help Desk ticket so the development team can take a closer look and possibly do some quick optimizations on the Updates page.

And please refer to this Managers thread by its URL in the ticket.

We’ve done so now - thanks!