Photon: WordPress.com's Content Delivery Network

Dealing with side loads for heavy-traffic website sometime can be painful. But, of course there are some common practice to deal with this kind of situation. For example, you can take advantage of cache system, offload to other service to reduce server load/bandwidth, or using CDN (Content Delivery Network).
For WordPress-powered sites, you can take advantage from its Jetpack. This free plugin offered lots of handy features to help you work with your WordPress installation. One of them is a featured called Photon.

Give your site a boost by loading images in posts from the WordPress.com content delivery network. We cache your images and serve them from our super-fast network, reducing the burden on your Web host with the click of a button.

That’s right. You should see some big hints there: content delivery network, cache, super-fast network. To activate this feature, just hit the “Activate” button, and you’re set. All your uploaded media files will be served using WordPress.com infrastructure. After having this feature activated, all image URLs in your posts will be modified. For example:

  • Original URL: http://domain.com/dotsios300.png
  • New URL: http://i2.wp.com/domain.com/dotsios300.png

If you are interested, here is an example of the image header served from WordPress.com network.

HTTP/1.1 200 OK
Accept-Ranges: bytes
Cache-Control: public, max-age=63115200
Content-Type: image/png
Date: Sun, 06 Oct 2013 17:06:28 GMT
Expires: Wed, 07 Oct 2015 05:06:26 GMT
Last-Modified: Sun, 06 Oct 2013 17:05:27 GMT
Server: ECS (sin/47C6)
X-Bytes-Saved: 8597
X-Cache: HIT
X-Content-Type-Options: nosniff
X-nc: HIT iad 90
Content-Length: 46456

Automatic WordPress Backup (to Amazon S3)

Today, I tried another WordPress plugin called “Automatic WordPress Backup”. This plugin will help blog owners to create backup remotely to Amazon S3 service. Since I’m using it and pretty satisfied with the billing usage, I installed it at some WordPress-powered blogs I maintain.
I use one of the available buckets under my account. For this bucket, I set its ACL (Access Control List) to private, of course. After this plugin installed and activated, I only needed to put my Access Key ID and Secret Access Key.
I decided not to include all files for my backup. I only need the database and uploaded contents. After the settings were saved, I simply hit the backup button. The process depends on the disk and database usage. I found that it was pretty fast. One of my backup files was around 300 MB, and it only took less than 5 minutes to complete the process. Also, the backup file was compressed. This should be useful to cut the usage process as you only need to store a single file for each backup.
The backup files will be automatically delivered to my Amazon S3 bucket and when the process completed, I can see the backup history. To download the backup, I only need to click on the backup links.
The backup links are built using pre-signed URLs so that only the account holder (or someone who knows the URLs) can download them.

WordPress Troubleshooting: WordPress Admin Area (Dashboard) Redirect Loop

Yesterday, I helped one of my clients with her WordPress-powered blogs. When I tried to find the solution — using search engines — I could not find any exact solution.
Problem overview
Okey, here’s the problem: When I tried to login to WordPress dashboard — not WordPress.com, but self-hosted — I always got these errors:

Redirect Loop
The browser has stopped trying to retrieve the requested item. The site is redirecting the request in a way that will never complete.
The browser has stopped trying to retrieve the requested item. The site is redirecting the request in a way that will never complete.

  • Have you disabled or blocked cookies required by this site?
  • NOTE: If accepting the site’s cookies does not resolve the problem, it is likely a server configuration issue and not your computer.

I’m not sure what caused this problem. I thought it was my browser (Firefox), but I got the same problem on other browsers.

'cannot yet handle MBCS in html_entity_decode' error on WP-DownloadManager

I am currently working on a WordPress-powered site. One of its features is a download section. After comparing some WordPress plugins, I decided to use Lester ‘GaMerZ’ Chan‘s WP-DownloadManager.
When I use that plugin on WordPress 2.5.1, I got an error. It’s something like this:

Warning: cannot yet handle MBCS in html_entity_decode()! in /home/.../wp-downloadmanager.php on line 308

Is it a bug? It seems that I got this error message because this plugin needs PHP 5 (I still use PHP 4). Since many hosts having PHP 5-enabled (even it does not always installed as the default version), it should not be that difficult to solve this issue. All I need to do is making all .php files are treated as PHP 5 files. Okey, this is a straight forward solution: add a new line in your .htaccess file. You should find it in your WordPress directory, if not, just add this line:

AddType application/x-httpd-php5 .php

And, the problem solved.
Update: Put AddType application/x-httpd-php5 .php in the first line in .htaccess file. Here is mine:

AddHandler application/x-httpd-php5 .php
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

After that, create a new php file e.g. myphpinfo.php and include this line:

<?php phpinfo(); ?>

This will display about PHP version (affected by .htaccess).

Pimp your WordPress 2.5 Dashboard

One of the gret improvements offered by WordPress 2.5 is on the dashboard interface. Collaborating with Happy Cog studio, WordPress offers some great improvements. One of them is about managable widgets for dashboard. It means, we can manage what kind of ‘widgets’ should be presented on the dashboard.
Also, we can create a new admin interface theme. There are already some admin themes available like WP Tiger, Spotmilk, or Fluency. If we want to customize or creating our own admin theme, we can do it too. WordPress 2.5 introduces another option to have per user admin color scheme. The idea is “call another stylesheet into the dashboard”. And, it’s per user basis. So, every person in the system can have their own theme. Nice, eh? Read more about this if you want to create one. Anyway, by default we will have two color schemes. It’s Classic and Fresh.