Today I’ve released a complete rewrite of the Amazon S3 extension for Download Monitor. Amazon introduced version 4 of their Signature back in 2013 that required a different, more complicated and secure, way of signing the S3 requests. All currently existing regions would support the old (2) and new (4) signature but new regions would only support the new one (4).
Here comes Frankfurt
The latest Amazon S3 region Frankfurt (technically: eu-central-1) is the first region created after this change and will therefor only work with the version 4 signature. So if you were using the Amazon S3 extension for Download Monitor and would use the Frankfurt region, your download wouldn’t work. Luckily Amazon added support for the the version 4 signature to all their older regions, so all I needed to do was update the extension to use the new signing method.
The Amazon Web Services SDK
The older version of our extension would sign the requests by creating a hash based on a handful of arguments, combining public and private data. The new signing process is an 8-step process, creating SHA256 hashes and then constantly using those hashes as data or keys for other hashes. It’s quite a complex process that most don’t have to look into because they’ll simply use the AWS SDK. The AWS SDK, created by Amazon, does all the signing steps for you. You only have to give it the dynamic arguments like access keys and buckets and it will generate the new signed request for you. But the AWS SDK had one issue for WP developers, it requires PHP 5.5 (or higher).
Reinvent the Wheel or Bump PHP Requirement
So I had to choose. Would I completely rebuild (quite a large) SDK to make it compatible with PHP 5.2, or would I bump my PHP version requirement to 5.5. It’s funny that being in the WordPress scene so long, PHP 5.5 feels like a crazy high version to require from a user. But then I reminded myself that PHP 5.4 will not receive security updates anymore in 1 month. PHP 5.5 will be the lowest secure PHP version one month from now.
I decided to bump the PHP requirement to 5.5 for this extension. I could blame this on Amazon but if you think about it, the blame is actually on WordPress.