Wednesday, February 24, 2010

GOOGLE OPTIMIZATION TIPS

Babu  Natesan
Software Engineer

Google is by far the most popular search engine available today for both ordinary surfers and webmasters alike. Surfers like it because of the highly relevant results it gives and the speed at which it delivers them. This is due to its complex text matching algorithm and of course the Pagerank™ system that this engine uses. More on the Pagerank™ system later.

Google is popular with webmasters and Internet marketing companies due to the highly workable ranking system it uses. Unlike other engines where information about how the results are obtained are sketchy at best, Google actually publishes information on its site about the results it produces. Hence webmasters have things they can do to produce higher rankings.

What also makes Google popular with webmasters is the speed at which they will spider and list your site. If you're not listed in Google and submit your URL you're usually indexed within two weeks. If however your site is already listed in the index Google should re index once every month, but more frequently if you've a high Pagerank™.

This indexing and re indexing time is much quicker than most other search engines. This allows webmasters to edit their pages properties such as title,first few lines of text, headings, keyword distribution and of course the number of incoming links to their site. They can then discover quickly if the changes they made were successful or not.

It's because of this popularity that you need to know the workings of the Google search engine. Without knowledge of it you'll be ranked lower than allother sites that are only slightly familiar with the Google algorithm and hence could lose lots of potential customers.

Google ranking algorithm

Let's now continue onto the main part of this Google rankings report byindulging ourselves in the Google ranking algorithm. Well there are two main parts to the algorithm Google uses, the first is its text matching system whereby Google tries to find pages relevant to what the searcher has entered inthe search box. The second and equally important part of the algorithm is of course the Google patented Page rank™ system.

I'll first go through how to make your pages relevant by discussing the text matching part of the algorithm.

Google gives a lot of "weight" to the title tag when searching for keywords. It is therefore vital to make sure your most important keywords or key phrases appear within this tag. It seems to work best if you've other words in your title tag too after your keywords, but try to remain under 35-40characters.

I imagine many of you know this already but Google does not use meta tags such as the keywords meta tag or the description meta tag. This is because the text within these tags can't be seen by visitors to a website. Therefore Google feels these tags will be abused by webmasters placing lots of unrelated word sin them in order to get more visitors.

This lack of support for meta tags means that Google creates your description from the first few lines of text on your page. This in turn means that you've to have your keywords and phrases right at the top of your web page,if Google finds them your page becomes more relevant, if however it doesn't find them the rest of your page has to work harder to become relevant. To see an example of what I mean scroll back to the top of this page and you'll notice keyword rich wording similar to:

Google submitting tips, ranking high at Google.com, Google ranking tips, pagerank algorithm, Google algorithm guide.

The above text includes keywords and key phrases related to the theme of this page. Now when people search for any of those keywords or key phrases this page is much more likely to be near the top of the results than a page that doesn't imply this technique.

Google considers keyword density in the body of a page for determining relevancy too, so make sure your keywords and phrases appear a couple of times throughout the whole page. Don't go overboard though, a density of 6-10% seems to work best.

Google has recently been noticed to give a substantial amount of"weight" to words appearing between the various header tags. These are tags designed to help you split up sections of your page, so this approach by Google seems to make sense. The header tags go from the smallest to the biggest, the bigger the heading tag the more relevant your page will become for the words within it. It is for this reason that you should always try to have your most important words within these tags as often as possible throughout your page. Other advice about making your page relevant would be to make as many keywords appear within bold tags as you can. In the past Google has been known to index text in alt image tags, whether they still do or not I don't know but it couldn't hurt to include keywords in these tags anyway.One final tip on page relevancy is the point on having your keywords and phrases in links which point to your site. It's a good idea to have the linking text contain your keywords as Google even says itself in its description of itsPagerank technology that it analyzes pages that links come from.

How much keyword laden links matter is anyone's guess. I have however noticed a lot of sites which give the HTML code to visitors who want to exchange links do include keywords in the actual linking area. You should do this too on your links page, say something like "if you want to link to this site, please use the following code". The code would of course have your most important words in the actual link text and your less important words in the accompanying description of your site.

Google Pagerank

In the above section of the article you've learned what areas Google uses and looks at when looking for a relevant site, but what method does Google use to determine which site is better, the answer is the Pagerank system.

Pagerank is as the name suggests a ranking system of pages. It works on the basis that if a website ABC.COM has been linked from a website XYZ.COM, abc.com must have some good content and therefore Google will count the link from XYZ.COM as a vote for ABC.COM. You can check your Pagerank on Google by downloading the Google toolbar from http://toolbar.google.com

The Pagerank™ scale goes from 1 to 10 on the Google toolbar and from 1 to 7beside listings in the Google directory. A less important site is of course asite with a PR of 1 and a very very important site is a site with a PR of 7 or10, in the directory or toolbar respectively.

The more links or votes a site has the more important it must be and therefore the higher it will rank for search words which it is relevant to,right?, WRONG!.

Google does not simply count the number of incoming links a page has, if that was the case every webmaster from Iceland to Vietnam would try and exchange links to every Tom, Dick and Harry website that would let them. In Google's own words:

"Google looks at more than the sheer volume of votes, or links a page receives; it also analyzes the page that casts the vote. Votes cast by pages that are themselves "important" weigh more heavily and help tomake other pages "important."

Hopefully your beginning to get the idea. The idea is to have your page linked to by as many high quality and high page ranked sites as possible. Right?RIGHT and WRONG.

WRONG BECAUSE, you see the Google Pagerank system also takes into account the number of links the page that has linked to you has. The reasoning for this is that a page X has a certain amount of voting PR, if your site Y is the only link from that page X, then Google feels confident that page X thinks your page Y is the best link it has and will give you more PR. If however page X has 50links, page X could think your only the 50th best link. Hence the more links apage has the less of a PR boost your site will get.

RIGHT BECAUSE, linking to a site with a 6+ PR will provide a significant boost to your PR in most cases, but in cases where the site also links with 100other sites the boost will be almost zero. Likewise if a site has a PR of just2 but you and only one other site are linked from it, then the PR boost would be more than the site with 100 links and a PR of 6.

Google Pagerank formula

It's beginning to come complex isn't it, just wait till you see this formula.It looks scary for non math's people.

First let me explain what the damping factor is. The damping factor is the amount of your PR which you can actually pass on when you vote / link to another site. The damping factor is widely known to be .85, this is a littleless then the linking pages own PR.

PR(A) = (1-d) + d(PR(t1)/C(t1) + ... + PR(tn)/C(tn))

In layman's terms PR(A) is the Pagerank boost your page A will get after being linked from someone else's site (t1). PR(t1) is the pagerank of the page which links to you and C(t1) is the amount of total links that (t1) has. It is important to know that a pages voting power is only .85 of that pages actual PR and this voting power gets spread out evenly between all sites it links to.

Imagine http://www.akamarketing.com was linked by XYZ.COM's link page which had a PR of 4 and 9 other links, here's how the formula should look like:

PR(AKA) = (1-.85) + .85*(4/10)
PR(AKA) = .15 + .85*(.4)
PR(AKA) = .15 + .34
PR(AKA) = .49
To sum up my site would get an injection of .49 PR after being linked from apage with a PR of four and 9 other links.

Let's say I was linked from a site with a PR of 8, double the previous example's amount, which had 15 other links, a total of 16 outbound links, my boost would be:

PR(AKA) = (1-.85) +.85*(8/16)
PR(AKA) = .15 + .85(.5)
PR(AKA) = .15 + .425
PR(AKA) = .575

The above two worked examples show that not only is the PR of the linking page important but what is also important is how many other sites are also linked to from that page.

I think we've had enough maths stuff for now, just remember that the name of the game is to get as many links from pages with high PR and few other links.The more of these links you get the more your PR will grow and the more your rankings will improve for your relevant keywords.

Google Pagerank™ and web directories

The best thing you can do for your PR seems at the moment seems to be getting listed in Dmoz.org. Dmoz.org is home to the Open Directory Project which is human compiled directory of websites.

Pagerank™ is widely known to be biased towards big name directories such as Dmoz.org, Yahoo and Look smart.

This is true, especially in the case of Dmoz.org. These ODP links aretreated like gold by the Pagerank™ system. It doesn't even matter what the individual PR of the category page is. I have seen sites gain a large PR booston the toolbar as soon as Google updates its directory with the latest one from Dmoz.org. This is because Google uses its own version of the ODP for the Googleweb directory.

Don't believe ODP links are very important to Pagerank™?
Don't believe a listing in the ODP will boost your ranking?

Well they are and it will. Perform a search for almost anything on Google and you'll discover that 75-80% of the top 10 results are also indexed in the Google directory and therefore also listed on Dmoz.org. The fact of the matter seems to me to be if your not listed with the ODP, you shouldn't expect much traffic from Google.

Getting a listing is not difficult, it does sometimes take time but it's not difficult. Just make sure your site has good content and follow the guidelines for adding a URL. Try to get your index page listed at least. I say at least because although ODP claims only to list your index page, there are plenty of sites with 5 - 10 pages listed.

Therefore if your site has very distinctive sections you can submit each section, beware though that this must be done slowly, otherwise you may be banned from the directory altogether for spamming. Once Google updates its directory these listings could do wonders for your sites Pagerank™. My article entitled Open Directory Project guide is a complete guide to getting into the ODP, I highly recommend you read it.

Regarding Yahoo and Look smart, Pagerank™ will usually allocate a more than normal amount of PR boost for any sites listed. Tips on getting listed in Yahoo can be read in Yahoo submitting tips.

If you're a non-commercial site or have a site that's almost completely non-commercial you can get into the Look smart directory throughhttp://www.zeal.com. I really love this site, just like Google obtains its directory results from ODP, Look smart obtains its non-commercial listings from the Zeal web directory. Without Zeal I would have to fork out hard earned cash and all my site does is provide free information in the form of articles and tutorials.

To continue, I submitted AKA Marketing.com on a Tuesday and was listed in Zeal by Thursday morning. On Monday I checked my logs and found lots of referrals from Look smart, I was in Look smart already. I looked at my logs later only to find MSN had updated its database from the Look smart database and was sending me loads of visitors because of the good listing I got. My site was listed in Zeal, Look smart and MSN within six days. Needless to say I highly recommend you get over to Zeal.com and submit your site.

Before you can submit a site however you must pass a member quiz, the quiz is a fairly simple straightforward one, you might however learn a thing or two while doing it.

If you happen to be a webmaster that has a listing in all three of Dmoz.org,Yahoo and Look smart then I'm guessing your site has good to very good PR and rankings.

Google ranking tips - Conclusion

In closing I would like to recap on some of the main points you have just read.Be sure to have your main keywords and key phrases in your title tag and well spread throughout your page, use header tags wherever possible. Get as many links from as many high PR low number of outbound links pages as you can. Get listed with Dmoz.org, Yahoo and Look smart.

Well that's it. I hope you have enjoyed reading this Google Ranking tips article as much as I have enjoyed researching and writing it. I also hope that you can put this advice into use and help get yourself some real traffic.

Tuesday, January 6, 2009

An Introduction to PHP - PHP 4 Features


(Page 2 of 4 )

On May 22, 2000, roughly 18 months after the first official announcement of the new development effort, PHP 4.0 was released. Many considered the release of PHP 4 to be the language’s official debut within the enterprise development scene, an opinion backed by the language’s meteoric rise in popularity. Just a few months after the major release, Netcraft (http://www.netcraft.net/) estimated that PHP had been installed on over 3.6 million domains, making it one of the most popular scripting languages in the world.

Features

PHP 4 included several enterprise-level improvements, including the following:

  • Improved resource handling: One of version 3.x’s primary drawbacks was scalability. This was largely because the designers underestimated how much the language would be used for large-scale applications. The language wasn’t originally intended to run enterprise-class Web sites, and subsequent attempts to do so caused the developers to rethink much of the language’s mechanics. The result was vastly improved resource-handling functionality in version 4.

  • Object-oriented support: Version 4 incorporated a degree of object-oriented functionality, although it was largely considered an unexceptional implementation. Nonetheless, the new features played an important role in attracting users used to working with traditional object-oriented programming (OOP) languages. Standard class and object development methodologies were made available, in addition to object overloading, and run-time class information. A much more comprehensive OOP implementation has been made available in version 5, and is introduced in Chapter 5.
  • Native session-handling support: HTTP session-handling, available to version 3.x users through the third-party package PHPLIB (http://phplib.sourceforge.net), was natively incorporated into version 4. This feature offers developers a means for tracking user/site interactions with unparalleled efficiency and ease. Chapter 13 covers PHP’s session-handling capabilities.
  • Encryption: The MCrypt (http://mcrypt.sourceforge.net) library was incorporated into the default distribution, offering users both full and hash encryption using encryption algorithms including Blowfish, MD5, SHA1, and TripleDES, among others. Chapter 16 delves into PHP’s encryption capabilities.
  • ISAPI support: ISAPI support offered users the ability to use PHP in conjunction with Microsoft’s IIS Web server as an ISAPI module, greatly increasing its performance and security.
  • Native COM/DCOM support: Another bonus for Windows users is PHP 4’s ability to access and instantiate COM objects. This functionality opens up a wide range of interoperability with Windows applications.
  • Native Java support: In another boost to PHP’s interoperability, support for binding to Java objects from a PHP application was made available in version 4.0.
  • Perl Compatible Regular Expressions (PCRE) library: The Perl language has long been heralded as the reigning royalty of the string parsing kingdom. The developers knew that powerful regular expression functionality would play a major role in the widespread acceptance of PHP, and opted to simply incorporate Perl’s functionality rather than reproduce it, rolling the PCRE library package into PHP’s default distribution (as of version 4.2.0). Chapter 9 introduces this important feature in great detail, and offers a general introduction to the often confusing regular expression syntax.

In addition to these features, literally hundreds of functions were added to version 4, greatly enhancing the language’s capabilities. Throughout the course of this book, I’ll discuss much of this functionality, as it remains equally important in the version 5 release.

Drawbacks

PHP 4 represented a gigantic leap forward in the language’s maturity. The new functionality, power, and scalability offered by the new version swayed an enormous number of burgeoning and expert developers alike, resulting in its firm establishment among the Web scripting behemoths. Yet maintaining user adoration in the language business is a difficult task; programmers often hold a “what have you done for me lately” mindset. The PHP development team kept this notion close at hand, because it wasn’t too long before they began yet another monumental task, one that could establish PHP as the 800-pound gorilla of Web scripting languages: Version 5.


An Introduction to PHP - PHP 5 Features


(Page 3 of 4 )

Version 5, in beta at the time of this writing, is sizing up to be yet another watershed in the evolution of the PHP language. Although previous major releases had enormous numbers of new library additions, version 5 contains improvements over existing functionality and adds several features commonly associated with mature programming language architectures.

  • Vastly improved object-oriented capabilities: Improvements to PHP’s object-oriented architecture is version 5’s most visible feature. Version 5 includes numerous functional additions such as explicit constructors and destructors, object cloning, class abstraction, variable scoping, interfaces, and a major improvement regarding how PHP handles object management. Chapters 6 and 7 delve into the subject of object-oriented PHP.
  • Try/catch exception handling: Devising custom error-handling strategies within structural programming languages is, ironically, error-prone and inconsistent. To remedy this problem, version 5 now supports exception handling. Long a mainstay of error management in many languages, C++, C#, Python, and Java included, exception handling offers an excellent means for standardizing your error reporting logic. This new and convenient methodology is introduced in Chapter 8.
  • Improved string handling: Prior versions of PHP have treated strings as arrays by default, a practice indicative of the language’s traditional loose-knit attitude towards datatypes. This strategy has been tweaked in version 5, in which a specialized string offset syntax has been introduced, and the previous methodology has been deprecated. The new features, changes, and effects offered by this new syntax are discussed in Chapter 9.
  • Improved XML and Web Services support: XML support is now based on the libxml2 library, and a new and rather promising extension for parsing and manipulating XML, known as SimpleXML, has been introduced. In addition, a SOAP extension is now available. In Chapter 18 I'll introduce SimpleXML and the new SOAP extension, and also demonstrate a number of slick third-party Web Services extensions.

  • Native support for SQLite: Always keen on choice, the developers have added support for the powerful yet compact SQLite database server. SQLite offers a convenient solution for developers looking for many of the features found in some of the heavyweight database products without incurring the accompanying administrative overhead. I introduce SQLite and PHP’s support for this powerful database engine in Chapter 20.

A host of other improvements and additions are offered in version 5, many of which I’ll introduce as relevant throughout the book. When practical, I’ll be sure to introduce these improvements as the book proceeds.

As the release of PHP 5 draws near, PHP’s prevalence is at a historical high. At press time, PHP has been installed on more than 15 million domains (Netcraft, http://www.netcraft.com/). According to E-Soft, Inc. (http://www.securityspace.com/), PHP is by far the most popular Apache module, present on over 50 percent of all Apache installations.

So far, I’ve only discussed version-specific features of the language. Each version shares a common set of characteristics that play a very important role in attracting and retaining a large user base. In the next section, you’ll learn about these foundational features.

An Introduction to PHP - General Language Features of PHP


(Page 4 of 4 )

Every user has his or her own specific reason for using PHP to implement a mission-critical application, although I find that such motives tend to fall into what I like to call the four pillars of PHP: Practicality, Power, Possibility, and Price.

Practicality

From the very start, the PHP language was created with practicality in mind. After all, Lerdorf’s original intention was not to design an entirely new language, but to resolve a problem that had no immediately applicable solution. Furthermore, much of PHP’s early evolution was not the result of the explicit intention to improve the language itself, but rather to increase its utility to the user. The result is what I like to call a minimalist language, in terms of what is required of the user, and in terms of the language’s syntactical requirements. For starters, a useful PHP script can consist of as little as one line; there is no need for the mandatory inclusion of libraries like in C. For example, the following represents a complete PHP script, the purpose of which is to output the current date, such as March 16, 2004:

Another example of the language’s penchant for compactness is its ability to nest functions. For example, I can effect numerous changes to a value on the same line by stacking functions in a particular order, in this case producing a pseudorandom string of five alphanumeric characters, such as “a3jh8”:

$randomString = substr(md5(microtime()), 0, 5);

PHP is a loosely-typed language, which also increases its practicality. For example, there is no need to explicitly create, typecast, or destroy a variable, although you are not prevented from doing so. PHP handles all of this for you, creating variables on the fly as they are called in a script, employing a best guess formula for automatically typecasting variables, and finally, automatically destroying variables and returning resources back to the system when the script completes. In these and many other respects, the language allows the developer to concentrate almost exclusively on the final goal (a working application), attempting to handle many of the administrative aspects of programming internally.

Power

In the earlier introduction to PHP 5, I alluded to the fact that the new version is more qualitative than quantitative in comparison to previous versions. Previous major versions were accompanied by enormous additions to PHP’s default libraries, to the tune of several hundred new functions per release. Presently, 113 libraries are available, collectively containing well over 1,000 functions. Although you’re likely aware of PHP’s ability to interface with databases, manipulate form information, and create pages dynamically, did you know that PHP can:

  • Create and manipulate Macromedia Flash, image, and Portable Document Format (PDF) files
  • Evaluate a password for guessability by comparing it to language dictionaries, and easily broken patterns
  • Communicate with the Lightweight Directory Access Protocol (LDAP)
  • Parse even the most complex of strings using both the POSIX and Perl-based regular expression libraries
  • Authenticate users against login credentials stored in flat files, databases, and even Microsoft’s Active Directory
  • Communicate with a wide variety of protocols, including IMAP, POP3, NNTP, and DNS, among others
  • Communicate with a wide array of credit-card processing solutions

Of course, I’ll strive to cover as many of PHP’s interesting and useful features as possible in the coming chapters.

Possibility

PHP developers are rarely bound to any single implementation solution. On the contrary, a user can easily be overwhelmed by the number of choices offered by the language. For example, consider PHP’s array of database support options. Native support is offered for over twenty-five database products, including Adabas D, dBase, Empress, FilePro, FrontBase, Hyperwave, IBM DB2, Informix, Ingres, Interbase, mSQL, direct MS-SQL, MySQL, Oracle, Ovrimos, PostgreSQL, Solid, Sybase, Unix dbm, and Velocis. In addition, abstraction layer functions are available for accessing Berkeley DB-style databases. Finally, two database abstraction layers are available, one called the dbx module, and another via PEAR, titled the PEAR DB.

PHP’s powerful string-parsing capabilities is another feature indicative of the possibility offered to users. In addition to more than eighty-five string manipulation functions, two distinct regular expression formats are supported POSIX and Perl-compatible. This flexibility not only offers users of differing skill sets the opportunity to immediately begin performing complex string operations, but also to quickly port programs of similar functionality (such as Perl and Python) over to PHP.

Do you prefer a language that embraces functional programming? How about one that embraces the object-oriented paradigm? PHP offers comprehensive support for both. Although PHP was originally a solely functional language, the developers soon came to realize the importance of offering the popular OOP paradigm, and took the steps to implement an extensive solution.

The recurring theme here is that PHP allows you to quickly capitalize on your current skill set with very little time investment. The examples set forth here are but a small sampling of this idea, which can be found repeatedly throughout the language.

Price

Since its inception, PHP has been without usage, modification, and redistribution restrictions. In recent years, software meeting such open licensing qualifications been referred to as open-source software. Open-source software and the Internet go together like bread and butter. Open-source projects like Sendmail, Bind, Linux, and Apache all play enormous roles in the ongoing operations of the Internet at large. Although the fact that open-source software is available free has been the characteristic most promoted by the media, several other characteristics are equally important if not more so:

  • Free of licensing restrictions imposed by most commercial products. Open Source software users are freed of the vast majority of licensing restrictions one would expect of commercial counterparts. Although some discrepancies do exist among license variants, users are largely free to modify, redistribute, and integrate the software into other products.

  • Open development and auditing process. Although there have been some incidents, open-source software has long enjoyed a stellar security record. Such high standards are a result of the open development and auditing process. Because the source code is freely available for examination by anyone who wants to, security holes and potential problems are rapidly found and fixed. This advantage was perhaps best summarized by open-source advocate Eric S. Raymond, who wrote, “Given enough eyeballs, all bugs are shallow.”
  • Everyone is free to participate. Development teams are not limited to a particular organization. Anyone who has the interest and the ability is free to join the project. The absence of member restrictions greatly enhances the talent pool for a given project, ultimately contributing to a higher quality product.
Summary

This chapter has provided a bit of foreshadowing about this wonderful language to which much of this book is devoted. We looked first at PHP’s history, before outlining version 4 and 5’s core features, setting the stage for later chapters.

In Chapter 2, prepare to get your hands dirty, as you’ll delve into the PHP installation and configuration process. Although readers often liken most such chapters to scratching nails on a chalkboard, you can gain much from learning more about this process. Much like a professional cyclist or race car driver, the programmer with hands-on knowledge of the tweaking and maintenance process often holds an advantage over those without, by virtue of a better understanding of the software’s configurable behaviors and quirks. So grab a snack and snuggle up to your workstation; it’s time to build.