Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

free SEO mod - XC SEO -> needs testing & feedback

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 04-26-2006, 01:24 PM
 
intel352 intel352 is offline
 

X-Wizard
  
Join Date: Dec 2005
Posts: 1,071
 

Default free SEO mod - XC SEO -> needs testing & feedback

XC SEO Lite v 1.0.0 Released

Thread is available at the following url:
XC SEO Lite Released

Quote:
The XC SEO team is proud to announce the release of XC SEO Lite version 1.0.0.
XC SEO Lite is completely free, and licensed under the GNU GPL 2 license.
All code is versioned and available from our repository at:
http://code.google.com/p/x-cart-seo/

A zip of the release is available at the bottom of this post.
This release is for X-Cart 4.0.x and 4.1.x

A .htaccess file is included, it is recommended that you open the .htaccess file and COPY the contents into your existing .htaccess file.
Additionally, a default robots.txt has been included. The robots.txt file should be used with discretion and modified as needed for your own website.

Any incoming product/manufacturer/category links are properly 301 redirected to their html alias, so any existing pagerank should be transferred properly.

-------------
This project was started around April of 2006, grew into a sizeable modification that had several bugs due to the complexity of the code, and then lay dormant until recently. Xuru sparked new interest in the project by releasing a copy of the original XC SEO code with a few fixes included. Then geckoday released a stripped down and rewritten version of the XC SEO mod.

Due to the issues that still existed with the original code, I decided to use geckoday's rewritten code as a base. After several feature additions, and after testing the code on a production website with positive results, I'm proud to announce the first public release of XC SEO Lite.
-------------

XC SEO Lite functions similarly to DSEFU, in that it requires 0 template edits, and writes all Product/Manufacturer/Category urls to .html page aliases: sitename.com/categoryname.html

In the near future, I intend to release an XC SEO Advanced version that will function similar to the original XC SEO release (and similar to CDSEO), with the ability to rewrite urls using categories as folders: sitename.com/category1/category2/productname.html

--------------

Quote:
CHANGELOG

XC SEO Lite 1.0.0 (rev 6 - September 20, 2006)
====================================

* Replaced original XC SEO code with geckoday's rewritten code (rewrite of outputfilter & htaccess, he had dropped all other code/files)
* Altered code to replace accented characters with non-accented equivalent
* Added support for rewriting 'printable=Y' urls
* Added support for rewriting 'sort' & 'sort_direction' urls
* Added seo.php to rewrite/redirect category/product/manufacturer urls to new HTML alias
* Added ability to inject user-specified keyword into urls
* Added IF condition that turns off the mod under HTTPS urls
* Added conditional support for SEO mod in Froogle module
* Added default robots.txt
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote
  #2  
Old 04-26-2006, 01:43 PM
 
intel352 intel352 is offline
 

X-Wizard
  
Join Date: Dec 2005
Posts: 1,071
 

Default

Patching X-Cart for the SEO mod:

open config.php:
Find
Code:
@include_once($xcart_dir."/config.local.php");

After, Add
Code:
############################################################ # SEO Optimization Mod by intel352 ############################################################ $seo_enable = true; // enabling the seo url optimizer $seo_bot_lofi = false; // enabling lofi mode for bots (not certain of effects yet) # END SEO

Open auth.php:
Find
Code:
include_once $xcart_dir."/config.php";

After, Add
Code:
############################################################ # SEO Optimization Mod by intel352 ############################################################ if($seo_enable) include_once $xcart_dir."/seo.php"; # END SEO

open smarty.php:
Find
Code:
$smarty->debug_tpl="file:debug_templates.tpl";

After, Add
Code:
############################################################ # SEO Optimization Mod by intel352 ############################################################ # # Output Filters # if(AREA_TYPE=='C' && $seo_enable) $smarty->load_filter('output','seo'); # END SEO

Open skin1_original/meta.tpl:
Find
Code:
{assign var="_meta_keywords" value="$_meta_keywords`$config.SEO.meta_keywords`"} <META name="description" content="{$_meta_descr|truncate:"500":"...":false|replace:'"':"'"}"> <META name="keywords" content="{$_meta_keywords|truncate:"500":"":false|replace:'"':"'"}">

After, Add
Code:
{if $is_robot and $lofi_mode} <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"> <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> <META NAME="ROBOTS" CONTENT="INDEX,FOLLOW,NOARCHIVE"> <META NAME="GOOGLEBOT" CONTENT="NOARCHIVE"> {/if}


Froogle SEO mod - this modification is optional:

open modules/Froogle/froogle.php:
Find
Code:
if ( !defined('XCART_SESSION_START') ) { header("Location: ../../"); die("Access denied"); }

After, Add
Code:
############################################################ # SEO Optimization Mod by intel352 ############################################################ # # Output Filters # if($seo_enable && !is_object($seo)){ include_once( $xcart_dir.'/include/class.xcart_seo.php' ); $seo = new XCart_SEO; } # END SEO

Find
Code:
# Define product category path $cats = array(); $catids = explode("/", $product['categoryid_path']);

After, Add
Code:
$seo->forceProductsArr($product['productid'], $product['product'], end($catids));

Find
Code:
$tmbn = $http_location."/image.php?productid=".$product['productid'];

Replace With
Code:
$tmbn = $seo->createProductUrl($product['productid'],$http_location);

Find
Code:
$post = $http_location.constant("DIR_CUSTOMER")."/product.php?productid=".$product['productid']."\t".

Replace With
Code:
$product_uri = $seo->createProductUrl($product['productid'],$http_location.constant("DIR_CUSTOMER")); $post = $product_uri."\t".

Save and Close all files.

############################

IMPORTANT: if you already have a .htaccess file on your server, you need to (selectively) add in the changes, from the provided .htaccess file.

Download the zip file linked in the first post, extract the contents to your harddrive, and upload:
.htaccess -> xcart root
seo.php -> xcart root
include/class.xcart_seo.php -> include/
include/templater/plugins/outputfilter.seo.php -> include/templater/plugins/

Done
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote
  #3  
Old 04-27-2006, 06:15 AM
 
intel352 intel352 is offline
 

X-Wizard
  
Join Date: Dec 2005
Posts: 1,071
 

Default

ToDo:
  • add Froogle compatibility - DONE
  • fix relative urls - DONE
  • create SEO urls for static pages & help pages
  • alter product and category urls to make sure they are accessible from *1* url only. this means the url being visited will need to be verified as the proper url, if not, 301 redirect to the proper url - DONE
  • add Alt text to urls that don't have it, for better keywords in site content
  • implement filter for Stopwords
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote
  #4  
Old 04-27-2006, 09:34 AM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default

Can you add to the "to do" list.

Intergrate with froogle feed generator.

Its a must for any type of mod like this.

I know the mod is generally for your client and i've got no right to ask but it would be cool
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
  #5  
Old 04-27-2006, 09:37 AM
 
intel352 intel352 is offline
 

X-Wizard
  
Join Date: Dec 2005
Posts: 1,071
 

Default

sure, that was actually one of my intentions, but I had forgotten

thanks for reminding me (btw, this is an in-house project for my corporate employer, but any improvements that are suggested are welcome, because they will benefit us as much as you )


I'll edit the post above with the ToDo. just a note, I've now fixed relative urls, and the mod is working VERY nicely in testing (also had to fix any FORM urls, since they are all relative as well). i'll post the updated files soon
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote
  #6  
Old 04-27-2006, 10:23 AM
 
intel352 intel352 is offline
 

X-Wizard
  
Join Date: Dec 2005
Posts: 1,071
 

Default

SEO MOD UPDATED - to version 0.2
  • fixed relative urls
  • rewrote home.php to home.html
  • added rules into .htaccess to set directory index to home.html

Note: the .htaccess file that I use is now included in the zip archive. Do not upload blindly. If you already have a .htaccess file, you'll need to merge in my changes.
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote
  #7  
Old 04-27-2006, 10:47 AM
 
intel352 intel352 is offline
 

X-Wizard
  
Join Date: Dec 2005
Posts: 1,071
 

Default

Quote:
Originally Posted by cotc2001
Can you add to the "to do" list.

Intergrate with froogle feed generator.

Its a must for any type of mod like this.

I know the mod is generally for your client and i've got no right to ask but it would be cool

Just a note, old urls are directed to the new url location, so this mod wouldn't break .php links. So, you won't lose any froogle compatibility, per se.

Anywho, I'm working on implementing Froogle-module urls right now
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote
  #8  
Old 04-27-2006, 01:10 PM
 
intel352 intel352 is offline
 

X-Wizard
  
Join Date: Dec 2005
Posts: 1,071
 

Default

SEO MOD UPDATED - to version 0.3
  • Fixed a random bug affecting Category urls
  • Added Froogle support! (and added a new patch file for the Froogle mod)

EDIT: Once you install the SEO mod, you must Export the Froogle txt file for the SEO urls to be created in the export.

The install instructions have been updated, please read! (2nd post)

Cheers!
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote
  #9  
Old 04-29-2006, 03:54 AM
  Megamuch's Avatar 
Megamuch Megamuch is offline
 

Member
  
Join Date: Feb 2006
Location: Barcelona
Posts: 28
 

Default

I'm trying to apply this mod to default 4.1 install.

I'm getting there. The category urls are working, just redirecting is not working actually. I just get kicked back to home.php.

Product urls are fubar, which is strange because the url system was not updated between 4.0.18 and 4.1 (To my knowledge).

I'll see what I can make of it.
__________________
X-cart 4.0.17 Pro

Visiting Barcelona? Visit www.bcn-nightlife.com
Reply With Quote
  #10  
Old 04-29-2006, 06:23 AM
 
intel352 intel352 is offline
 

X-Wizard
  
Join Date: Dec 2005
Posts: 1,071
 

Default

keep in mind, the project is still not recommended for a live website, i found a bug the other day that requires a rewrite of some of the url-matching code.

i haven't tested on 4.1 yet, i'll have to test it to see what's going wrong
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:46 AM.

   

 
X-Cart forums © 2001-2020