I am running MainWP since a few years without any issues so far. A few days ago I updated Wordpress to the newest version and MainWP Dashboard to 4.0.4.
Since then, I received an error email notification (daily digest) from MainWP it could not connect to itself (mainwp-child is also installed). So when tried to check out whats wrong, I was not able to login to the admin panel anymore. If I try to login to Wordpress Backend, I am stuck at an error message: Parse error : syntax error, unexpected ‘)’ in /wp-content/plugins/mainwp/class/class-mainwp-api-manager-plugin-update.php on line 176
I already did an hash file comparison of the mainwp-files on my webspace, they are 100% identical with the plugin files provided by the wordpress extension website.
I am able to login again, if I rename the mainwp folder to sth. else. After that, renaming it back to “mainwp” and reactivating the plugin seems to solve the problem for about a few hours. Everything runs fine, I can connect to child sites and so on. But after about 1 day (cron job?), I am again getting the notification email, and getting the parse error again when trying to login.
Any idea what went wrong here?
Plugins installed:
advanced-uptime-monitor-extension
MainWP
MainWP-child
Mainwp-updraftplus-extension
updraftplus
wordfence
wp-force-login
PHP: 7.2
MySQL: 5.6.19
Thanks!
//Edit: The line in question also looks good to me:
I wonder if it could be related to the PHP version, can you try and see if you get the same with PHP 7.3 or 7.4?
Also, please check if this version solves the problem: Dropbox - File Deleted
thanks for your reply. On my site, the mainwp install was in “parse error mode” this morning and I could not login. After removing the comma in line 175 as you suggested, the error was instantly resolved and I was able to login again. I will wait 24hours to see if it comes back (as it did every night), but I hope this was the culprit.
I will report back here after 24h.
Changing the PHP Version is sth. I would like to avoid if possible, as there are multiple production sites affected if I do this. According to the MainWP Website, PHP 7+ is still supported.
@josklever thanks, I will give this a try, I guess it’s better to rely on MainWP internal plugins
After removing the comma, mainwp did not create that error after 24h. Just now I updated to 4.1.4.1, thanks for the update. If this error comes back, I will post here, but I guess this has been solved.