UpdraftPlus PHP Fatal error: Can’t use function return value in write context

WordPress

If you’re reading this, you probably have a dead site and you’re seeing the following error in your logs:

Fatal error: Can’t use function return value in write context in /home/u356894638/public_html/wp-content/plugins/updraftplus/admin.php on line 3855

This is luckily a known issue and something that can be fixed. Unfortunately, the options to fix this are manual and may require more technical understanding than some people have. You can read through the thread on the WordPress Support Forum or just take a look at your options below:

1) Download this file and save on your computer: https://plugins.svn.wordpress.org/updraftplus/tags/1.12.32/admin try this site.php. Then, using a FTP or the file manager in your web hosting control panel, replace the file wp-content/plugins/updraftplus/admin.php with this file:

OR

2) Using FTP or the file manager in your web hosting control panel, remove the directory wp-content/plugins/updraftplus. You will then be able to log into your admin area. Your front-end site will be down until you do so.

OR

3) Use any remote-control panel product that you have connected your site to (e.g. UpdraftCentral, JetPack Manage, ManageWP, etc.) to update UpdraftPlus.

OR

4) Edit the file wp-content/plugins/updraftplus/admin.php in any tool of your choice, and remove lines 3855-3857, which are:

if (isset($settings['updraft_include_more_path']) || UpdraftPlus_Options::get_updraft_option('updraft_include_more_path')) {
$more_files_path_updated = true;
}

OR

5) Using your web hosting control panel, update your site to use PHP 5.5 or later.

I hope this helps someone – I would highly recommend option #4 if you’re comfortable editing files on your server. Then you’ll be able to update the plugin from within the admin console which will be least risky way to upgrade a plugin.