Strange Parse errors after updating to 4.0.4 - cannot login

Hi,

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:

		$params = apply_filters( 'mainwp_plugin_information_sslverify', $default, $args );

		$request = wp_remote_get(
			$target_url,
			$params,
		);

		if ( is_wp_error( $request ) || wp_remote_retrieve_response_code( $request ) != 200 ) {
			return false;
		}

Maybe it’s the Force Login plugin. You could also use the free MainWP Clean and Lock Extension to hide the site from other visitors.

Hi @mhi,

Thanks for reachig out.

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: https://www.dropbox.com/s/rca4jcimu13aad0/mainwp.zip?dl=0

I also just got this error:

Any idea how to resolve?

I clicked “Resume” and the issue went away.

Hi @bogdan,

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.

		$params = apply_filters( 'mainwp_plugin_information_sslverify', $default, $args );

		$request = wp_remote_get(
			$target_url,
			$params
		);

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

1 Like

Hi all,

today, we released the MainWP Dashboard version 4.1.4.1 that addresses this issue.

Please let me know how it goes with the new version.

2 Likes

I was having this issue too. Delete de comma on line 175 and all goes well.
But i couldn’t update de plugin via wordpress backend.

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.

1 Like

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