Thursday 29 September 2011

Sudden Drop in Feedburner Subscribers


There is no news from feedburner that there is a problem. On further investigation, I notice that my email subscribers seem to be omitted from the total number. Hopefully the problem will self resolve on its own.

Tuesday 27 September 2011

Million Dollar Blog Project - TheFinance.sg

I already have a site TheFinance.sg that aggregates local finance and investing blogs and have been thinking of ways to increase my readership.

ThinkTraffic has launched a Million Dollar Blog Project. Its goal is to build a blog from scratch and earn $1M over its life.  Sounds kind of ambitious but also sound fun.

Registration is pretty standard but I don’t like that I have to register for a clicky account. Seem like some marketing tie up here. Why can’t we use Google Analytics or any of your own tracking websites?

“We cannot currently accept any sites that receive more than 500,000 daily page views.”

I guess if you are a big time site, you are deemed over qualified for the Million Dollar project.

I don’t like to install additional plugins in WordPress for fear of slowing down my site. Hence, I decide to use the tracking code. Hmm… the tracking code consist of a image. There should have an option for hidden tracking.

There are two fields that can be a little bothersome – total revenue earned and Journal link. I don’t think the purpose is to expose this information to the public but rather to force you to really look closely at your stats and think of ways to improve it.

Off to do my Journal post.

Updates
Million Dollar Blog Project Update - 17 Oct 2011


Wednesday 21 September 2011

Guest Posts

I will occasionally receive offers for guest posts on my site but I usually turn them down because credibility and quality issues. I recently received a guest post request from a large reputable company. However, it is still important to do some background checks and ask a few important questions.
  1. Relevancy: Ask for a few samples and ensure the content is relevant for your site. The last thing you want are are guest articles on household appliances when your site is about finance.
  2. Credibility: Is the author really who or where he claim to be be? Google his name - shouldn't be too hard if he is reputable. If he represents a company, check his email suffix. Go to the company website and cross check their email suffix with that author.
  3. Copyright: Who owns the article? Do you have the right to reject or delete the article?
  4. Uniqueness: I prefer articles that are unique to my site and not found in anywhere else.
If you have any other doubts, drop the author an email. It is not difficult to distinguish reputable authors. Their replies will always be detail and will be more than willing to provide more information on their portfolio and background.

Be it paid or unpaid, the aim of allowing guest posts in your site is to improve the overall quality of your site and to attract more readers.

FeedWordPress - Switching a corrupted feed URL

I have a particular feed that causes my VPS to hung and I want to change the feed URL. However, switching feed doesn't work as it will still try to check the feed first. My next best bet is to delete the feed and re-subscribing it. Here are the steps:

  1. Under the feed >> Delete permanently
  2. Delete this syndicated link, but keep posts that were syndicated from it (as if they were authored locally). *IMPORTANT: The default is to delete the syndicated link and ALL posts. Do not select this.
  3. Unsubscribe from selected feeds
  4. Add new feed.
  5. Update the feed.
  6. Check that the syndicated author is correct.
  7. Check under all users that no new author is created. Sometimes FeedWordPress will create a new author with a similar name to the old one.
  8. Check the post, author and syndication permalink is correct.

Improving Loading Speed - Part II

Installation of W3 Total Cache was pretty straight forward. Although the installation guide states that I have to change the folder permission for 'wp-content' folder, I left it as it is without any problems. There are really tons of settings and I am leaving everything as default. The only change I made is to enable Database Cache.

Without further ado, let's see if there is any improvement.

Google Page Speed Online: 87/100
WebPageTest: 11.642s

Hmm.. results ain't fantastic. I was expecting a Google Page Speed of >90 and less than 10s loading time. Hold on a minute. I see a notification:
The setting change(s) made either invalidate the cached data or modify the behavior of the site. Empty the page cache  now to provide a consistent user experience.


Google Page Speed Online: 88/100
WebPageTest: 9.405s

Cool, load speed has now drop to below 10s and a slight improvement in Google Page Speed.

Improving Loading Speed

Although I have upgraded my VPS RAM, I do not see a noticeable increase in loading time and there was only a minor improvement in FeedWordPress performance.

I used two tools to measure the performance of my site.
Page Speed Online - http://pagespeed.googlelabs.com/pagespeed/
WebPageTest - http://www.webpagetest.org/

Using Google Page Speed Online, I have the same score of 85/100 even after increasing my memory whereas WebPageTest show a slight improvement in first view speed from 14.932s to 13.093s.

There has been much discussion on the best caching plugin for WordPress especially on WP Super Cache and W3 Total Cache. I have decided to go with W3 Total Cache primarily because uninstallation is simple. If things don't work out, I can easily uninstall for WPSC.

Monday 19 September 2011

Analysing VPS memory usage

Sometimes cPanel may not give you an inaccurate measurement of your memory usage. However, there will be some tell tale signs which include; slow loading of your website, page cannot be displayed 404, internal server error 500 and the most obvious PHP out of memory allocation.

The most accurate measurement is via SSH using the 'top' command.

# top
// to sort by memory instead of CPU (default)
// Inside the top command, press “Shift + F”, then press ‘n’ to order by memory


During normal browsing of my Wordpress site, I am already using 66% of my RAM. My Wordpress site is set to pull feeds of several websites every four hours. I found out that each website that is pulled takes up to 50MB RAM. If I pulled three or more feeds, I sometimes found myself with zero free RAM. Although increasing RAM is the obvious solution, I have more than 40 feeds to pull, multiply it by 50MB, I will need about 2GB RAM!

The estimate may be on the high side but if my site was to grow to include more feeds, I will need more RAM. Cost is an issue and I have not taken into consideration the CPU usage.

1) I will be increasing my VPS memory by another 512MB (smallest denominator available)
2) Going to ask my web host is Spam Assassin is configured correctly because it is using almost 20% available memory.
3) Configure PHP to use 512MB, 640MB and 768MB RAM to check on the performance. I will ask the web host to configure 768MB RAM in php.ini in case another problem pop up.
4) Check and configure optimal settings for eAccelerator.

Tuesday 13 September 2011

Migration Log

After weeks of preparation, I am ready to migrate my site to the new host. I am logging each step taken so that in the event things go wrong, I can easily pin point the cause.

* Monitor your website traffic and choose a day where traffic is the lowest. Fortunately for me, Friday night is when my traffic is at the lowest and it is also at the end of my work week.

Friday, 9 September, 2011

2030 hrs
- Start of site migration.
- Create new cPanel account.
- Check that anonymous FTP is disabled.

2035
- Scan through the files in the old host to ensure no abnormally large files e.g. error_log
- Download files via cPanel backup manager.

2040
- took 5mins to download 185MB into tar.gz format
- Extract the files via winRAR but encountered error.
- Extract only the specific folder instead of all files and folders – successful.

2045
- create new mySQL database, user ID, password and assign full privilege to the database

2050
- Check .htaccess file.
- Change the path name because my old host use a sub domain.

2055
- Use Filezilla to upload all the files to my new host.
- Have to use root account because I have not updated my domain registrar to the new host name servers.

2215
- Filezilla uploaded completed. I heave a sign of relief as no files fail to be transferred over.
- Going to wait till 2300 to take the last mySQL backup

Saturday, 10 September, 2011

0031 hrs
- 1.5hrs overdue. Was preoccupied with other stuff. I did mention that Friday was my rest day ya.
- Exported the database in gzipped format.

0042
- Import SQL database

0054
- SQL error. Duplicate entry 502.
- Deleted, re-create and export the database but error still persist.
- I check through wp_posts and wp_comments and the number of records tally with that on the old host.
- The size of the database in the new host is larger than the old host.
- Decided to ignore the error.

0115
- Updated the name servers of my domain registrar to that of my new web hosts.
- Have to wait up to 48hrs.
- Ping my domain and still resolving to my old host IP.
- Going to bed and hopefully my site will be up when I wake up.

0600
- Ping my domain name and still resolving to my old host IP.

1020
- Ping now resolved to my new host IP. However, when I log in, it still showing the old WordPress version of my old host. Weird.
- It’s Saturday and I have a gathering later. Got to leave it till Sunday. Fortunately my site is still running.

Sunday, 11 September, 2011

0930 hrs
- Half awake hoping my site will work.
- Bam, internal server error 500.
- After some research, I think the problem lies with the permission of my .htaccess and/or probably all my files and folders.
- Was it my mistake to use root to upload my files as normal users/groups may not have the permission?
- It will take too much time to identify the permissions for each file.
- Good news that my domain registrar is resolving to my new host.
- I deleted the entire cPanel account and re-do from scratch. This time using my account (non-root) credentials since my domain has been resolved.

1300
- Finished all the steps but now it is pointing to cgi-default page. It can resolved to http://mydomain.com/. (with a dot at the end though).
- Raise a support ticket with my web host.

Monday, 12 September, 2011

0000 hrs
- Another day has passed and suddenly I can resolved to http://mydomain.com/ (without the dot). My web host did not reveal what the solution was and I was too tired to ask.
- Tested my site and found out the site is loading very slowly with insufficient memory allocation.

0030
- Updated php.ini to allow 500MB memory and restarted Apache service.
- Basic test OK.
- Email to support to install two missing PHP modules required for one of my application.
-  Finally going to get some sleep and do a full test later.
0900
- Internal Server Error again!
- I tried uploading an empty htaccess file but the error persist. How can it suddenly go down when it was working earlier?
- Has my site been hacked? Even my test domain is facing the same problem.
- Log a ticket with support. Hope it can be resolve quickly.

Update on 14 September 2011
- Internal server error solved.
- According to support, the internal server error was caused by php memory being set to 'maximum'. They have changed it to 256MB.
- Still facing several problems but at least normal viewing of the site is fine.

Friday 9 September 2011

Migrating WordPress to a new server or host checklist

The purpose of the checklist is to ensure that I adopt a systematic approach and do not miss out any steps during the migration. There may be several methods to achieve each step but I want to keep it short and precise. I may discuss on the method used in a separate post.

As I am using a VPS, my checklist may be longer than those with a shared web host but most of the steps should be similar.

1. Add my existing domain to my new web host control panel.

2. Create a new cPanel account in my new host (use WHM).

3. Do a quick scan on the WordPress files and folders in my old host.
(I found out that I have a 300MB error log generated by my old host that can be excluded. This will save me time during download.)

4. Download ‘all’ files and folders from your old web host.
(Exclude any files not related to WordPress e.g. error logs as mention above)

5. Export MySQL database from my old host.

6. Create a new database in my new host.

7. Create a new database user with full privileges on my new host.

8. Assign that user to have full access to the new database.

9. Check the downloaded .htaccess file and edit if necessary.
Reference: http://digwp.com/2011/01/new-htaccess-permalink-rules/

10. Edit the downloaded wp-config.php with the new database name, user ID and password

11. Upload the download files and folders to my new host.

12. Import MySQL into the new database(new host).

13. Check the number of records in the new database(new host) is the same as the old database(old host).

14. In my new database, go to wp1_options and check/change the domain/path name:
-         Option ID 1: site URL
-         Option ID 39: home
-         Option ID 60: upload_path
Source: http://blog.triphp.com/how-to/how-to-move-wordpress-to-a-new-server-or-host.html

15. Update the name server(s) in my domain registrar

16. Wait in intervals of 4hours and refresh my local computer DNS.

17. Ping my domain name to check if it resolves to my new host's IP.

18. Once successful resolve to my new host, login to WordPress and cPanel.

19.  Do a quick check as a normal reader
-         Click on the post title
-         Click the "Read More" link.
-         Check the "Read the full article ->" correctly redirect to the author’s page

20. Configure cronjob in cPanel.

The last two steps are specific to my site only. Different owners will have their own quick checks. Also, a quick check is different from a comprehensive or full check where you check all your plugins, widgets, email etc. As long as my site is able to perform up to its basic function, it will give me enough time for a full/comprehensive test.

A final word of caution. I wrote this for migrating my personal site and I am not a full time blogger. Although you can still use this checklist for important/critical sites, I strongly recommend that you do not follow my list blindly and to add in your own points if necessary.