How to add your website to Cloudflare

Cloudflare is an intelligent cloud network which protects your website from unwanted traffic such as crawlers and bots which may be using up your bandwidth but not doing you any good in terms of genuine traffic and leads. Not only that is also acts as a CDN and caches static resources on your website such as images, CSS and JavaScript thereby decreasing page load times and improving user experience in terms of fast page load.

I had heard about Cloudflare but did not know about its working till an incident happened to one of our client’s website hosted in the UK. The client’s website was well known globally due to it website name and it had a lot of traffic from around the world. Then one fine day he suffered a DDoS attack. It was such a fierce attack that our dedicated server was not able to serve any other websites and our hosting company was forced to take down the website from the hosting server. However when they tried taking it back online the DDoS attack restarted and it seemed like there was no respite. One of the support personnel at the company suggested we try Cloudflare as it was able to withstand the attack and had the capability to filter out unwanted traffic. We registered a free account with them and changed our nameservers. As soon as the nameservers clicked in we started to see that the website started to respond to requests even though it was still slow by any means. We talked to Cloudflare support and they said that they have started to cache the website and you will see improvement when much of the website has been cached by them.

We also blocked out traffic from countries in Africa, China and Russia as these were not the target countries of the client and we started to see improvement in speed. After talking with the client we blocked the website from all over the world except for the UK and we could see that there was remarkable improvement and in the next couple of days the website was working normally as Cloudflare had done its job and saved our client’s website from the DDoS attack.

After seeing this real life example in action I decided to move my website to Cloudflare. If you too want to move your website to Cloudflare then please follow the steps given below

1. Login into your account after creating your account on Cloudflare

Cloudflare login screen

2. After logging in you will come to your websites dashboard. If you have already moved some of your websites to Cloudflare then you will see a list of your domains on the screen. If you need to add a new website then type in the domain name and click Add Website button.

Cloudflare Websites Dashboard

3. Once you click on the button Cloudflare will start scanning your domain’s DNS records.

Cloudflare scanning your domain's DNS records

4. Once the scanning is complete the panel asks you to click on the button to go to the next page to see all the fetched records.

Cloudflare DNS scan complete

5. You will see all the DNS records such as A, CNAME, mail, ftp, www etc currently setup for your domain. It also shows you which parts will come through Cloudflare and which parts will be directly accessible through the internet. Most of the times Cloudflare gets it right and you can continue setup as normal. If you need to change anything you can do it later on as well once your domain has been setup on Cloudflare.

Cloudflare displays DNS records for your domain

6. The next screen asks you whether you will be going for a free plan or a paid one. It also asks you whether you would like a CDN in your package, security level for your website etc. As we are going for a free plan you can proceed with the default selection provided on the screen. You can come back to this screen later on if you change your mind regarding any selection.

Cloudflare domain settings

7. The last screen you will see asks you to change your nameservers to the one provided by Cloudflare. This is where you will need to login into your registrar account and change the nameservers for your domain. Once that’s done you can come back to this screen and click on the button to confirm that you have done as requested. It took 1 hour for my domain and it should be more or less the same for you.

Change your nameservers to point to the ones shown on Cloudflare

I hope the above helped you and if you would like to add anything then please do send me your feedback.

Is SEO dead for companies in Pakistan

Some years back (2005 to be exact) I joined a UK based web design agency and got my first hand experience of seeing websites optimized for keywords requested by clients and those keywords then achieving page 1 positions on Google and other search engines. I was quite fascinated by this as must be the clients paying for the optimization of their websites.

The modus operandi was that clients would send an enquiry or contact our office and request that their website be reviewed for SEO. We requested clients to provide us a list of 10-20 keywords which they wanted to target to improve their rankings on Google. Our SEO team would then review the client’s website and compile an Excel sheet outlining the current rankings of the client’s website on those keywords. They would also check if the client’s website was optimized for on-page SEO such as option to add/edit meta tags and search engine friendly URLs. If the keywords provided by the client were too generic or too competitive our SEO team would provide alternative keywords which they believed had a better chance to succeed. The client then selected the final 10-20 keywords for his website and our company would start work on them.

If the website needed some on-page optimizations such as adding and editing meta tags, URL rewriting and option of providing H1, H2 headings the work would come to my development department and we would add those features as requested by our SEO team and hand it back to them. Our work was usually finished in a couple of days.

Our SEO team then started the on-page SEO of the website and it usually took them 7 to 10 days of the first month to complete the process. During this process they would use the keywords from the approved keyword list provided by the client and embed them in the meta titles, headings, content and page URLs of the website. They created an account on Google Analytics if the client had not created one and generated the sitemap XML and submitted to Google Webmaster Tools. They checked for any 404 pages (broken URLs) in GWT and have them resolved by us if they existed.

The next step was to build back links to the website to increase the importance of the website in Google’s eyes (Remember PageRank :)). This was the time of link directories and link exchange programs. The client’s website link was submitted on high page rank link directories. The anchor text contained the actual keyword from the client’s approved list. Emails were exchanged with other website owners to place our client’s link on their website and in return our SEO team would place their link on the client’s website.

This process went for another month and a half and if all went well the rankings started to improve from the 3rd month onwards. Most of the times the client himself would contact us and express his gratitude on improving his website rankings. Some of them would be so happy that they would extend their contract for another 6 months to 1 year. Our SEO team was the darling of the company and at one time they were managing more than 30 projects which earned big moolah for the company.

I was just as much fascinated by their success but sometimes I felt that if this process was so easy then any Tom and Harry could get their websites optimized using these techniques and Google always prided itself on providing quality search results for its visitors.

Well it looked like Google was not happy that people were taking it for a ride. When Google introduced Panda and Penguin algorithms to fight web spam nearly all our client websites took a hit. Our clients started complaining of loss in traffic and that their website was nowhere to be found. Even though our SEO team made quickfire changes to offset the damage caused they were not able to recover the pre-Panda and pre-Penguin rankings of our clients and gradually our clients started to bid adieu and look elsewhere for a solution. Some were understanding and continued with the company but they had to start investing in Google Adwords to receive traffic and customers and that took a big hit on their profit margins.

The company eventually moved total SEO and internet marketing from Pakistan to the UK and the SEO department was eventually closed by the end of 2012.

This was not the story of one company but a lot of companies have closed down their SEO departments totally or scaled down operations to the bare minimum over the past couple of years. SEO related jobs have nearly stopped coming up on job portals and newspapers. Companies no longer see profit in SEO as people cannot get you results like they used to some 4-5 years back. As one senior SEO from a Dubai based media and SEO agency says

Managing a team of SEO’s to achieve organic results is much expensive than running PPC and Ad campaigns on Google and elsewhere

If you are a SEO or want to optimize your website then do read the Google Webmaster Guidelines.

Word of advice:

  1. Improve user experience on your website
  2. Stop keyword stuffing
  3. Start your own website blog
  4. Improve your social profile on Facebook, Twitter, Pinterest etc.
  5. Do not buy or exchange links from anyone. Encourage natural back links

Tips to improve your email delivery rate

After writing doing email marketing the right way, I thought of giving some more tips on improving your email delivery rate as well as increasing chances of your email being read by the end user. After all it won’t do you any good if the people you are sending the emails to aren’t receiving them in the first place.

Email subject should be mixed case

Many email marketers think that if they send the email with subject in upper case characters then the user would be forced to open the email and read it. Nothing could be farther from the truth. Mail servers using anti spam software send these type of emails to the junk mail/spam folder. Your target user would not receive it at all unless he checks his junk on a regular basis.

Email message should be normal font

You should use normal font size (10-12)  to write your email message. Avoid using bold font and using upper case words in your message. If you need to highlight something then make sure it is your offer such as the price, bulk discount etc.

Use as less images as possible

If you are promoting a product then make sure to use 1-3 good quality pictures in your email and try not to go above this. If you do then anti spam software may mark your email as spam and send it to the junk mail folder. Some people fill their whole email with pictures of their products thinking that it would bring a positive response from the recipient in terms of conversion. They forget that if the recipient does not receive the email in the first place then all their hard work would go to waste.

Personalize your email messages

Using the full name or the first name of the recipient when starting your email is a good way to personalize your message and give the recipient a feeling of 1 to 1 between you and him. Start your email with Dear <recipient name>, or if you know the appropriate salutation you can use Dear Mr./Mrs./Dr./Miss <recipient name> which would be more proper.

How to remove your mail server from Hotmail black list

I came to office on Monday and the guy from accounts came and told me that he is not able to send any email to his Hotmail account. I shrugged and thought that our mail server may have gotten blacklisted and that could be the reason why he was not able to send his emails. I checked the blacklist status of my website on and it came clean. I then sent an email to my Hotmail account and I got a Message Delivery Failure message with the following message.

Hotmail Blacklist Message
Hotmail Blacklist Message

I Googled and found that Hotmail has its own blacklist reporting service. The blacklist meant that we could not send any email to any Hotmail, Outlook and MSN email address and that is a big negative for our business as most people create accounts on these websites and we could lost money if we are unable to send them any email.

I then proceeded to and logged in with my Hotmail account. I logged in fine but I was not able to view any data for my mail server. It seemed like I had to request access to my mail server so I could then review the data they have against it. I clicked on Request Access link and got the following page:

Request access to view IP address logs
Request access to view IP address logs

Enter the IP address and click Submit and Hotmail will display the email address accounts on which they can provide you access to the logs. This is necessary as Hotmail cannot provide access to thee logs to every one.

Select email address to view logs
Select email address to view logs

Once you select the email address (please note that the chosen address must exist),  you will receive an email from Hotmail requesting you to confirm giving access to the person who has signed in through his Hotmail email account (in this case myself).

Hotmail IP log access request
Hotmail IP log access request

Once you click on the link to give you access Hotmail provides you complete log of the emails sent from your mail server. This is how it looks.

IP log report on Hotmail
IP log report on Hotmail

Once you know the reason why your IP address is blacklisted you can fill out the following form giving complete details about your mailing process, privacy policy, unsubscribe procedure etc.

Once you provide the complete details and you click on Submit button a ticket number will be generated like as follows

Ticket number
Ticket number

If all is well you will receive feedback on your ticket in the next 2-4 hours. I received reply after 30 minutes and the blacklist was removed promptly.

Hope the above helped some one.

Doing email marketing the right way

Email marketing is the most direct method of marketing and allows you to target your customers and/or subscribers in the shortest time possible. You are able to advertise your products/services to them and they have the chance to be the first set of people who buy from you. Even then there are some set of rules which you must follow so that you don’t end up spamming your customers and blacklisting your mail server.

1. Newsletter subscribe option

First you need to have a newsletter subscribe option on your website. Please bear in mind that email marketing is ethical and legal only if you are sending email to customers/subscribers who have explicitly expressed their intent of joining your newsletter. If you don’t have a newsletter subscribe option and you really want to send email to your users then you can place a newsletter opt-in option on your registration/sign up forms however you need to mention this on your website so that your customers know what they are getting into.

2. From: address

When sending emails to your subscribers make sure that the From: address in your email is that of your domain and not of any other website or email provider (like GMail, Hotmail, Yahoo etc). It would look highly unprofessional if you use another email address other than the one for your domain to send emails and it could get you blocked by your subscribers. Not only that this would be seen as attempts to spam your subscribers.

3. Contact information

If you are a legitimate business offering information about your products/services then you should mention your complete contact details in your newsletter so that people know who they are dealing with. They can use the contact details of your company to contact you and you may ultimately achieve a sale.

4. Unsubscribe option

The option to unsubscribe must always be available to your subscribers. It should be clearly visible on your email and the link should work i.e. if some one clicks the link then it should unsubscribe the user easily.  It would be preferable to have an unsubscribe option on your website as well. If you don’t have this option on your outgoing email then people can report you for sending out spam and your mail server may be blacklisted.

5. Plain text format

Most companies send out a very fancy and attractive newsletter template to their users. While this may all be good as it helps subscribers to view the offer in one go it may not help those who view their email in plain text. Some subscribers do not want to view graphics in their email and if you don’t send your email in plain text then you will simply lose out on a sizable number of subscribers.

6. Avoid BCC

Never enter and send emails to your subscriber from the BCC of your email. The technique of this method is put your email address in the From and To section and pack the BCC section with all your subscriber emails. Sending emails via this method is very dangerous as mail servers have become very intelligent and you may see some of your emails not being delivered to the recipient.

Last but not least check the USA CAN SPAM law of 2003 for more details on what you should not do when email marketing.

Hope the above helped.

Difference between POP and IMAP and which one should you choose

POP and IMAP are two protocols by which you are able to access/download emails from your mail server.

POP (Post Office Protocol) allows people to download copies of their email messages to their computer (provided the option to leave a copy of the mail message is enabled when setting up the account). If the option is not checked then the email itself is deleted from the mail server when it is downloaded to the computer. Any changes made to the mail message are only present on the computer on which the mail was downloaded and no one can see what changes were made and why.

IMAP (Internet Message Access Protocol) allows people to read emails as they arrive on the mail server. You are connected at all times to the mail server and any changes are visible to any one who log into that IMAP account. However if you are unable to connect to your mail server then the disadvantage of this protocol is that you are not able to read any emails (even those you downloaded via your email client like Outlook).

So which option should you choose?

You should based your answer based on the following options:

If you are the only person who is going to access/read all your emails then use POP otherwise use IMAP if multiple users are going to access the emails.

If you prefer to take backup of your emails yourself then use POP otherwise use IMAP.

If you are going to access your emails from one computer then use POP otherwise use IMAP if you access your emails from multiple computers/devices at multiple locations.

Hope the above helped you in understanding which option to choose and why.

Mobile website can lower your bounce rate and increase conversions

Mobile phones or more appropriately smartphones have become an integral part of our lives but now they are creating an impact on your website conversion and bounce rate as well. People now use their smartphones to browse websites online and this trend is increasing very rapidly especially in Asia and Africa. In the words of my boss

Every man may not have a computer but nearly every man has a mobile phone

Due to this, website owners may have to revisit the design of their websites and check their websites on mobile website simulators available online to see how their websites look on a smartphone device. I use following simulators to check how websites I develop look on smartphones.

If you see that your website is not loading properly or you are having trouble finding your way on the website then it’s time you ask your web designer to design a mobile friendly version of your website which loads quickly on smartphones. If your visitors cannot find what they are looking for quickly believe me they will not wait another second and close their browser or worse visit another website (maybe your competitor). This in turn will increase the bounce rate of your website which is an indicator of how meaningful your website is to the visitor. Remember,

The higher the bounce rate the lesser the conversions.

You have two options for designing your mobile website.

  1. Responsive design
    Responsive as the name suggests makes use of CSS media queries to render your webs page according to the device the visitor is using to browse your website. This means that your website will appear different on a mobile phone and tablet than on a desktop. The best thing about this option is that the URL of your website will be same. As an example check out my website on one of the above mentiond simulators and you will see what I mean. Google also strongly recommends that website owners use responsive design on their websites for better results.
  2. Design a separate mobile website
    The first option is usually the best option however in cases where the website is huge or there is not enough time/resources or you don’t have the budget for a responsive design you can go and have a separate mobile website designed for yourself. There are only 2 issues with this option.

    • Your mobile website will need to be run on a separate URL (sub-domain or some other address). Most people run their website on but this is not mandatory and you can use any address for this purpose.
    • You need to check whether the visitor is browsing on a desktop or a mobile phone/tablet and redirect the visitor appropriately to the correct website so if a visitor is on a mobile phone then you need to redirect him to the mobile website.

Just to show how much an impact a mobile website can make in lowering your bounce rate check the graphic below. I implemented a mobile website for my client based in the UK. As you can see the bounce rate for mobile phones and tablets has gone down by 39% and 24% respectively.

UPDATE Dec 2013:

The bounce rate has gone down further and now the bounce rate is 20% for mobile phones and 22% for tablets which is less than half of what was originally and the overall goal completions have risen by 35%

Tutorial to create custom Magento module

I could not find one good tutorial on developing a custom module in Magento when I had a client requirement to develop one for his website. It was not like there weren’t any. If you Google “custom Magento module tutorial” or something similar you will get a lot of search results however I received a lot of errors when I tried using them in my case. Either they were not tested or they were not supposed to work in that way but I am not complaining as it helped me to learn more about Magento and custom module development in Magento.

Follow the steps below to create your first custom Magento module. This module will display entries from a database table and display it in the Magento admin panel. I have tested this module on Magento community versions 1.6.2 and 1.7.0 and it is working on both of them.

Run the following SQL statement in your mySQL database.

CREATE TABLE `sarfraz` (
  `first_name` varchar(100) DEFAULT NULL,
  `cus_email` varchar(100) DEFAULT NULL,
  `telephone` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)

After running the above statement it should create a table by the name of “sarfraz” in your database. Now run the following insert SQL statements to create records in the table.

insert into `sarfraz` (`id`,`first_name`,`cus_email`,`telephone`) values (1,'Adam Sandler','[email protected]','1234567890');
insert into `sarfraz` (`id`,`first_name`,`cus_email`,`telephone`) values (2,'Joe Burton','[email protected]','5556667777');
insert into `sarfraz` (`id`,`first_name`,`cus_email`,`telephone`) values (3,'Alice Keys','[email protected]','66677788888');

Our table now has some entries so we can now proceed with the actual coding related changes.

First create your XML file in the app/etc/modules folder. In this tutotial my XML file is named as Adeel_Sarfraz.xml however you are free to choose what ever name is right for you.

<?xml version="1.0"?>

The above code will register your module in Magento. Now we put in the actual code for the module.

Go to app/code/local folder and create a new folder by the name of “Adeel” and then create another folder within it by the name of “Sarfraz”.

Now create 5 folders in the app/etc/local/Adeel/Sarfraz folder.

1. Block
2. controllers
3. etc
4. Helper
5. Model

We will start now by creating a config.xml file in the etc folder. Once you have created it you can add the following code to the config.xml file.

<?xml version="1.0"?>


                    <list translate="title" module="sarfraz">
                        <title>Admin Title</title>

1. Now add the following folders and files in the Block folder.


Open the Block/Adminhtml/Items.php and add the following PHP code to it.

class Adeel_Sarfraz_Block_Adminhtml_Items extends Mage_Adminhtml_Block_Widget_Grid_Container
    public function __construct()
        $this->_controller = 'adminhtml_items';
        $this->_blockGroup = 'sarfraz';		
        $this->_headerText = Mage::helper('sarfraz')->__('Admin Title');

Next open the Block/Adminhtml/Items/Grid.php and add the following PHP code to it.

class Adeel_Sarfraz_Block_Adminhtml_Items_Grid extends Mage_Adminhtml_Block_Widget_Grid
    public function __construct()
    protected function _prepareCollection()
        $collection = Mage::getModel('sarfraz/sarfraz')->getCollection();
        return parent::_prepareCollection();
    protected function _prepareColumns()
        $this->addColumn('id', array(
            'header' => Mage::helper('sarfraz')->__('ID'),
            'sortable' => true,
            'width' => '60',
            'index' => 'id'
        $this->addColumn('first_name', array(
            'header' => Mage::helper('sarfraz')->__('Full Name'),
            'sortable' => true,
            'width' => '60',
            'index' => 'first_name',
            'type'  => 'text'
        $this->addColumn('cus_email', array(
            'header' => Mage::helper('sarfraz')->__('Email Address'),
            'sortable' => true,
            'width' => '60',
            'index' => 'cus_email',
            'type'  => 'text'

		$this->addColumn('telephone', array(
            'header' => Mage::helper('sarfraz')->__('Answer'),
            'sortable' => true,
            'width' => '60',
            'index' => 'cus_telephone',
            'type'  => 'text'

		return parent::_prepareColumns();

2. Add the following folder and file to the controllers folder


Open the controllers/Controller/ListController.php file and add the following PHP code

class Adeel_Sarfraz_Controller_ListController extends Mage_Adminhtml_Controller_Action
    public function indexAction()
        $myblock = $this->_addContent($this->getLayout()->createBlock('sarfraz/adminhtml_items'));

3. Create the following file in the Helper folder.


Add the following PHP code to Data.php file

class Adeel_Sarfraz_Helper_Data extends Mage_Core_Helper_Abstract


4. Add the following files and folders to the Model folder


Open the Model/Sarfraz.php file and add the following code

class Adeel_Sarfraz_Model_Sarfraz extends Mage_Core_Model_Abstract
    public function _construct()

Then open the Model/Mysql4/Sarfraz.php file and add the following code

class Adeel_Sarfraz_Model_Mysql4_Sarfraz extends Mage_Core_Model_Mysql4_Abstract
    public function _construct()
        $this->_init('sarfraz/sarfraz', 'id');

Finally open the Model/Mysql4/Sarfraz/Collection.php and add the code below

class Adeel_Sarfraz_Model_Mysql4_Sarfraz_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
    public function _construct()

After adding the code changes above please clear the Magento cache and your module should come up under the customers menu by the name of “Admin Title”. If it does’t then logout and relogin into the Magento admin panel. You can change the “Admin Title” to some thing more meaningful by editing the etc/config.xml file.

If the above is too much time consuming for you then you can contact me and I will provide you the files in zip format.

If you have any feedback then please share by commenting.

Basic SEO steps to optimize website on Google

These are some basic steps which I feel every search engine optimizer must follow to optimize a website from scratch. If these issues are resolved at the start then you will not face any optimization issues later on.

Check for 404 pages/broken links on website
Broken links are poison for any website. If you have access to a crawler then the first thing to do is check for broken links on the website. This will give you a clear picture of the navigation structure of the website as well as links which are broken.  To save time you can also request the website owner to provide you access to their Google Webmaster account which will outline the complete crawl issues of the website. After you have the complete list of broken links on the website you should have them corrected as soon as possible. I have developed an online 404 checker for this purpose which is free 🙂 so please do use it.

Enable search engine friendly URLs on website
If the website URL structure is dynamic in nature i.e. have “?” and “&” in its URLs then you should try and have search engine friendly URLs enabled on the website. The benefit of these URLs is that they will be keyword rich and help optimize those pages on search engine results. Most websites nowadays already have these URLs enabled as support is available on both Linux and Windows hosting servers.

Check for duplicate pages on website and remove them
Try and check for duplicate content by using moz or plagspotter. Both are paid however Moz offers a 30 days trial period. You can cancel the trial period after the completion of 30 days. Both these websites let you know if there are more instances of web pages which have the same content as yours and it helps you take action. Most of the time the duplicate content may be due to minor navigational issues in your website which can be resolved with some tweaks however these need to be catered to otherwise the website may never come high on search engine results and may even get banned.

Implement the canonical tag on website

As per Google definition

“A canonical page is the preferred version of a set of pages with highly similar content”

Google provides this one stop easy solution for website owners to implement the canonical tag and inform Google and other search engines which is the main version of the page the search engines should give priority when giving results. You can read more about canonical tags here and here. The best part of this solution is that it can help resolve your duplicate page content issues very quickly.

Make sure that the meta tags are unique for each page on website
Most websites have nearly the same meta title, meta description and meta keywords on multiple pages which leads search engines to think of these pages as duplicates. Due to this search engines do not think highly of these pages and they do not come up on search results often. Try and create as unique meta content as possible related to the web page which will help your website in the long run.