Undefined array and property warnings in class-mainwp-cron-jobs-auto-updates.php

The following PHP Warnings are being generated every 5 minutes in my MainWP:

[19-Oct-2024 08:05:17 UTC] PHP Warning: Undefined array key “new” in /home/myuseraccount/public_html/mymainwp/wp-content/plugins/mainwp/class/class-mainwp-cron-jobs-auto-updates.php on line 284
[19-Oct-2024 08:05:17 UTC] PHP Warning: Undefined property: stdClass::$automatic_update in /home/myuseraccount/public_html/mymainwp/wp-content/plugins/mainwp/class/class-mainwp-cron-jobs-auto-updates.php on line 287
[19-Oct-2024 08:05:17 UTC] PHP Warning: Undefined array key “current” in /home/myuseraccount/public_html/mymainwp/wp-content/plugins/mainwp/class/class-mainwp-cron-jobs-auto-updates.php on line 283
[19-Oct-2024 08:05:17 UTC] PHP Warning: Undefined array key “new” in /home/myuseraccount/public_html/mymainwp/wp-content/plugins/mainwp/class/class-mainwp-cron-jobs-auto-updates.php on line 284
[19-Oct-2024 08:05:17 UTC] PHP Warning: Undefined property: stdClass::$automatic_update in /home/myuseraccount/public_html/mymainwp/wp-content/plugins/mainwp/class/class-mainwp-cron-jobs-auto-updates.php on line 287
[19-Oct-2024 08:05:17 UTC] PHP Warning: Undefined array key “current” in /home/myuseraccount/public_html/mymainwp/wp-content/plugins/mainwp/class/class-mainwp-cron-jobs-auto-updates.php on line 283
[19-Oct-2024 08:05:17 UTC] PHP Warning: Undefined array key “new” in /home/myuseraccount/public_html/mymainwp/wp-content/plugins/mainwp/class/class-mainwp-cron-jobs-auto-updates.php on line 284
[19-Oct-2024 08:05:17 UTC] PHP Warning: Undefined property: stdClass::$automatic_update in /home/myuseraccount/public_html/mymainwp/wp-content/plugins/mainwp/class/class-mainwp-cron-jobs-auto-updates.php on line 287

Taking a look at that file, code lines 283 through 287 are this:

if ( isset( $information[‘sync’] ) && ! empty( $information[‘sync’] ) ) {
MainWP_Sync::sync_information_array( $website, $information[‘sync’] );
}
} catch ( \Exception $e ) {
// error.

Has anyone else encountered this? Is anyone from MainWP familiar with and can possibly provide a solution suggestion?

Thank you for any feedback.


### WordPress Check                Required                                               Detected                                     Status   ###

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

### PHP                            Required                                               Detected                                     Status   ###

cURL Extension Enabled             =true                                                  true                                         Pass        
cURL Timeout                       >=300 seconds                                          60                                           Warning     
cURL Version                       >=7.29.0                                               7.61.1                                       Pass        
Function `tmpfile` enabled         N/A                                                    Enabled                                      Pass        
OpenSSL Version                    >=OpenSSL/1.1.0                                        OpenSSL/1.1.1k                               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                                                    exec, passthru, shell_exec, system,                      
PHP Exif Support                   N/A                                                    YES                                                      
PHP IPTC Support                   N/A                                                    YES                                                      
PHP Loaded Extensions              N/A                                                    Core, PDO, PDO_ODBC, Phar, Reflection, SPL, SimpleXML, Zend OPcache, bcmath, calendar, cgi-fcgi, clos_ssa, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imagick, imap, intl, ionCube Loader, json, ldap, libxml, mbstring, memcached, mysqli, mysqlnd, odbc, openssl, pcntl, pcre, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, posix, pspell, random, session, shmop, snmp, soap, sockets, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, zlib            
PHP Max Execution Time             >=30 seconds                                           60                                           Pass        
PHP Max Input Time                 >=30 seconds                                           90                                           Pass        
PHP Memory Limit                   >=256M                                                 512M                                         Pass        
PHP Post Max Size                  >=2M                                                   128M                                         Pass        
PHP Safe Mode Disabled             =true                                                  true                                         Pass        
PHP Session enabled                N/A                                                    Enabled                                      Pass        
PHP Upload Max Filesize            >=2M                                                   96M                                          Pass        
PHP Version                        >=7.4                                                  8.2.24                                       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                                                    utf8mb4                                                  
MySQL Mode                         N/A                                                    NO_ENGINE_SUBSTITUTION                                   
MySQL Version                      >=5.0                                                  8.0.39-cll-lve                               Pass        

### Server Configuration           Detected Value                                      ###

Accept Content                     text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8
Accept-Charset Content             N/A                                                    
Architecture                       64         bit                                         
Gateway Interface                  CGI/1.1                                                
HTTPS                              ON                                                     
Memory Usage                       61.11 MB                                               
Operating System                   Linux                                                  
Request Time                       1729333651                                             
Server Protocol                    HTTP/2.0                                               
Server self connect                Not expected HTTP response body:                       
Server Software                    Apache                                                 
User Agent                         Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0

### MainWP Dashboard Settings      Detected Value                                      ###

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

### Extensions                     Version                                                License                                      Status   ###

Advanced Uptime Monitor Extension  5.3.1                                                  Active                                       Pass        
MainWP Bulk Settings Manager Extension5.0.1                                                  Active                                       Pass        
MainWP Custom Dashboard Extension  5.0.1                                                  Active                                       Pass        
MainWP Database Updater Extension  5.0.4                                                  Active                                       Pass        
MainWP Maintenance Extension       5.0                                                    Active                                       Pass        
MainWP White Label Extension       5.0                                                    Active                                       Pass        

### Plugin                         Version                                                Status                                    ###

MainWP Dashboard                   5.2.2                                                  Active                                       
MainWP Key Maker                   1.2                                                    Active                                       
Solid Security Pro                 8.5.0                                                  Active                                       

Hey @David_H, I’m not seeing other tickets on this, which leads me to believe it may be something server-side and thank you for sending over the server config code with your issue :slight_smile:

Let’s look into the following:

TL;DR:

  • Increase the cURL timeout from 60 seconds to 300 seconds.
  • Reduce the number of simultaneous sync requests (try 4 or 2) to lower the server load.
  • Temporarily disable Solid Security Pro to rule out conflicts.

Here’s why: based on your server setup and active plugins, a few things that could contribute to the issue stand out.

  1. cURL Timeout (60 seconds - Warning)

Your cURL timeout is currently set at 60 seconds, but your MainWP Dashboard should be at 300 seconds. If external requests, like pulling update data for connected sites, take longer than 60 seconds, this could lead to incomplete or corrupted data during the sync process, which might be causing those warnings about undefined array keys or properties.

Fix:
Increase the cURL timeout to 300 seconds. This can usually be done in your server’s php.ini file or by asking your hosting provider to make the change.

  1. Server Performance (232 Connected Sites)

You have 232 connected sites, and your dashboard is set to sync 8 sites at a time. While this is generally fine, if your server is under heavy load, those sync requests might timeout or fail, which can cause missing data during auto-updates.

Fix:
Consider reducing the number of simultaneous sync requests to ease the load. Try lowering it from 8 to 4 or even 2 and see if that improves performance.

  • Go to the Menu on the top right. Click the (…) to expand the menu > Settings > Advanced Settings.
  • Set “Maximum Simultaneous Sync Requests” to 4 or 2.


3. Solid Security Pro

The Solid Security Pro plugin could be interfering with certain processes. Security plugins sometimes block or modify requests related to cron jobs, automatic updates, or file permissions. It’s worth temporarily disabling this plugin to see if the PHP warnings stop.

Fix:

  • Temporarily disable Solid Security Pro and see if the issue persists.
  • Check the plugin’s settings to see if anything might be blocking background processes, like file permissions or API requests.

One of those should help with the issue, but if it doesn’t, please let us know, and technical support can follow up on Monday.

1 Like

@dennis - thank you very much for the detailed response and advice. I made all of the adjustments that you suggested, and I thought I had the issue narrowed-down, but it looks like a couple days of testing may be needed on my part as time allows. I’ll be sure to post back here with any results and discoveries.

1 Like

Hello, I have had the same problem as described above for about 3 weeks. My cronjob runs every morning at 5am. Every morning at 5 a.m. I receive an e-mail with the error message (this is my setting in Plesk).

I would also be grateful for a solution. Best regards, Sven


### WordPress Check                Required                                               Detected                                     Status   ###

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

### PHP                            Required                                               Detected                                     Status   ###

cURL Extension Enabled             =true                                                  true                                         Pass        
cURL Timeout                       >=300 seconds                                          300                                          Pass        
cURL Version                       >=7.29.0                                               7.81.0                                       Pass        
Function `tmpfile` enabled         N/A                                                    Enabled                                      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                                                    opcache_get_status,                                      
PHP Exif Support                   N/A                                                    YES                                                      
PHP IPTC Support                   N/A                                                    YES                                                      
PHP Loaded Extensions              N/A                                                    Core, PDO, PDO_ODBC, Phar, Reflection, SPL, SimpleXML, Zend OPcache, bcmath, bz2, calendar, cgi-fcgi, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imagick, imap, intl, json, ldap, libxml, mbstring, mysqli, mysqlnd, odbc, openssl, pcre, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, posix, pspell, random, redis, session, soap, sockets, sodium, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, zlib            
PHP Max Execution Time             >=30 seconds                                           600                                          Pass        
PHP Max Input Time                 >=30 seconds                                           600                                          Pass        
PHP Memory Limit                   >=256M                                                 2048M                                        Pass        
PHP Post Max Size                  >=2M                                                   96M                                          Pass        
PHP Safe Mode Disabled             =true                                                  true                                         Pass        
PHP Session enabled                N/A                                                    Enabled                                      Pass        
PHP Upload Max Filesize            >=2M                                                   96M                                          Pass        
PHP Version                        >=7.4                                                  8.3.12                                       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                                                    ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION            
MySQL Version                      >=5.0                                                  10.6.18-MariaDB-0ubuntu0.22.04.1             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                       58.89 MB                                               
Operating System                   Linux                                                  
Request Time                       1729574065                                             
Server Protocol                    HTTP/1.0                                               
Server self connect                Not expected HTTP response body:                       
Server Software                    Apache                                                 
User Agent                         Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36

### MainWP Dashboard Settings      Detected Value                                      ###

Abandoned plugins/themes tolerance 365                                                    
Basic uptime monitoring enabled    No                                                     
MainWP Dashboard Version           Latest: 5.2.2 | Detected: 5.2.2 Pass                   
MainWP legacy backups enabled      No                                                     
Maximum number of pages to return  50                                                     
Maximum number of posts to return  50                                                     
Maximum simultaneous install and update requests3                                                      
Maximum simultaneous requests      4                                                      
Maximum simultaneous requests per ip1                                                      
Maximum simultaneous sync requests 8                                                      
Minimum delay between requests     200                                                    
Minimum delay between requests to the same ip1000                                                   
Number of connected sites          110                                                    
Optimize data loading              Yes                                                    
Plugin advanced automatic updates enabledYes                                                    
Primary backup system              MainWP Legacy Backups                                  
REST API enabled                   No                                                     
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 Bulk Settings Manager Extension5.0.1                                                  Active                                       Pass        
MainWP Custom Dashboard Extension  5.0.1                                                  Active                                       Pass        
MainWP Database Updater Extension  5.0.4                                                  Active                                       Pass        
MainWP Favorites Extension         5.0.1                                                  Active                                       Pass        
MainWP Pro Reports Extension       5.0.5                                                  Active                                       Pass        
MainWP Rocket Extension            5.0.1                                                  Active                                       Pass        
MainWP Staging Extension           5.0.3                                                  Active                                       Pass        
MainWP Sucuri Extension            5.0                                                    Active                                       Pass        
MainWP White Label Extension       5.0                                                    Active                                       Pass        
MainWP WooCommerce Status Extension5.0.3                                                  Active                                       Pass        

### Plugin                         Version                                                Status                                    ###

Advanced Cron Manager              2.5.10                                                 Active                                       
Disable Comments                   2.4.6                                                  Active                                       
Gravity SMTP                       1.4.2                                                  Active                                       
Loco Translate                     2.6.11                                                 Active                                       
MainWP Dashboard                   5.2.2                                                  Active                                       
SVG Support                        2.5.8                                                  Active                                       
WP 2FA - Two-factor authentication for WordPress2.8.0                                                  Active                                       

Hi @svehei and @David_H

I am unable to reproduce this on my test Dashboards.

Would you mind opening a private Help Desk ticket so we can collect some additional information & investigate further?

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

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.