I have released a new version of the WordPress Backup to Dropbox plugin that will hopefully alleviate manny of the issues that some users are experiencing.
The biggest problem reported was an issue where the backup starts but does not complete. There is no error, zip archive and no upload to Dropbox which is a rather large issue considering that that is the sole purpose of this plugin!
After some investigation I have concluded that the issue is to do with the amount of memory available to the PHP process and the fact that zipping and uploading large files can be memory intensive.
The original zipping algorithm was inefficient and attempted to zip the entire website in memory before writing to disk. This worked fine in local testing and on my blog because my total website size is around 10 megabytes and the PHP memory limit setting was set to 98 megabytes. So she had plenty of padding to get the job done!
Unfortunately this is not the case for many of you so I have re-engineered the zipping algorithm to take into account PHP’s memory limit setting. Now, when the zip archive is created, it will write to disk when we reach half of the set memory limit. In addition, when it encounters a file that is larger then what can be put into memory it will attempt to increase the memory limit accordingly.
The biggest issue here is the fact that many shared hosting providers, like the one that mikeyd.com.au is hosted on, do not allow you to alter the memory limit PHP ini setting, any attempt to do so will yield an error. This means that for users in the same situation, at this point in time, it is not possible to zip a file that is over half of the PHP memory limit setting. So, on my server with a memory limit of 98 megabytes, the largest individual file that I can add to the archive is approximately 49 megabytes.
This problem also extends to the upload process. The PEAR OAuth upload process uses a significant amount of memory to perform an upload. After a fair bit of testing I came to the conclusion that it requires a PHP memory limit of 2.5 times the size of the file. So, for my server setup, the maximum backup I can upload is approximately 42 megabytes. This is far from optimal and I plan to investigate this further.
For the people who have more control over their servers you might find it more efficient to use the native PHP OAuth extension that can be compiled and installed via PECL. Once installed and activated on your server you can make the plugin use it by changing the class Dropbox_OAuth_PEAR to Dropbox_OAuth_PHP on line 56 of class-dropbox-facade.php. But please note that I have not tested this at all.
So there you have it! Hopefully this release will just work for most of you. Over the coming weeks I plan add the ability to choose which folders you wish to include/exclude in the backup that will also aid in getting the backup size down.
If you haven’t already done so browse to the WordPress plugin directory and install WordPress Backup to Dropbox 0.7.1.
Thanks again for the feedback!
If you notice any more issues or want to request a feature please do so on the BitBucket issue tracker.
