Wednesday, 11 January 2012

Improving Site Speed

After updating WordPress, I realize that my site loaded slower. I notice several spikes in CPU usage when extracting new feeds. However, on the average, my resource utilization is pretty low. I inform my webhost about it and I specifically tell them that upgrading more resources is the last thing I want to do.

They were kind enough to do this for me:

We have optimized apache and Mysql configurations on your server and now we can see that your domains are loading fine without any slowness. We have increased the following values in Mysql configuration file.

=====================
max_heap_table_size
thread_cache_size
table_open_cache
tmp_table_size
=====================

Currently you are using word press site, some themes and Plugins may cause domain slowness. You may please try to disable and re-enable each themes and plugins which helps to find out which one causing domain slowness.

You can view your domain statics or logs through Webalizer Stats option available in cPanel. Please follow the below steps to view the same.

1. login to cPanel account of your domain

2. Click on Webalizer under logs section >> and then click on view.

Could you please check and let us know if you still face any difficulties ?

I decided to use Google page speed online to identify what I can improve on. I got a score of 87/100 which I think is pretty decent. Nevertheless, I decided to look at the high priority issues.

I realize that about 50% of the enable compression is caused by Ads and I decide to test out how much faster  my site will become if I remove that ad.

Hmm.. no difference when I remove both ads but still I will remove the leaderboard at the bottom which I think generate very little traffic.

Thursday, 5 January 2012

Tracking the 'hot' posts

In my earlier post, I mention that I implemented a new little text widget to maximise the exposure of a few articles. Here are the current statistics.

5 Jan 2012
CapitaMalls Asia issue 10yr Retail Bond - 378 views
CapitaMalls Asia Bonds On Offer - 243
CapitaMalls Asia Bonds 2012 - 200
CapitaMalls Asia 10 year bonds – a quick FAQ - 146
CapitaMalls Asia Public Offering of 10 Year Retail Bonds at 3.8% pa - awaiting stats

I will let it run till a few days after the end of the announcement to see what the improvement is like.

A neat little way to show hot articles

There was a sudden jump in traffic these few days to an announcement of a particular financial product. Most of the traffic are directed at a few articles relating to that financial product. Hence, I brain stormed on how I could maximise the exposure of these articles.

A few ideas come to mind. 

1) Make the posts sticky. As an aggregator, new posts come in thick and fast. Making these posts sticky even for a few days will give the impression that no new articles have been added.

2) Highlighting the post. Seems messy since readers will be scrolling down and wondering what those highlighted post are. Furthermore, once new posts are published, the highlighted posts will be push back.

After some thought, the text widget is probably the best way to achieve my goal. However the default text widget is too plain and I wanted it to stand out. After some "Google-ing", I found the answer - Fancy Text Widget. It's not listed in WordPress plugin because it is not free. However, you can still download it for free. One way is to download the demo version. I think it's exactly the same as the full version just fewer images or you can download for free in wpsale (I stumble upon this accidentally). This free version contains more images than the demo but it is only version 1. The latest version is just one update newer and this free version is working nicely so no complains.



Tuesday, 3 January 2012

Step By Step Guide To Creating A New Finance Aggregator Site

FeedWordPress Plugin Customization
1) Download and installed FeedWordPress Version 2009.0707

2) Require to upgrade of MagpieRSS after activating plugin (normal).

3) Syndicated a test feed (http://thefinance.sg) and found a whole long list of unwanted code appended to each post. After testing on other feeds, realized that the rest are ok and the problem is only on my feed.
4) Increased the excerpt length of the feed by editing ../wp-content/plugins/feedwordpress/syndicatedpost.class.php (L74 and L75)
Change the code to:
if (strlen($excerpt) > 503) :
$excerpt = substr($excerpt,0,500).'...';

5) How do I make the permalinks for post titles open in a new browser window? or [Private]

Note that since I will be making changes to index.php, archive.php and search.php in the theme folder, I will have to make sure I modify the files after each theme upgrade.

For thesis theme, I have to modify custom_functions.php. Not going to do this because the general consensus is that opening in a new window is bad.
Beware of Opening Links in a New Window [Usability and Information Architecture]

6) How to make feedwordpress retrieve only a short excerpt and not the entire post? Feedwordpress : truncate the article

Finally found the solution. Look for the file syndicatedpost.class.php and insert the code below above line 66.
 $content = substr($content,0,500).'...';
It is basically similar to to the excerpt code, it will retrieve from 0 - 500 words and post it into the content. Hence my code look something like this now.
$content = $this->item['description'];
endif;
$content = substr($content,0,500).'...';
$this->post['post_content'] = apply_filters('syndicated_item_content', $content, $this);
http://wordpress.org/extend/plugins/feedwordpress/

7) Point Permalinks to the local copy on this website.
Go to Syndication -> Posts -> Under 'Links' -> point to local copy on this website

8) Add a 'Read full article' at the end of the single syndicated post
Put this signature code to Thesis Theme, custom_functions.php
// Signature -> http://diythemes.com/forums/showthread.php?p=74152#post74152
function my_signature() {
if (is_single() && is_syndicated()) { ?>
<p><a href="<?php the_syndication_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><br/>Read the full article &rarr;</a></p>
<?    }
}
add_action ('thesis_hook_after_post' , 'my_signature');

9) Next post permalink is 'screwed'

Auto-resolved. I guess is because of point 7 - Point Permalinks to the local copy on this website.

Thesis Theme Customization

Sunday, 1 January 2012

Tips on resolving Error establishing a database connection - WordPress

This problem should be very rare in a blog that is already running fine and there were no major changes done to it. I can only think of a few causes:

  1. Someone change your wp-config.php
  2. Your MySQL database is screw up
  3. MySQL service is not running.
For the first two causes, it will usually mean that your site is hacked. It is unlikely that your webhost screw up your files. The most probable cause is the last one.

A sure way to check is to go to WHM and check MySQL service. I'm not sure if cPanel shows. I had problems restarting the service a few times.

TIP: Using a cahce plugin like Total Cache or Super Cache helps to alleviate the problem since it will still show the cache post/homepage rather then a homepage showing "Error establishing a database connection". This will give you enough time to resolve the problem.


     here are some tips on how I resolve the error.

    Friday, 30 December 2011

    Guest Writer or Guest Author

    I am creating a new user in WordPress for guest articles and I'm torn between the above two names. As far as I am concern, the only subtle difference between an author and a writer is the former gets his work published and the latter does not.

    I decide to check the number of search results in Google for both names:

    "guest writer" : 5,010,000
    "guest author" : 3,960,000

    Intrigued, I decided to check on a few other terms as well:

    "guest blogger" : 6,070,000
    "guest post" : 14,000 000

    Guest Blogger is definitely out as not everyone is a blogger. Guest writer is my pick.

    Thursday, 29 December 2011

    800 FeedBurner subscribers

    I reach the 800 figure mile stone today. It will be a tough struggle in the coming few weeks as I struggle to push further deeper into the 800 mark. Once that is achieve can I set my eyes on the magical 1,000.

    Looking back, I didn't really do anything innovative just plain hard work - replying to interested guest writers and emailing my new new subscribers. Although not substantial, replying to all emails sent to you by interested parties does help to increase my readership by a little.

    Lesson learn: don't neglect seemingly mundane and tedious tasks.