Plugin updates get stuck in Maintenance Mode

Hi Ricky,
thanks for verifying that.
I have tried multiple times to duplicate this problem on our PHP 8 setups but I couldn’t.

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

Hi Bogdan,

I spend several hours debugging this and it appears to be related to WPEngine.

The way that WordPress downloads and unzips plugins has changed slightly with PHP 8. Now, it seems to be incompatible with WPEngine’s platform settings and causes the update process to crash.

Hi Ricky,

thanks for letting us know.
If you get more details about this problem or find a way to fix it, please let us know.

Hi Bogdan,

We may have found the issue…

It seems that when MainWP Dashboard initiates a plugin update, it sends the request to the MainWP Child plugin on each site.

The MainWP Child plugin starts by setting the Cron flag to ‘true’ at this line of code:

/mainwp-child/class/class-mainwp-child-updates.php:123

Eventually, the plugin update process gets handed over to WordPress Core and triggers these lines of code:

This means the disk_free_space() command is triggered, which behaves differently in PHP8 on some hosts. See these comments from WordPress developers: Upgrade/Install: Check if the `disk_free_space()` function exists bef… · WordPress/WordPress@ab263f9 · GitHub

It seems the workaround would be for the MainWP Child plugin to avoid using Cron for these update tasks.

Hi Ricky,

thanks for sharing your finding.

I will make sure our dev team gets this and checks it as soon as possible.

Hi Ricky,

we made some tweaks in the MainWP 4.2 Beta version to address this issue.

If you want you can test it with one or two sites to see if the problem gets solved.

Hi Ricky,

we made some tweaks in the MainWP 4.2 Beta version to address this issue.

If you want you can test it with one or two sites to see if the problem gets solved.

Thanks Bogdan - do we need to install both the Dashboard and Child plugins? Or just the Child?

The child should be enough for this specific problem.

OK - the beta Child plugin was uploaded, but the problem still exists.

Looking at the function “upgrade_plugin_theme” in “class-mainwp-child-updates.php” file, it seems to be doing the same thing as before.

Perhaps there’s another change that we need to be aware of?

Hi Ricky,

thanks for verifying that.

I will notify our dev team and they will check this again.

Hi Bogdan,

Has there been any progress on this?

Thanks

Hi Ricky,

can you please test the MainWP Child 4.2 that we just released and see if works better?

Hi Bogdan,

We just tried MainWP Child 4.2, but that didn’t solve the issue unfortunately.

Hi Ricky,

Thanks for verifying that.

At this point, I would like you to open a helpdesk ticket so I can get more info from you and check what is going on.

Can you please open the ticket and reference this thread so we can take a look?

Hi Bogdan,

The analysis is already mentioned above.

Today we ran an experiment by altering MainWP Child v4.2.

We changed the function “upgrade_plugin_theme()” so that it does not set “define( ‘DOING_CRON’, true )”

It worked. The plugin update issue was fixed.

1 Like

Hi Ricky,

Thanks for the update.
It would be awesome if you could make Pull Request on Github so our dev team can review the change and potentially include it in the official repo.

2 Likes

Hi Ricky,

Can you try this version and see if it solves the problem?

2 Likes

Hi Bogdan,

Thanks - this version works. Plugins are now able to be updated.

There’s one remaining issue where plugins cannot be deleted from the Dashboard, but at least the update process works.

I haven’t tested updating themes, but will try.

2 Likes

Hi Ricky,

thanks for letting me know.
However, I believe that deleting plugins/thems is more permissions problem caused by specific WP Engine setup.

1 Like