X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   free SEO mod - XC SEO -> needs testing & feedback (https://forum.x-cart.com/showthread.php?t=21383)

intel352 04-26-2006 01:24 PM

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



intel352 04-26-2006 01:43 PM

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

intel352 04-27-2006 06:15 AM

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

cotc2001 04-27-2006 09:34 AM

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

intel352 04-27-2006 09:37 AM

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

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

intel352 04-27-2006 10:23 AM

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.

intel352 04-27-2006 10:47 AM

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 :-)

intel352 04-27-2006 01:10 PM

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!

Megamuch 04-29-2006 03:54 AM

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.

intel352 04-29-2006 06:23 AM

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

fhiremark 04-30-2006 05:12 PM

I have to commend you on what you're doing. I think this is a great mod, though I haven't tried it yet. Good job! and I think the community is really going to appreciate this too!

Thanks

intel352 05-01-2006 08:48 AM

thanks, I appreciate it ;-)

it'll be nice to get the code stable and tested. We're starting up a domain with this code soon and will submit it to google, to see how the shop will rank. It'll have the same products as a well-established shop that we have, running X-Cart 3.4, so that'll provide a decent benchmark.

leagcyteam2 05-01-2006 11:11 AM

Please keep us posted how your new site ranks....

Jerrad 05-01-2006 03:01 PM

I also appreciate all your hard work, intel352! :D
I'm really looking forward to your mod and hope you succeed in getting the code stable and bug free.

intel352 05-02-2006 11:01 AM

Thanks guys, I'll be sure to keep this thread updated with any and all progress regarding the mod and live-environment testing :-)

OKAY - time for a new release:

SEO MOD UPDATED - to version 0.5
  • Rewrote URL matching technique for better accuracy
  • Added URL verification, to ensure content is accessed by a single url ONLY. If an 'alternate' url is used, or a misstyped url, the SEO mod does it's best to redirect users to the correct URL, or return a 404 error if the url is not salvageable. For products, as long as the _p1234.html bit is found in the url, the proper url can be found. For categories, using Fuzzy String Matching technology, the closest match to a category will be selected.
  • Added 'lo-fi' option, when a bot visits, it is shown a version of the site with most HTML removed, all Javascript removed, most non-relevant images removed, etc. This version is flagged as NON-cacheable to proxies, browsers, and bots, so anything seen as a bot will get this non-cacheable low-end version of your site. This is OPTIONAL, and defaults to OFF.


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

Cheers!

intel352 05-02-2006 12:47 PM

Quote:

Originally Posted by Megamuch
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.


I've just tried to install 4.1, it gets to step 9 and hangs. I can't test 4.1.0 if I can't install it, so I recommend you stick to 4.0.x when using this mod

cotc2001 05-02-2006 12:56 PM

can you just clarify something for me before i start having a go with this mod.

Quote:

$seo_enable = true; // enabling the seo url optimizer

in the install instructions, does this section mean i can just turn it on and off from here so that if something goes wrong - one change will revert it back to normal?

intel352 05-02-2006 01:04 PM

that's correct, that one setting will completely disable the mod :-)

cotc2001 05-02-2006 01:24 PM

What also might be handy is to add lynx browser to one of the recognised engines so we can see whats getting stripped out on the lo fi version.

or for those who don't use lynx

http://www.delorie.com/web/lynxview.html

intel352 05-02-2006 01:30 PM

Quote:

Originally Posted by cotc2001
What also might be handy is to add lynx browser to one of the recognised engines so we can see whats getting stripped out on the lo fi version.


The mod depends on X-Cart's definition of what a bot is. you can edit the include/bots.php file to add Lynx

Try the following:

open include/bots.php

Find
Code:

if(!empty($HTTP_USER_AGENT) && !defined("IS_ROBOT") && empty($is_robot)) {
        $ua = array(


After, Add
Code:

                "Lynx" => array("Lynx"),


EDIT: just a note, that change worked for me, using the url you provided.

Another note, the lo-fi mode is not meant to be pretty, and is not meant to be viewed by a regular browser. This is just an attempt to strip down to bare HTML + Content, if you have any recommendations regarding this mode, let me know.

In my own testing, only product images are left (as is intended), as they are the only images that have alt values (again, on my install).

It's possible for you to alter what is stripped out in Lo-Fi mode (requires editing of the outputfilter.seo.php file, if I remember correctly)

intel352 05-02-2006 01:36 PM

One note about the 0.5 release:

404 Errors that are kicked out by the SEO mod are currently just a blank white screen with a short message saying the page does not exist. This will be changed in the next release to a setting that you can point to your own 404 error page of choice (and will default to a prettier error message).

intel352 05-03-2006 08:22 AM

I apologize, somewhere in the process I failed to add this step to the install instructions (I'll update the install instructions after I post this step here):

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


intel352 05-04-2006 05:22 AM

I found out what was preventing me from installing 4.1.0, so I've now got a working copy of 4.1.0 installed on my server, and I've successfully installed XC SEO (with minor modifications).

I'm still testing though. I'm working on adding products to the installation so that I can verify product urls are being parsed correctly.

TA 05-04-2006 06:30 AM

How well is this working on 4.0 now? I'm getting a little anxious. :lol: I changed over from an html store to XCart about a month ago and my rankings are suffering.

Thank you Intel for your efforts!

TelaFirma 05-04-2006 06:58 AM

Well, it looks like this might not be compatible with PHP 5.0.x

Quote:

Fatal error: Call to a member function addProducts() on a non-object in XXXXX\htdocs\include\templater\plugins\outputfilte r.seo.php on line 13

intel352 05-04-2006 07:02 AM

telafirma, read through the install instructions once more to make sure you've done everything as detailed. there was a step that had been missing from the install details, that i added in yesterday. seems like the class object isn't being created

or if you'd like me to look at it, i could try to get it working for you. i don't have a php5 dev environment at the moment, so i can't verify whether or not it works under php5 until later

TelaFirma 05-04-2006 07:58 AM

Works now - was missing the part in the auth.php file.

Something that might need to be addresses is the variables that are added after the .html extention or directory names:

designing-web-usability_p67.html?cat=23&page=1
lord-of-the-rings-board-game_p93.html?cat=0&bestseller
books/internet/?sort=price&sort_direction=0

still very indicative of dynamically generated pages and will still create the situation of two URIs pointing to the same content.

jackel 05-10-2006 03:47 AM

Hi all,

Can't seem to get this mod working on X-Cart 4.0.13? any help appreciated, cheers.

syddos 05-10-2006 04:46 AM

Quote:

Originally Posted by jackel
Hi all,

Can't seem to get this mod working on X-Cart 4.0.13? any help appreciated, cheers.


Read the first post, the first 2 lines may explain your problems.

intel352 05-10-2006 04:58 AM

Quote:

Originally Posted by TelaFirma
Something that might need to be addresses is the variables that are added after the .html extention or directory names:

designing-web-usability_p67.html?cat=23&page=1
lord-of-the-rings-board-game_p93.html?cat=0&bestseller
books/internet/?sort=price&sort_direction=0

still very indicative of dynamically generated pages and will still create the situation of two URIs pointing to the same content.


do you have any suggestions regarding how the variables could be hidden? I could easily strip them from the url, but there are some situations where the variables would be needed, such as sorting.

one note, the sort directives actually return pages with different content, since they sort the results in a different manner, so there's no content duplication there. the product pages definitely need the variables handled though...

hmm...

intel352 05-10-2006 05:00 AM

Quote:

Originally Posted by jackel
Hi all,

Can't seem to get this mod working on X-Cart 4.0.13? any help appreciated, cheers.


if you would like me to attempt to troubleshoot the install problem, PM me your FTP login information. otherwise, I would recommend upgrading to 4.0.18

I'll be releasing another update within the next week, fixes a few more possible issues, and adds support for 4.1.0 :-)

jackel 05-10-2006 06:45 AM

Cool,

yes upgrading is something I am looking to do. I am currently in a transition between a web agency who did some work et al NOT A LOT THEY DONE WAS RIGHT! so I have to pick it up and get the rest of the development done.

I am missing a massive portion of menus in the administration site as well but that's another matter.

Many thanks for the reply, unfortunately due to the nature of the security on-site I can't give out ftp details etc :( but i will be able to post our SRC if that is appropriate?

Cheers,

Mark
Jackel International Limited

intel352 05-10-2006 07:26 AM

Security limitations understandable, I don't post FTP info for my employer's sites either.

Tell me this, is your installation highly customized? Did you have any trouble applying the modifications required to install the XC SEO mod? (from the 2nd post of this thread)

intel352 05-10-2006 07:38 AM

Quote:

Originally Posted by cotc2001
What also might be handy is to add lynx browser to one of the recognised engines so we can see whats getting stripped out on the lo fi version.

or for those who don't use lynx

http://www.delorie.com/web/lynxview.html


You can also install Lynx on Win2k/XP
http://csant.info/downloads/lynx_setup-2.8.5rel-1.zip

That download comes from this page (but isn't obvious, so I posted the direct file link):
http://csant.info/lynx.htm

cotc2001 05-10-2006 07:55 AM

Yeah I looked at that download, could never work out how to use it though :D

intel352 05-10-2006 07:56 AM

Quote:

Originally Posted by cotc2001
Yeah I looked at that download, could never work out how to use it though :D


install, doublclick the icon on desktop, hit "g" to get a URL prompt, type a url, press enter to go ;-)

use arrows to navigate (left = back, right = forward/go, up = up, down = down, enter = go)

cotc2001 05-10-2006 08:01 AM

LOL!!! errr ok so im a dimwit :D

jackel 05-11-2006 12:27 AM

intel.... basically it looks to be X-Cart 4.0.13 and no massive mods, however the company involved in the development are keeping quite quiet about changes and additions made.

I have noticed in the Admin section many of the options such as patch / upgrade , modules are all missing.

Can anyone provide any reasons as to what may cause the admin panels to be messed up, I've also re-uploaded fresh (original) files for the administration area and it has made no difference, even as far as to run the cleanup.php to remove cached template files.

intel352 05-11-2006 04:56 AM

that's quite unusual... hmm...

I'd either open a new thread about that issue or send a support request to the X-Cart devs

fhiremark 05-11-2006 12:00 PM

I finally got the chance to install this mod and I'm very happy with it. The installation was very easy by following the 2nd post on this thread, and I had no problems at all.

The category links were very clean, and the mod even took care of all those "&" special characters by replacing them with "and" --That made me smile =) The product links were a little long, and towards the end started looking funny, but I can live with that. Lastly, I also liked the fact that the links used "-" instead of "_".

I have a couple of questions though:

1) I saw mentioned in this thread an issue about duplicate content, and I'm wondering if this mod addresses that issue, or if it will sometime down the road.

2) I'm not sure if this has anything to do with the mod, but it almost feels as if the site slows down by a second or so. -- I don't know if others are having this issue, or it's just me, but I just wanted to throw it out there.

3) I haven't played around with froogle yet because I'm afraid I'll screw up something, but is the froogle option on this mod working properly?

4) Is it safe to go live with this mod? I'm probably going live this monday and it'll be a big plus if I can safely implement this.

Overall, this is a great mod intel --Thanks!


All times are GMT -8. The time now is 01:23 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.