Posts Tagged ‘structure’

Search Engine Optimization-Site Content & Structure

Friday, July 18th, 2008

The optimal keyword density doesn’t appear to have changed but rather appears to have declined in value altogether. Sites with low keyword densities are starting to appear more often for phrases based more on their links than their content and also overall site relevancy.

While the importance of a specific keyword density on a page has declined, this has been countered by an increasing importance of relevancy throughout the site. Google is opting to assign relevancy based more on the overall content of the site rather than a single page. General directories will be showing up less and less in exchange for topic-specific directories. Additionally, sites with a central theme carried throughout the majority of pages will tend to rank over sites with a specific page or even section on a topic.

Internal links are carrying a solid weight in attaching relevancy to specific internal pages. Properly worded internal links, preferably built into the content of your site (see note on natural links above) will add weight to those internal pages and increase the likelihood of those pages ranking for specific secondary phrases.

PHP:Write Clean Logic Statements

Monday, June 30th, 2008

Example 1: Unclean Conditional Logic

<?php
if($userLoggedIn) {
// Hundreds of lines of code
}else{
exit();
}
?>

The above statement seems straight forward, but it’s flawed for the reason that the developer is giving this conditional block too much responsibility. I know that might sound a little weird, but stay with me.

The type of conditional organization above makes for unnecessarily complex code to both interpret and maintain. A brace that’s paired with a control structure hundreds of lines above it won’t always be intuitive for developers to locate. I prefer the style of conditional logic in example 1.2, which inversely solves the previous example. Let’s take a look.

Example 2: Clean Conditional Logic

<?php

if(!$userLoggedIn) {
exit();

}

// Hundreds of lines of code

?>

This conditional statement is more concise and easier to understand. Instead of stating: “if my condition is met, perform hundreds of operations, else exit the script”, it’s saying “if my condition is not met, exit the script. Otherwise, I don’t care about what happens after that. I am only concerned with stopping execution”. So, by doing this, you’ve limited the operations that a given control structure has been tasked with, and that will help other developers quickly understand your code.

PHP:Easy Way to List Directory Structure

Saturday, June 28th, 2008

$path = “/home/user/public/foldername/”;
$dir_handle = @opendir($path) or die(”Unable to open $path”);

while ($file = readdir($dir_handle)) {
if($file == “.” || $file == “..” || $file == “index.php” )
continue;
echo “<a href=\”$file\”>$file</a><br />”;
}
closedir($dir_handle);

Website Link Structure

Friday, June 20th, 2008

The way you structure the links on your website can affect your Google rankings. As we had discussed previously consider a link to your site as a vote for your site. So, based on this if you have the most links coming into your homepage then that page has a higher vote count. The higher the vote count then the higher you will come up in the search engines for that phrase. Based on this the things that you can do to increase that vote count are as follows: Make links within your site absolute, not relative, so use the full url, use the key phrases in your links that point to relative information, use a nofollow tag for links that are not important, less links on a page give the links that you do have more power, reduce 404 not found errors on your website.

Implement Smart URLs

Thursday, June 19th, 2008

The best URL structure for blogs is, in my opinion, as short as possible while still containing enough information to make an educated guess about the content you’ll find on the page. I don’t like the 10 hyphen, lengthy blog titles that are the byproduct of many CMS plugins, but they are certainly better than any dynamic parameters in the URL. Yes - I know I’m not walking the talk here, and hopefully it’s something we can fix in the near future. To those who say that one dynamic parameter in the URL doesn’t hurt, I’d take issue - just re-writing a ?ID=450 to /450 has improved search traffic considerably on several blogs we’ve worked with.