Optimize your CS-Cart store

Speed up CS-Cart

Faster websites get better SEO scores and get better indexes in search engines, a Google employee once said “Website should be fast”, your visitors will agree, trust me.

 

CS-Cart more salesFaster and optimized eCommerce websites do sell +40% more than slower ones, just because they are faster. You “will” agree once you see the money come ūüėČ ¬†trust me.

 

In the continuity of my “Website optimization” posts, this time we will see how to optimize CS-Cart, but hints and methods written here are useful for all other platforms, just you will need to adapt, easily.

E-Commerce Optimization

I assume you already know about the ROCK SOLID eCommerce software “CS-Cart”, if not, you are missing BIG!

odience.net|works sponsored this post and asked me to optimize their online marketplace which is based on CS-Cart.

The outcome? A faster CS-Cart store which loads in less than 5 seconds and gets a performance grade of 94/100 and on some pages 99/100 (check for yourself at Pingdom), this literally “ROCKS”.

UPDATE: Based on my work ūüėČ , odience.net|works made a package that CS-Cart users can use to speed-up their stores. Will be available soon!

Now we will see in this post, how you can optimize your site load times and speed.

A little bit more than “few” technical knowledge is required if you want to read on, but you never know, maybe you will learn on the way ūüėČ

I will expose different steps and aspects of optimization which are also applicable with other websites as we saw in my previous posts.

 

Time Matters

From an optimization point of view, even 0.1 second in load time matters so let’s get started.

 

Optimize Cache, Server side:

CS-Cart integrates a built-in cache, but that needs lots of modifications to be “robust” and “reliable”.

Here are some issues with CS-Cart’s cache:

  • It “kind of” compresses the JavaScript files but doesn’t combine them! So you find your self serving multiple files which is BAD for load time.
  • It does not cache external JS files you include with the {script} tag. OK, this might be “over doing” but it might be interesting as for serving “hosted” Google Analytics JS on CS-Cart…
  • It “combines” the CSS files but does not compress them, so you will be sending the user a quite BIG file; and that is BAD for page speed too.
  • It does not compress nor clean the HTML output, and again, BAD for speed.
  • It does not serve files with the right expires header so no one know when to refresh the content! How a browser is supposed to know what and when to cache?

Well, what to do, is to optimize this caching to the maximum and make the page generation faster and faster.

So for example the same time CS-Cart “combines” CSS files, let’s tell it to “compress” the output CSS file. When it compresses JavaScript files “independently” let’s ask for a combined and compressed output file, in the mean while, cache external JS files to limit multi-domain requests for the user.

Backup AlertThese steps are quite complex, and need core modification, so you must be careful when updating/upgrading your CS-Cart installation to keep a backup of your MODs.

SMARTY

smarty logoIf you don’t know it already, CS-Cart runs Smarty for its template engine. Smarty is basically great from an ease of use point of view, but unfortunately, Smarty v2 is not optimized for speed. Well, Smarty did great on its Smarty v3 on speed optimization, and included multiple cache handlers like eAccelerator, APC and others.

APC

Alternative PHP Cache LogoI have to mention that APC caching improves A LOT your site performance, but, Smarty v2 does not contain an APC cache handler, so I made an APC cache handler for Smarty v2, and thus for CS-Cart 3, which makes your content load directly from “RAM” instead of Hard Drive. This means “very fast”.

CS-Cart Core Optimizers

You can download these “Optimizers” from my¬†Downloads page¬†¬†odience Market, instructions included.

 

Optimize Cache, Client side:

To tell the browser which files to cache and which ones to not, your server must send correct “Expires headers”.

Unfortunately CS-Cart does not set theme correctly. This causes your client’s browser NOT to cache and ask for every page element at each request.¬†Seriously, you DO NOT WANT THIS, because, wait for it…. BAD for speed!

You will need to edit your HTACCESS file(s) to send correct “cache” headers to the user directly from your server.

CS-Cart Optimized HTACCESS

You can download a sample of the “CS-Cart Optimized HTACCESS” from my¬†Downloads page¬†and for the full version, check¬†odience Market,¬†instructions included.

 

Combine JavaScript files:

Merge JS and CSS files

As I wrote before, CS-Cart just “compresses” JavaScript files and it does NOT combine the files. You need to combine the compressed JavaScript files to use less bandwidth and send the file FASTER to the user, because JavaScript files are “VERY DANGEROUS” for page speed.

A JavaScript file ¬†literally blocks all other elements from loading until itself gets fully loaded, so you want it to be “alone” and to finish loading, wait for it …. …. …. FAST!

CS-Cart JS Optimizer

Get the “JavaScript Combine&Compress Smarty output filter”; that I wrote; from¬†odience Market,¬†instructions included.

 

Compress CSS files:

Compress content

There are lots of great Open Source projects (ex. Minify) which allow great CSS optimization, combination and compression. I don’t know why CS-Cart does not integrate one such library?

Well, all that said, you need to compress CSS files, and more precisely, Minify them to let users receive just what they need to “style”, nothing more nothing less.

Use less files, Use more SPRITES:

CSS Sprites example

CS-Cart uses a lot of small icons for its base skin.

If your current skin is using more than 20 different icons (not product images, just icons, ex. account icon, cart icon, live help icon, menu drop down arrows,…) you should think about combining them into a single file to decrease the number of requests a visitor’s browser makes to your server. This combination reduces significantly your page load time and speeds up your CS-Cart store. So, go ahead ¬†and combine your small icons into one or two bigger image sprites to reduce file requests as these requests are BAD for speed.

There are some free tools which help you automate and simplify sprites generation:

CS-Cart Sprites based Basic skin

Still not finished, but I am working on creating a sprites based “Basic” skin for CS-Cart, help is much appreciated.

 

Use a CDN for your static contents:

CDN77.com Europe Pops

CDN, CDN, CDN! (It stands for Content Delivery Network if your are new :D)

If you got the $$$ to run with the big guys, go with AKAMAI, Amazon and other big Content Delivery Networks.

But! You can set your FREE CDN too! just serve your static content from a different sub-domain (or domain), for exemple:

Serve images from

https://staticimg.yourdomain.com/images/

while serving your mains website from

https://www.yourdomain.com/

This allows “parallel” downloads which will increase significantly page speed.

Well, serving JavaScript and CSS files from a CDN is something to think twice about, because CS-Cart generates your CSS and JS files every time you refresh the cache so if you are on a CDN, that would happen slower than you expect.

To make CS-Cart “CDN-compatible” you will need to make few changes to your skin’s files. If you focus on moving only your images to the CDN, it would be quite easy, though you should also think about the Addons and their images.

Basically, by overriding the $images_dir SMARTY variable at the right moment, you can tell CS-Cart to go get the images from a CDN, though some minor modifications should be done on core smarty plugin files to let CSS files compile correctly.

Another great idea to setup a CDN for CS-Cart is to mount your CDN space as a partition (mount point) on your server and symlink your static directories (images, css, js, cache) to the mount point, this reduces all synchronisation lags, and saves you from changing core files.

CDN CS-CartBut, a better idea, is to use a “Mirror CDN” like CDN77.com!

 

I already tested CDN77.com and the service is great. They offer a 14 days free trial, which lets you know if you are ready for CDN.

I really recommend them because of the number of pops (servers worldwide) and their affordable price ($4.90 /100GB of data, THIS IS VERY LOW!). So, if you need a CDN, sign up for CDN77.com and make your CS-Cart s

ite faster!

Let me explain on how to use a mirror CDN for your CS-Cart ecommerce software:

  1. Open an account on CDN77.com
  2. Create a new CDN
  3. If you need SSL (I recommend it if you have a secure store)
  4. Choose Free SSL (shared)
  5. or choose a custom SSL (ex.: “https://cdn1.gibni.com/” for 39$/month)
  6. Let 4 minutes pass by, for the CDN to be setup of course!
  7. Modify your CS-Cart store to serve images (you can do it even for CSS and JS, but not really needed, as you would have less than 5 JS and CSS files; it’s up to you!)
  8. Enjoy your Free CDN! (Yes, as simple as that, weird huh?)

 

Use a cookie-less domain for static components:

CS-Cart Cookie

Sites setting cookies will send/set the cookie file (0.8 – 1.5 KB) for each requested component (even for static images and css/js files).

These static contents do not require a cookie file, so by using a subdomain, or another domain (like a CDN), you will be able to get this point fixed and make your static components “cookie-less”, i.e. about 1K size reduction per element, so again, read the previous section about CDN to setup one for your images (at least).

 

Optimize your server with HTACCESS and PHP.INI tweaks:

Php.ini and Htaccess optimization for CS-Cart

To oil the gears of your server, you might need to have a look at your .htaccess and php.ini (php5.ini) files.

 

Some stuff you could do:

  • Set Expires headers based on file types,
  • Tell the browser to cache CSS and JS files,
  • Unset ETags,
  • Set Gzip/Deflate compression for your HTML/PHP files,
  • Secure access to your server and store,
  • Secure file requests and prevent file request attacks
  • Make sure downloadable files are downloadable! weird, huh?!
  • Add the “missing” trailing slash in your URLs,
  • Rewrite requests to WWW,
  • Force secure connections through HTTPS
  • Install a Virtualized Software Firewall through HTACCESS to protect yourself from hackers
  • Protect ¬†your server and store from unauthorized queries and requests
  • Speed up the server with the PageSpeed Apache module
  • and so on…

Specially with PHP.INI (PHP5.INI) you could:

  • Set a default FROM address directly on the server to get your emails “delivered”
  • Increase execution times and upload file sizes to optimize performance and ease file uploads
  • Activate ZEND extensions to boost your server
  • and so on…

CS-Cart optimized PHP.INI & HTACCESS

Check the optimized PHP5.INI file (created and tested on Godaddy.com’s Shared hosting) and a tweaked (basic) HTACCESS for CS-Cart at my Downloads page.

 

Conclusions

There is a lot to do for a better web, by optimizing your websites and e-shops, you use less bandwidth and energy. Apart from making better sales and getting better SEO scores, you make a greener world. Do not hesitate about optimization.

SEO Super Comments – Update

Improve your SEO and increase Pageviews

There’s a great plugin for the WordPress platform, called SEO Super Comments, which creates a single “virtual” page for each comment on your site. It increases the number of pages you have on the site, and improves your SEO a lot. Read more on SEO Super Comments on the authors page: SEO Super Comments by Vladimir Prelovac¬†.

“The concept relies around optimizing the target page using title and H1 tag using the context of the comment. So basically we will take the excerpt of the comment and use it to create the page title and H1 tag and in the body we will hold the content of the comment…” says Vladimir.

 

 

 

Download modded Google XML Sitemap Generator 3.2.3

I created a modded version of XML Sitemap Generator 3.2.3 to work with SEO Super Comments which puts all your comments pages in the sitemap, and once submitted to Google, you should see a huge raise in your traffic.

Installation

To install, you should replace the downloaded sitemap-ui.php and sitemap-core.php in your Google XML Sitemap Generator Plugin’s directory and overwrite the original files. I would recommend you back up your original files.

Once installed, Go to your administration panel, and to the XML Sitemap Generator settings, and check the ‘Include Comment Pages’ option, click ‘Update Options’ at the bottom, and “Rebuild Your Sitemap”

I personnaly recommend this plugin and would thank the developper for it.

Please send your comments and queries here if you have any issues regarding my modded version of Google XML Sitemap Generator for WordPress.

Donate

Please go to the Donations Page  and contribute to the developpment of more updated plugins if this modded version helped you increasing your traffic.

Emergency code

Who to call in case of website emergency?

Due to some yet unknown issue, WordPress version 2.8.2 might be causing server errors.

Lunarpages, my “current” and might become “ex” webhosting company, shut down Gibni.com yesterday without any prior notice, saying they’ve taken an emergency action, as the “index.php” script in my wordpress root was using huge server resources, and could cause a server crash.

First problem is, not only they changed the “index.php” permissions to “000”¬† (no read permissions) but they took ownership of the file, so neither I could make any changes to the file, nor analyze it for troubleshooting.


Secondly, they made the domain return an “internal server error” to all visitors.


Third, they did not manage to put an “under maintenance” page at the root untill the issue is solved.


Anyway, thanks to my linux skills, I managed to put an “under maintenance” page for Gibni, and get the site back online very soon.


Until I figure out what caused wordpress to eat server resources, and was it really wordpress or Lunarpages’s poor servers and administration, was it the running theme which ran without any issue for months or even the plugins installed on wordpress a year ago; I’ve decided to switch back to wordpress default theme and upgrade to wordpress 2.8.4.

After all, I believe that you should now:


  • Enjoy Gibni, Ad free!
  • Always have a maintenance page and an emergency code, just in case!
  • Be careful choosing your webhosting company!

Making money online, avoiding the scams

Making money online…

Making money online is one of the most researched topics for many of web developpers, bloggers and website owners. It takes a lot of efforts to produce quality content and get enough traffic, to be able to rank better in search results and improve your different ranking factors. After a while of being online, website owners will get advertising offers from different companies, which might be interesting at first.

Well, this is a good sign, as it means that your site is getting some interest and attention; but it’s also an alert, warning you to be cautious.


There are lots of scams out there, which try to fool you by offering great business opportunities and make you run some ads or malicious scripts on your website. They (the scammers) will try to get detailed information about you, your website, personal details and even your bank account(s). scam


You Should be carefull…

You would get an email, from an unknown party, who shows interest in your website and usually represents himself as an advertising company who wants to buy some ad space, or publish some content on your website (or blog) for one of his clients.

First thing to do is : DO NOT reply with your personal information and¬† DO NOT show that you’re very interested!

Second, start to gather some information about the company who sent you the email. See its WHOIS record (you can use InterNIC WHOIS ) to find out more about the website owner, registrar, their address, and phone numbers if any.

Use your favorite search engine to find out more about the company, visit their website, check their “About us” page, check their portfolio, recent clients, latest works…

Look for user reviews on the company, search to find out if ” {the company name} + scam ” returns anything in your search engine? Search and investigate a little bit to keep your website (blog) safe from advertisement scams.

Use SiteAdvisor form McAffee to check if the website is a safe website or not.

If you come across any types of scams, just DO NOT reply to their emails and ignore them. You would help other website owners and bloggers if you write a post on how to identify scams and spams and how to avoid scams.

You can share this post and link back to it from your website (given that you mention the source).


Recently I’ve came across a scam from Production-Time.com . They’ve sent me an email in French, in which they shown interest in Gibni.com and asked me to reply if I wanted some more information.

I’ve done a WHOIS research and some investigation and found out that the email, even if it was well personalised, has been sent to thousands of people and some website owners have already announced Promotion-Time.com as a scam. I’ve found a detailed article about this scam in EPN.dk, which I translated to English to be able to understand it.

Here’s the a part of the email they’ve sent me:


Bonjour,
J’aimerais vous faire part d’une proposition commerciale √† propos de votre site Web, qui pourrait tr√®s fort vous int√©resser.
En effet, ma soci√©t√© Promotion-Time, souhaiterait vous r√©mun√©rer pour la publication d’une petite publication textuelle sur votre site pour un de nos clients.
Il s’agit d‚Äôune annonce francophone cibl√©e qui convient √† certaines pages de votre site.
N’hésitez pas à me contacter si vous avez besoin de plus amples informations.

Sincèrement,
Francq Petit
francqp@promotion-time.com

Si vous ne souhaitez plus recevoir d’emails de Promotion-Time, répondez à cet email avec comme sujet : STOP.
It is possible to continue this correspondence in English, if you prefer to do so.


Here in this post, you can help the community by letting other know about the scams you faced and also know about scams already running on the internet. Type in the information you have in the comments section (Be carefull not to spam the comments section) .


Making money online, avoiding the scams, aims to help you avoid scams, help spread the word and show your support.

Mark Gibni.com's History

Have you found an article, post or comment useful on this site and it saved you time or/and money?

Many people have visited Gibni.com since its first day and the number grows everyday. Do you want to mark the history of this site by bringing some help to it?


Helping_hand_gibni


Currently I am writing the 3rd article on the Delayed Write Failed error message which will hopefully help people with this issue to get their hardware work properly as expected.

The 4th part of TOP Symbian Applications is on the way too.


I expect an increase in my unique visitors by 7 000/month. Which will lead to about 30 000 unique visitors per month.

My first goal is to provide information for free, and make it accessible to everyone. All of this takes time, a lot of time.


Many visitors wanted to say “Thanks” for the information I provided here and that helped them in some way, so I recently started a new section, which you might have already seen, it’s the Donations page. Here you can donate any amount of money to help me continue the developpement of Gibni and if you donate more than 10 USD, you can show a name and a link of your choice on the Donators list.


Go ahead and Buy me a drink (Coffee: 3.5 USD, Beer: 4.5 USD or Fresh soda: 2.5 USD) at least if you can’t donate a larger amount.

Thanks for your great support.

What is RSS?

Have you ever asked yourself about the orange button like this one:rss_feed_icon which you see on a lot of websites these days?

Ever heard of the word RSS? I bet you’ve been invited many times by website owners and bloggers to “Subscribe” to their “feeds”! And you asked yourself “What is (s)he talking about!?”

So I’ve decided to put up a video which explains RSS and subscribtion in pictures! This is a very easy to understand and friendly movie clip.

The movie is created by CommonCraft . Checking up their website, I was amazed that only two people are working in this company and they do such a great work! They work from home it seems, and they worked for big companies like Microsoft and Google. There are lots of interesting videos and the website looking very friendly! Just watch this movie on RSS and you’ll love it!

[stream provider=youtube flv=http%3A//www.youtube.com/watch%3Fv%3D0klgLsSxGsU img=x:/img.youtube.com/vi/0klgLsSxGsU/0.jpg embed=true share=true width=600 height=360 dock=true controlbar=over bandwidth=high autostart=false /]

(Small tip for webmaster, bloggers and “make money online” people! : The more your website looks friendlier to a user, the more clicks and increased pageviews you will get!)

Google Pagerank Dropped! How to solve the issue?

Gibni PagerankBack in mid-October 2008, Gibni’s page rank dropped suddenly from 2 to 0!¬† I was little bit confused about how this happened! Anyway, as a new web developer, I had a lot to learn still! I did a lot of research on the topic, and found out that the main problem are the ‘outgoing links’ on my pages! Even if these links were to websites I knew most of them, Google did not appreciate all of them. At start, I decided to forget about the PageRank stuff and keep working on my site. My Alexa ranking was continuously improving and I could sell ads as well as before. So there was no need to worry! Even my pageviews doubled after a while!

I was in the process of optimizing my site that this pagerank drop happened. Once I finished my work, I went on checking all those links and decided to put a NOFOLLOW rel tag to almost all outgoing links on my site. Some of you may not approve this, but I believe that NoFollow is a good thing when it comes to improving the Internet content quality, mostly from search engines point of view.

Once I solved the rel tag issue for my links, I asked Google for ‘reconsideration’, explaining them that I was still learning and now I am aware of their quality guidelines, and I fixed the issues on my site. This was one month after the PageRank Drop!

Two or three days later, my PageRank went back to 2 again! I was surprised that this happened so fast!

Anyway, if you experience a PageRank drop, fix issues that might be in your pages by following Google’s Quality Guidelines from the “Webmaster Tools” service in Google, and then, submit your website for reconsidertion.

3D Tag Cloud For WordPress

I’ve recently installed a new Tag Cloud on Gibni.com, If you look well, you should already have noticed it.

It’s a 3D Sphere tag cloud! it’s based on a flash file but the real knowledge behind makes it completely search engine friendly.¬† This is basically a plugin called WP-CUMULUS made by Roy Tanck. The Plugin is hosted now on WordPress.org -> Plugin’s page.

I found this very exciting and as it does not interfere with search engine friendliness factors, I decided to add it to my new theme. I would recommend it as a good plugin as you can really customize it.

The theme that Roy has got on his blog is really well designed and is easy to navigate too! Good job Roy, Keep up the good work!

[WP-CUMULUS]

It’s good to know that CUMULUS is being ported to Typepad and Blogger too! So it’s good news for everyone!

Install this on your blog and to support the good work, spread the word!

International financial crisis, bloggers and website owners. Part 1

As you might have already heard there are some serious stuff going on and everyone in the world started to panic about their financial situation.

Well, now the question is that what is really going on and why should you continue to read on? Let me tell you that many HUGE banks around the world are going bankrupt, and governments are trying to help them out. This might sound OK to you, but it shouldn’t because that means everything gonna change very shortly, like a lot of small companies and also big ones might disappear in the months to come, many poor countries will become extremely poor and in trouble, and that might start civil wars, and also governments will start to tax you like they’ve never had!


I’m always an optimist person but this time, after all i saw and all that specialists say, there will be a lot of problems. Some say that China’s plan in this financial crisis is that it will wait until everything gets collapsed and then it will inject huge amounts of money in the market and ask for many things, that is China will become the owner of the world. That doesn’t look scary at all to you; I suppose; but it should!
Well, now let’s talk about what does it have to do with bloggers and internet people? The question is “Will the international financial crisis affect your website or blog income?”

Basically the income of many blogs and websites depend on the advertisers and sponsors, and some of it on the products they sell, if any.

Now if small companies and markets start to go astray, who will pay the website owner and blogger?

To Be Continued…

Comment on this Post to let others know about what you think!

Dropcap First Letter, Universal Version

As you can see on Gibni.com, articles’ title have got a drop capped first letter.

I’m making this technique available to the public so that you can “Drop cap” any text you wish.

You can drop cap in WordPress or on any other platform where you can run PHP functions.

I’ll explain on how to Drop cap in WordPress without installing any plugin.

I’ll keep it simple; just open the “functions.php” file in your theme directory, and add this function to it:

—Code—Functions.php—

function dropcap_first($content) {
$pos = strpos($content, ‘<a>’);
/* stripos is only available in new PHP versions we’ll¬† */
/* live with using the case sensitive version so it won’t match <A> */
/* ¬†¬†¬† $pos = stripos($content, ‘<a>’); */
if (($pos !== 0) || ($pos === false)) {
echo ‘<p class=”dropcap-first”><a href=”‘.get_permalink().'” rel=”bookmark” title=”Permanent Link to ‘.the_title_attribute(‘echo=0’).'”‘. $content .'</a></p>’;
} else {
echo ‘<p class=”dropcap-first”><a href=”‘.get_permalink().'” rel=”bookmark” title=”Permanent Link to ‘.the_title_attribute(‘echo=0’).'”‘ . stristr($content, ‘>’).'</p>’;
}
}

—END—Code—

Now that you have added the function, you should supply the text you want to drop cap to this function

Here’s a briefing about internal items of the function:

_____

int strpos ( string $haystack , mixed $needle [, int $offset ] )

Returns the numeric position of the first occurrence of needle in the haystack string. Unlike the strrpos()

before PHP 5, this function can take a full string as the needle parameter and the entire string will be used.

_____

int stripos ( string $haystack , string $needle [, int $offset ] )

Returns the numeric position of the first occurrence of needle in the haystack string.

Unlike strpos(), stripos() is case-insensitive.

_____

string stristr ( string $haystack , mixed $needle [, bool $before_needle ] )

Returns all of haystack from the first occurrence of needle to the end.

_____

Now proceed to formatting the drop cap letter by CSS. Here I’ve defined a new class, named “dropcap-first” and here’s the CSS I’ve written for it:

—Code—Style.css—

.dropcap-first:first-letter {
color:#900;
float: left;
font-size:50px;
padding-right:2px;
font-family:Arial, Helvetica, sans-serif;
}
.dropcap-first {
font-size:26px;
font-family:Arial, Helvetica, sans-serif;
color:#036;
font-weight:bold;
text-decoration:none;
margin:20px 0 0px 0;
}

—END—Code—

After having added the CSS to your main style sheet, you should provide the text you want to Drop cap to the function, for example, here’s what I did for the articles’ titles:

—Code—Index.php—

<div class=”post_title_wrap”><?php $get_title_todropcap=the_title(‘<a>’,'</a>’,FALSE);
dropcap_first($get_title_todropcap); ?>
<small><?php the_time(‘j,M, y’) ?>
<span class=”comments”> | <?php comments_popup_link(‘Be the first to comment’, ‘1 Comment’, ‘% Comments’ , ‘Comments Disabled’); ?></span>
<span> | written by: <?php the_author() ?></span>
</small>
</div>

—END—Code—

Once you apply the above procedure, you can get the first letter of the supplied text, dropcapped.

If you have trouble understanding the function, do leave a comment and I’ll explain you what is going on in the function.