Support » Plugin: UpdraftPlus WordPress Backup Plugin » Warning regarding extra whitespace

  • Resolved NiallASD

    (@niallasd)


    Hi all,

    Whenever I go to restore a backup using the UpdraftPlus plugin [Version 1.11.15] I see the following message on the page.

    Warning: Your WordPress installation has a problem with outputting extra whitespace. This can corrupt backups that you download from here. Please consult this FAQ for help on what to do about it.

    After reading through the provided link I found that the problem is with the custom theme I’m using (no issue when I switch to a provided theme such as TwentyTwelve) – deactivating Plugins does nothing to help.

    I get that the issue is with extra whitespace, but I’ve no idea what to do next (what to even look for among my files to suss out the problem) other than ask you fine people for help.

    Here’s my work-in-progress site

    Niall

    https://wordpress.org/plugins/updraftplus/

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Contributor DNutbourne

    (@dnutbourne)

    Hi,

    The most likely cause of the issue is that (at least) one of the PHP scripts in the Theme’s code has extra blank lines at the beginning or end. When these scripts are loaded, the extra lines are appended to any output.

    I’m afraid that you will need to contact the developers of your theme and ask them to investigate and remove the extra whitespace.

    In the meantime, you can download your backups directly from remote storage. Extra whitespace usually only affects the downloading of backup files through UpdraftPlus.

    Thread Starter NiallASD

    (@niallasd)

    Thanks for the reply DNutbourne.

    This is a custom theme I made myself that used to backup fine.

    I found and removed extra whitespace from the end of a few files and removed them, but I still get the same message. I also tried replacing my files with a theme that doesn’t show the error (TwentyFourteen), but that doesn’t help either.

    Incidentally, replacing function.php with the TwentFourteen version stops the site loading altogether.

    Plugin Contributor DNutbourne

    (@dnutbourne)

    Hi,

    Could you temporarily switch to a default theme and deactivate all plugins except UpdraftPlus? Then, reactivate your plugins one-by-one, refreshing the UpdraftPlus settings page each time. Does the whitespace warning reappear after reactivating any plugin?

    After reactivating all plugins, reactivate your theme. This should allow you to narrow down where the whitespace is coming from.

    Are you using any custom ‘mu-plugins’?

    Thread Starter NiallASD

    (@niallasd)

    With all plugins except UpdraftPlus deactivated the message still appears.

    I have tried another similar plugin and it seems to let me backup and restore without errors.

    Plugin Author David Anderson

    (@davidanderson)

    I have tried another similar plugin and it seems to let me backup and restore without errors.

    @niallasd – does it actually stop you backing up or restoring?

    The thing that extra whitespace usually interferes with is downloading your backups directly from the page.

    David

    Thread Starter NiallASD

    (@niallasd)

    Attempting to do a restore fails and gives this message:

    Warning: copy(): The first argument to copy() function cannot be a directory in /home/www/adrenalinegaa.com/wordpress/wp-admin/includes/class-wp-filesystem-direct.php on line 257
    Error message: Could not move old files out of the way. You should check the file ownerships and permissions in your WordPress installation (/home/www/adrenalinegaa.com/wordpress/wp-content/languages)

    Plugin Contributor DNutbourne

    (@dnutbourne)

    Hi,

    The error message that displays during the restoration relates to the file permissions of the site. This error indicates that WordPress (and by extension, UpdraftPlus), does not have the correct read/write permissions for the wp-content directory.

    You (or your hosts) will need to check the file permissions for the site. Smashing Magazine has a good article on the file permissions required for WordPress:
    https://www.smashingmagazine.com/2014/05/proper-wordpress-filesystem-permissions-ownerships/#file-and-folder-ownership-for-wordpress

    Thread Starter NiallASD

    (@niallasd)

    Thanks DNutbourne.

    same problem with the white space error msg: I deactivated all plug ins. no improvement. I switched themes even to WP 2016 theme no improvement. the error message explanation says “try checking your wp-config.php file” unfortunately it does not say check it for WHAT or what to do if you find the mysterious WHAT.
    not finding any other solutions via internet searches.

    Thread Starter NiallASD

    (@niallasd)

    2 months on and I still don’t know why this is.

    Thread Starter NiallASD

    (@niallasd)

    Think I may have solved this (the error message has left anyway) and thought I’d share so people like Hawaii Loves Art can benefit from it.

    It was really quite obvious in my case, but I used too many PHP tags in functions.php when all I needed was one opening tag – I removed the closing tag too.

    “If a file is pure PHP code, it is preferable to omit the PHP closing tag at the end of the file. This prevents accidental whitespace or new lines being added after the PHP closing tag”

    Hope this helps others, I’ll mark this as resolved once Hawaii replies states whether or not it worked for them.

    Hi NiallASD

    Could you please help me as I am having the exact same problem.

    I am not a coder or have any programming background, just an intern and I was given access to a wordpress website and upgraded it to the latest version.

    Now when I go to the website I get the error “Timber not activated. Make sure you activate the plugin in /wp-admin/plugins.php”

    I had taken a back up with updraft plus but i get the white space error

    PLEASE HELP!!

    Thread Starter NiallASD

    (@niallasd)

    Hi amitoj231,

    I showed how I solved my problem in the post directly above yours.

    I used too many opening and closing tags in functions.php, it’s also worth looking for any double-spaces in that file.

    Hope you get it sorted.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Warning regarding extra whitespace’ is closed to new replies.