After over 20.000 downloads and one day before “the new iPad” hits the shelves, I give you an update on Snapshot Backup. I have finally found the time this week to work again on this project. It’s been too long, (8 months since my last update) but better late than never. It’s like a good wine.
I’ll tell you upfront: if this was easy for me, and it wouldn’t have taken this long if my knowledge of PHP was better. The latest version is available immediately from the WordPress repository.
Here’s what I’ve been slaving away over, and what’s new in Version 2.1
Added Security
As I said before, I’m not a coder – hence I don’t know many of the common practices of code sanitation and security implementation. Up until now this was something I was concerned about, but didn’t know much about.
Ed from AIT PRO got in touch on the Forum and gave me some vital tips on how to add security to this plugin. Even tough it took me 4 months to implement those, I can sleep better at night for having done so. Files can no longer be called directly, and all FTP connections are now secured with proper checks.
Sadly I couldn’t implement these into all files, because some are included from within the script which means the automation stops working. Alas, some aspects have improved. I still have the nonces in forms to deal with next time round.
Thanks Ed, for your suggestions and your patience. Ed by the way is responsible for the Bullet Proof Security Plugin – do check it out.
Automation Bug Fix
Some of you have reported that Snapshot spawns various processes and even creates files every two minutes even though the Automation Feature is definitely switched off. I went back to the drawing board and complete re-wrote the process.
Scheduled tasks were not properly terminated and just “lurked” around – and they don’t get cleared automatically, so I’ve unscheduled those processes properly now.
What helped me a lot was a super handy plugin called Cron View by Simon Wheatley. This little gem shows all WP Cron processes on a single page, and with it I was able to see that Snapshot was in fact doing stuff every minute when the option was set to not use automation at all.
Thanks Simon, Cron View pointed me in the right direction!
The Empty Database Problem
Some of you told me that the .sql files were empty, but I could never reproduce the problem. Until one day – and I couldn’t explain it. Sleepless nights later I found the culprit: special characters in the database password. A dollar sign ($) for example.
Turns out that the mysqldump command differentiates between the -p option and the –password= option. The latter lets you call it WITH special characters, the other doesn’t. Who would have known? Is this documented anywhere? Guess it isn’t and I had to find out the hard way.
So just for the curious:
mysqldump -h host -u user -ppa$$word > file.sql
doesn’t work. Try it out on the command line, you’ll get an error message. What WILL work however is this:
mysqldump -h host -u user --password='pa$$word' > file.sql
No matter what characters the password has, this command will read out the database and produce a file. If it does not, please let me know.
To make it easy for us I’ve added a line which displays the size of your database when you create a snapshot manually.
Custom FTP Port
If you’re using anything other than the default port 21 you can now tell the plugin and it will obey. You can set this under “settings”. If you don’t specify anything here it’ll default to port 21.
Newsletter
If you’d like to stay in touch with the latest developments of this plugin, then the easiest way is to signup to a new newsletter we’ve devised. When new things are happening, such as beta versions, pro versions, new features, you can find out before general release.
Click here to sign up – no viagra offers or any other spam, I promise! Or can this uber cool killer high-tech QR code with your advanced high-tech mobile device (like the iPad 3 with Retina Display and all).
Other minor changes
- Removed horrible red box from main screen
- Test FTP Button now saves as well as tests settings
- Blank sub-directory no longer gives error message
- Fixed leading slash display bug in Manage Snapshots menu
- Added cute Menu Icon (thanks to Dirceau from fasticon.com)
- Removed promises I can’t keep
Things that didn’t make it this time
I’ve tried to implement another archiving engine since some of you have reported that Snapshot is hogging resources on crowded servers. This is due to the low level TAR command which knows no boundaries – it uses most of the CPU resources on offer, which cheap oversold hosting providers frown upon.
To combat this I’ve looked into throttling the command – however the only approach I found was via a Python script (and since I know nothing of Python ruled this out).
Instead of TAR, I’ve also tried PHAR which is available on installations with PHP 5.3 and above. Sadly I cannot make head or tail of how on earth to make it work so I gave up for now. I think this could be a way to let PHP deal with the tarball rather than Linux. It would also make it possible for Snapshot to run on Windows servers.
Some day I’m sure I’ll figure it out – but that’s not today.
Closing Thoughts
I’ve started this plugin because I wanted to have one just like this. All other variations were too complex, too expensive, or too something else. I wanted a one-click solution which is extremely easy to use.
Hence I’m the visionary of what I wanted to use, but not an ideal executor – that’s why it took me ages to get back to an update. Sadly I’m not a PHP coder so things that take a coder an hour take me about a week (not to mention frustration and pain). I’m enduring it because I believe in the project – and deep down I believe I can learn a little bit every time.
Hopefully I can push out smaller updates more frequently in the future – I have so many other ideas of what this plugin could turn into. I’d like to try and implement different storage options next – so watch this space.
I hope you enjoy this version of Snapshot Backup, a lot of time and effort has gone into it. As always, I welcome your thoughts in a comment below.
Until next time 😉
I’ve just added a quick fix to a Maintenance Release, Version 2.1.1:
This switches the way auto delete operates by deleting the old snapshot(s) first, and then writing the new one to the FTP site.
I’ve also corrected the Archving spelling mistake which has been there since Version 1.0 (ouch).
Sadly this update does not address the empty database problem which occurs on some setups, pretty much because I don’t know how to fix it. Yet. It’s next on my list, together with adding Amazon S3 storage.
Without instructions of how to use it your plugin is pretty much useless.
Hi George,
In 30.000 downloads, you’re the only use who didn’t find those:
https://wpguru.co.uk/2011/02/snapshot-backup/