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)
-   -   XC SEO Lite v1.0.0 Released (https://forum.x-cart.com/showthread.php?t=25106)

intel352 09-20-2006 09:32 AM

XC SEO Lite v1.0.6 Released
 
1 Attachment(s)
XC SEO v1.1.0 has been released, new thread has been opened.

XC SEO v1.1.0

XC SEO Lite v1.0.6 will stay attached to this thread for historical purposes.

================================================== ============================
The XC SEO team is proud to announce the release of XC SEO Lite version 1.0.6.
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

==============================
Sites using XC SEO Lite:==============================


When using the provided .htaccess file, please be aware of the RewriteBase directive, and change as needed.
Additionally, the catalog/ directory has a .htaccess file for redirecting catalog-generated urls, edit this as well if needed


EDIT: Replaced 1.0.5 release with 1.0.6, feature add

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/pages 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/Static Page 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.6 (rev 24 - September 22, 2006)
====================================

* Fixed/updated all Install documentation as needed, fixed Froogle portion of 4.1.3 install
* Updated seo.php to 301-redirect bots to remove X-Cart session ids from the url

XC SEO Lite 1.0.5 (rev 23 - September 21, 2006)
====================================

* Cleaned up disallowed urls in robots.txt
* Added support for product urls to include "cat" & "page", for products associated with multiple categories.
* Added redirect code for product + cat + page urls for bots.
* Added comments to RewriteBase directive

XC SEO Lite 1.0.4 (rev 15 - September 21, 2006)
====================================

* Bugfix: outputfilter.seo.php: Had used stripos instead of strpos (stripos is a PHP 5 function)

XC SEO Lite 1.0.3 (rev 14 - September 21, 2006)
====================================

* Bugfix - .htaccess: Added missing rules to htaccess file for Manufacturer sort ability
* Bugfix - seo.php: Removed unneeded require statement
* Added catalog/.htaccess file for rewriting catalog urls to the x-cart dynamic urls
* Moved some common code into a new function in the outputfilter
* Added auto-insertion of the TITLE tag into href structures
* Added rewrite support for Static Pages

XC SEO Lite 1.0.2 (rev 10 - September 20, 2006)
====================================

* Bugfix - seo.php: Moved $seo_qs inside IF statement so it is not processed needlessly (causes errors otherwise)
* Added Install docs for 4.1.3 - Modification instructions changed for Froogle in X-Cart 4.1.3
* Added support for IS_ROBOT define in X-Cart, so that Bots are unable to see/visit Printable or Sorted urls

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


Jayk 09-20-2006 09:49 AM

Re: XC SEO Lite v1.0.0 Released
 
Glad to see the release. Good work guys.

Cheers,
Jason

intel352 09-20-2006 10:00 AM

Re: XC SEO Lite v1.0.0 Released
 
Thanks :-)

An additional note, if users allow search engines to visit the Printable & Sort urls, there may be penalization for duplicate content. That fact is true whether you have XC SEO installed or not.

If users want to avoid any possibility of duplicate content, please disable the Printable option in X-Cart, and disable Sorting.

Jerrad 09-20-2006 10:01 AM

Re: XC SEO Lite v1.0.0 Released
 
Thanks for this great mod!
Unfortunatly I'm getting these two error messages...

Code:


Warning: Invalid argument supplied for foreach() in /home/leukstewinkel.nl/public_html/shop/seo.php on line 23

Warning: implode(): Bad arguments. in /home/leukstewinkel.nl/public_html/shop/seo.php on line 26


Any idea what's causing this (besides me...)?
Thanks again!

intel352 09-20-2006 10:16 AM

Re: XC SEO Lite v1.0.0 Released
 
1 Attachment(s)
Try the following seo.php

I moved a bit of the code inside an IF statement, so that should get rid of the error for you.

EDIT: btw, I apologize for that, and thanks for the catch. I had forgotten that I had disabled error display on my test site. :-X

EDIT 2: Original archive has been replaced with v1.0.1 in the first post, only change is the fix for seo.php

Jerrad 09-20-2006 10:32 AM

Re: XC SEO Lite v1.0.0 Released
 
Thanks intel, that did it!
Mod works great now - thanks again!

I only have some questions abot the robots.txt...

My store is in the directory /shop
Should I change the text as below?

User-agent: *
Disallow: /shop/cgi-bin/
Disallow: /shop/*?
Disallow: /shop/catalog/
Disallow: /shop/search.php
Disallow: /shop/cart.php
etc. etc.

And will the User-agent: * do for all the bots or is it better to go sure and do
several 'disallow listings' for the major searchbots (like google and msn)?

And last question...
Is it possible with the robots.txt to stop search engines to visit the Printable & Sort urls ?

Thanks again!

intel352 09-20-2006 10:35 AM

Re: XC SEO Lite v1.0.0 Released
 
The point of specifying individual bots is only to customize the Disallow rules per robot, so you should customize the robots.txt as you feel best :-)

Additionally, regarding the subfolder location of your site, you will need to place the robots.txt in your site root, and then prepend the /shop path, as you already mentioned.

Here's a couple of helpful URLs regarding robots.txt:
http://www.freefind.com/library/howto/robots/
http://javascriptkit.com/howto/robots.shtml

Jerrad 09-20-2006 10:56 AM

Re: XC SEO Lite v1.0.0 Released
 
Thanks for the quick replies, intel!

Any suggestions how to stop searchbots visiting the Printable & Sort urls?

Jayk 09-20-2006 11:00 AM

Re: XC SEO Lite v1.0.0 Released
 
I'm just finishing up editing my .php files and ran into a discrepency in froogle.php.

I'm running 4.1.3 and my froogle.php is a little different than the one in the INSTALL4.1x file. The code in my froogle.php is:

Code:

# Post string
$post = func_froogle_convert($product['product'], 80)."\t".
        func_froogle_convert($product['descr'], 65536)."\t".
        $http_location.constant("DIR_CUSTOMER")."/product.php?productid=".$product['productid']."\t".
        $tmbn."\t".
        $product['productid']."\t".
        func_froogle_convert($keywords, 65536)."\t".
        number_format(round($product['price'], 2), 2, ".", "")."\t".
        (empty($config['Froogle']['froogle_currency']) ? "USD" : $config['Froogle']['froogle_currency'])."\t".
        func_froogle_convert($config['Froogle']['froogle_payment_accepted'], 65536)."\t".
        func_froogle_convert($config['Froogle']['froogle_payment_notes'], 65536)."\t".
        $product['avail']."\t".
        func_froogle_convert($product['manufacturer'], 80)."\t".
        $product['manufacturerid']."\t".
        $product['weight']."\t".
        date("Y-m-d", time()+(empty($config['Froogle']['froogle_expiration_date']) ? 0.5 : $config['Froogle']['froogle_expiration_date'])*86400);


I'm not sure which code to replace or if the seo code is not quite up to date for 4.1.3.

Thanks,
Jason

intel352 09-20-2006 11:06 AM

Re: XC SEO Lite v1.0.0 Released
 
Here you go:

Code:

-----------
Find Code:
-----------

                        # Post string
                        $post = func_froogle_convert($product['product'], 80)."\t".
                                func_froogle_convert($product['descr'], 65536)."\t".
                                $http_location.constant("DIR_CUSTOMER")."/product.php?productid=".$product['productid']."\t".
                                $tmbn."\t".

------------
Replace With
------------

                        # Post string
                        if ($seo_enable){
                                # Build SEO URL
                                $prod_url = $seo->_product_filename($product['productid'], $product['product']);

                                $post = func_froogle_convert($product['product'], 80)."\t".
                                        func_froogle_convert($product['descr'], 65536)."\t".
                                        $http_location.constant("DIR_CUSTOMER")."/".$prod_url."\t";
                        }else{
                                $post = func_froogle_convert($product['product'], 80)."\t".
                                        func_froogle_convert($product['descr'], 65536)."\t".
                                        $http_location.constant("DIR_CUSTOMER")."/product.php?productid=".$product['productid']."\t".
                        }
                        $post .= $tmbn."\t".


intel352 09-20-2006 11:21 AM

Re: XC SEO Lite v1.0.0 Released
 
Quote:

Originally Posted by Jerrad
Thanks for the quick replies, intel!

Any suggestions how to stop searchbots visiting the Printable & Sort urls?


I'm not sure what would be the best approach. It's possible to alter seo.php to check if the user-agent was identified by X-Cart as a bot, and if so, do a 301-redirect to the non-print, non-sort alias.

I'll have an update for you today or tomorrow :-)

Jerrad 09-20-2006 11:23 AM

Re: XC SEO Lite v1.0.0 Released
 
Quote:

Originally Posted by intel352
I'm not sure what would be the best approach. It's possible to alter seo.php to check if the user-agent was identified by X-Cart as a bot, and if so, do a 301-redirect to the non-print, non-sort alias.

I'll have an update for you today or tomorrow :-)


Looking forward to that update.
Many thanks for all of your hard work, intel!

intel352 09-20-2006 12:20 PM

Re: XC SEO Lite v1.0.0 Released
 
v1.0.2 added, outputfilter now does NOT add the printable/sort bits to the url for Bots, and seo.php will redirect a bot that is trying to visit a printable/sort URL (for categories, manufacturers, products, other areas of x-cart are still not yet supported)

Jayk 09-20-2006 12:42 PM

Re: XC SEO Lite v1.0.0 Released
 
Some of my pages are already indexed by Google, etc. The old links listed are not redirecting to the new SEO-friendly ones for some reason. If I use an old link, I get a blank page (viewing page source reveals no html code whatsoever).

This one for example:

http://www.jbox.ca/product.php?productid=12&cat=0&page=1

Cheers,
Jason

intel352 09-20-2006 12:44 PM

Re: XC SEO Lite v1.0.0 Released
 
which version are you using? 1.0.0, 1.0.1, or 1.0.2? :-D (lol, been too busy on this mod today)

Additionally, make sure error reporting is enabled or check error logs so we can find out what's breaking.

Jayk 09-20-2006 12:53 PM

Re: XC SEO Lite v1.0.0 Released
 
Installed from 1.0.1, updated seo.php and include/templater/plugins/outputfilter.seo.php to 1.0.2. How do you enable error reporting, or is this a server php configuration setting?

Thanks,
Jason

intel352 09-20-2006 12:54 PM

Re: XC SEO Lite v1.0.0 Released
 
config.php, search for "debug", make sure reporting level is set to 3 for right now, so that it's echoed out and recorded in your error logs. once we're done debugging, set it back down to a hidden level (logs only)

additionally, you can check error logs by looking in var/logs/ and search for errors_php (something like that). look for the newest dated file, should be today's date.

Jayk 09-20-2006 01:14 PM

Re: XC SEO Lite v1.0.0 Released
 
My reporting level was already set for 3. Today's var/log/x-errors_php file contains no errors. Not sure what's going on.

Cheers,
Jason

intel352 09-20-2006 01:32 PM

Re: XC SEO Lite v1.0.0 Released
 
Check your PM inbox. Since it's 5:30 EST, I won't be able to work on this any more tonight (gotta head home, no net connection at the house currently), but keep me updated regarding if you're able to find anything else out.

Additionally, I found that the .htaccess file is missing a couple of rules regarding Manufacturer pages (for Sorting), the .htaccess file has been updated in the repository, but I haven't been able to package a new release yet.

Here's the .htaccess file via the repository:
http://x-cart-seo.googlecode.com/svn/trunk/.htaccess

Jerrad 09-20-2006 02:05 PM

Re: XC SEO Lite v1.0.0 Released
 
Thanks for the quick update!
And I wouldn't know what to do with my life without a net connection at the house... :)

intel352 09-21-2006 04:38 AM

Re: XC SEO Lite v1.0.0 Released
 
I took the code home with me, made quite a few changes :-)

* Found 1 more issue with Manufacturer htaccess rules, fixed that
* Added rewrite for catalog urls to the normal url structure
* Added TITLE tag insertion into href structures (for all rewritten urls)
* Added Static Page rewrite support

I'm going to debug jayk's issues, and then I'll issue a new release ;-)

intel352 09-21-2006 05:28 AM

Re: XC SEO Lite v1.0.0 Released
 
Okay, I've uploaded a new release, v1.0.4

When using the provided .htaccess file, please be aware of the RewriteBase directive, and change as needed.
Additionally, the catalog/ directory has a .htaccess file for redirecting catalog-generated urls, edit this as well


Changelog:

Quote:

XC SEO Lite 1.0.4 (rev 15 - September 21, 2006)
====================================

* Bugfix: outputfilter.seo.php: Had used stripos instead of strpos (stripos is a PHP 5 function)

XC SEO Lite 1.0.3 (rev 14 - September 21, 2006)
====================================

* Bugfix - .htaccess: Added missing rules to htaccess file for Manufacturer sort ability
* Bugfix - seo.php: Removed unneeded require statement
* Added catalog/.htaccess file for rewriting catalog urls to the x-cart dynamic urls
* Moved some common code into a new function in the outputfilter
* Added auto-insertion of the TITLE tag into href structures
* Added rewrite support for Static Pages

XC SEO Lite 1.0.2 (rev 10 - September 20, 2006)
====================================

* Bugfix - seo.php: Moved $seo_qs inside IF statement so it is not processed needlessly (causes errors otherwise)
* Added Install docs for 4.1.3 - Modification instructions changed for Froogle in X-Cart 4.1.3
* Added support for IS_ROBOT define in X-Cart, so that Bots are unable to see/visit Printable or Sorted urls

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

UPDATED: regarding 1.0.4 release

intel352 09-21-2006 06:05 AM

Re: XC SEO Lite v1.0.0 Released
 
I've updated the robots.txt file in SVN, the updated file will be in the next release.

Contents are below, I suggest everyone using XC SEO apply this changed robots.txt file:

Code:

User-agent: *
Disallow: /cgi-bin/
Disallow: /search.php
Disallow: /cart.php
Disallow: /giftcert.php
Disallow: /orders.php
Disallow: /register.php
Disallow: /icon.php
Disallow: /image.php
Disallow: /error_message.php
Disallow: /offers.php
Disallow: /product_image.php
Disallow: /shop_closed.html


Jerrad 09-21-2006 06:45 AM

Re: XC SEO Lite v1.0.0 Released
 
Quote:

Originally Posted by intel352
new release, v1.0.4

When using the provided .htaccess file, please be aware of the RewriteBase directive, and change as needed.



Thanks for the new release!
Where exactly in the .htaccess file should I change the above?

intel352 09-21-2006 06:48 AM

Re: XC SEO Lite v1.0.0 Released
 
In each .htaccess file, there is a line that says:
RewriteBase /

Read the comments above this line, and edit as needed.
The best way to find out if you have configured your htaccess file correctly, is to test your site and make sure it functions properly :-)

If you installed x-cart into your site root (/), then you shouldn't need to edit anything. If you installed into a subfolder (/shop), then rewritebase needs to be edited

EDIT: Again, if your site is working fine, you don't need to mess with the .htaccess file

Jerrad 09-21-2006 07:06 AM

Re: XC SEO Lite v1.0.0 Released
 
I've changed RewriteBase / into the subfolder where I have x-cart installed.
But the site also functions properly if I leave the RewriteBase / as it was...

intel352 09-21-2006 07:15 AM

Re: XC SEO Lite v1.0.0 Released
 
Quote:

Originally Posted by Jerrad
I've changed RewriteBase / into the subfolder where I have x-cart installed.
But the site also functions properly if I leave the RewriteBase / as it was...


Okay, as long as it works for you :-)

Here are the docs on RewriteBase:
http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html#RewriteBase

JeremyL 09-21-2006 09:14 AM

Re: XC SEO Lite v1.0.0 Released
 
Quote:

Originally Posted by Jerrad
I've changed RewriteBase / into the subfolder where I have x-cart installed.
But the site also functions properly if I leave the RewriteBase / as it was...


I think the base is used to prevent conflicts of /shop/my-categotry.html (dynamic url) and /my-category.html (actual html in base dir) from happening.

intel352 09-21-2006 09:26 AM

Re: XC SEO Lite v1.0.0 Released
 
I'll end up putting a nice informative comment such as the following in the .htaccess file. Should take care of any questions

Quote:

Originally Posted by VBSeo Forums
# Some servers require the Rewritebase directive to be
# enabled (remove '#' at the beginning to activate)
# Please note: when enabled, you must include the path
# to your root vBulletin folder (i.e. RewriteBase /forums)
#RewriteBase /


intel352 09-21-2006 12:53 PM

Re: XC SEO Lite v1.0.0 Released
 
XC SEO Lite v1.0.5 released

Quote:

CHANGELOG

XC SEO Lite 1.0.5 (rev 23 - September 21, 2006)
====================================

* Cleaned up disallowed urls in robots.txt
* Added support for product urls to include "cat" & "page", for products associated with multiple categories.
* Added redirect code for product + cat + page urls for bots.
* Added comments to RewriteBase directive

Jerrad 09-21-2006 01:02 PM

Re: XC SEO Lite v1.0.0 Released
 
Thanks for the update (and your patience with me...).
The new release works awesome!

Jayk 09-21-2006 05:20 PM

Re: XC SEO Lite v1.0.0 Released
 
Mod's working great except for Froogle on 4.1.3. I am getting:

Code:

Parse error: parse error, unexpected '}' in modules/Froogle/froogle.php on line 249

When I try to access the Froogle Export Module.

I can provide my froogle.php file if you would like.

Cheers,
Jason

chrischall 09-22-2006 01:12 AM

Re: XC SEO Lite v1.0.0 Released
 
Hi,

Great mod installed in minutes and seems to work perfectly :-) Thanks for developing.

I have a quick query about this addition to 1.0.5
* Added support for product urls to include "cat" & "page", for products associated with multiple categories.

I would have thought that this may get your penalized for duplicate content as you could not have two or more differently named pages with duplicate content.

Would it be possible to have the mod with just the product-name-p-102.html as then if it appeared in multiple categories it would just be like multiple pages in a site linking to one single page?

intel352 09-22-2006 05:13 AM

Re: XC SEO Lite v1.0.0 Released
 
@chris: I understand your concern, which is why 1.0.5 also has this change:
Quote:

* Added redirect code for product + cat + page urls for bots.

Any situation that I have been able to identify as a possibility for duplicate content, I block bots from accessing that content. When a bot is identified, any link that would normally have a PRINT, SORT, or in the case of products, CAT + PAGE variables, is displayed to the bot without those additional variables.

This means the bot only sees links to a single page instead of multiple different ways to access that page.

Additionally, the file seo.php will redirect bots if they are trying to access a url that could lead to duplicate content. The redirection sends them a 301 redirect to just the plain product url without the extra flags. Same for categories/manufacturers.

Hope that answers your questions :-)

==================================

Jayk, thanks for the bug report, I'll check into it ;-)

intel352 09-22-2006 07:23 AM

Re: XC SEO Lite v1.0.0 Released
 
Okay, XC SEO Lite has been installed on my employer's site since Monday (Sound Choice Store). Google has now picked up 5 urls using the new html aliases.

One thing I noticed though, is that Google is also picking up the session id in the url. The next version of XC SEO Lite, due out later today, will strip the session id out of urls that bots are trying to visit, and do a 301 redirect. Additionally, I should have a fix available for the Froogle module.

intel352 09-22-2006 11:29 AM

Re: XC SEO Lite v1.0.0 Released
 
XC SEO Lite v1.0.6 has been released

Quote:

CHANGELOG

XC SEO Lite 1.0.6 (rev 24 - September 22, 2006)
====================================

* Fixed/updated all Install documentation as needed, fixed Froogle portion of 4.1.3 install
* Updated seo.php to 301-redirect bots to remove X-Cart session ids from the url

Scott DeToffol 09-22-2006 12:19 PM

Re: XC SEO Lite v1.0.0 Released
 
I implemented the mod but I must have missed a step. I updated my .htaccess file in the store root with the data from the one in your zip. I made the changes noted to config.php, auth.php, smarty.php, and froogle.php. I uploaded the included files into /include... and /catalog.

But I'm still geting:
http://www.hellyhansenusa.com/store/product.php?productid=16783&cat=281&page=1

What did I miss?

Jayk 09-22-2006 12:25 PM

Re: XC SEO Lite v1.0.0 Released
 
Quote:

Originally Posted by Scott DeToffol
I implemented the mod but I must have missed a step. I updated my .htaccess file in the store root with the data from the one in your zip. I made the changes noted to config.php, auth.php, smarty.php, and froogle.php. I uploaded the included files into /include... and /catalog.

But I'm still geting:
http://www.hellyhansenusa.com/store/product.php?productid=16783&cat=281&page=1

What did I miss?


This got me the first time too. In config.php you have to set the seo active setting to true.

Cheers,
Jason

Scott DeToffol 09-22-2006 12:28 PM

Re: XC SEO Lite v1.0.0 Released
 
Jason - I just figured that out myself. Thanks, its working!

I guess I should re-do my sitemap.xml now, huh?

This cool, thanks a bunch intel352!

intel352 09-22-2006 12:37 PM

Re: XC SEO Lite v1.0.0 Released
 
:-) glad you got it figured out.

Looks like I'll have to default the instructions to 'true' ;-)


All times are GMT -8. The time now is 07:43 AM.

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