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

[MODULE] XC SEO v1.4.0 Released for X-Cart 4.0 and 4.1
 
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features
 
Thread Tools Search this Thread
  #11  
Old 05-17-2008, 05:31 PM
 
Kip Kip is offline
 

Newbie
  
Join Date: Apr 2007
Posts: 7
 

Default Re: [MODULE] XC SEO v1.4.0 Released for X-Cart 4.0 and 4.1

While I work my way through the install, can you or one of the readers tell me generally how this works, i.e. how it's doing the URL rewriting, aside from the .htaccess?

My concern is that we've done many mod installs and custom hacks all throughout our X-Cart site (me grudgingly, but the clients want what they want). Other mods have you go through a tedious list of line-by-line hacks, which at least has the benefit of showing exactly what's going on in the code so we can adjust if necessary around all the messy hacks we've already done. But I can't quite tell exactly what XC SEO will do during its install.

Is there an assumption that, other than templates and other superficial customizations, the core X-Cart code is more or less the default? Any other kinds of gotchas that I should know about?

In particular, they've already had me hack up a completely custom form of "SEO" URLs, but one that doesn't include actual product names in the URLs. So I'm assuming I will have to back out of that first.
__________________
Version 4.1.6
Reply With Quote
  #12  
Old 05-17-2008, 06:51 PM
 
intel352 intel352 is offline
 

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

Default Re: [MODULE] XC SEO v1.4.0 Released for X-Cart 4.0 and 4.1

Hi Kip, XC SEO was the first X-Cart SEO module to make use of Smarty's output filter functionality (the other SEO modules at the time were tedious manual hacks to template files, php files, etc, to achieve a similar effect, but they have since decided to copy XC SEO's implementation method). Using the output filter means that manual template hacks are not needed. Before the page is output, XC SEO parses each page content for URLs that it recognizes, for Categories, Products, Manufacturers, Static Pages. When any urls are recognized, it automatically replaces each url with it's SEO'd counterpart.

While the install process doesn't require a fully stock installation, it does help to have a stock install, to ensure the patches apply properly. The patch changes only affect PHP files with fairly minor changes per file, so even if you have to manually patch, it's not as tedious as most modules.

While XC SEO replaces the URLs with aliases in the final output page, the .htaccess file will remap clicked alias urls back to their intended target in X-Cart.

The installer itself will insert SQL information that will add XC SEO as a module, you'll then have configuration options that you can change as needed via X-Cart General Settings for XC SEO. Additionally, XC SEO can be easily enabled/disabled as needed.
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote
  #13  
Old 05-20-2008, 07:59 AM
 
CybrMike CybrMike is offline
 

Member
  
Join Date: Dec 2007
Posts: 9
 

Default Re: [MODULE] XC SEO v1.4.0 Released for X-Cart 4.0 and 4.1

Jon,

I've looked at your mod and installed it. One thing that troubled me was the fact that it does a query for every single URL rewrite. Usually the same query over and over again. For example: Select category from xcart_categories WHERE categoryid='505';

To fix this, I simply added a &title= . urlencode(seo_title_of_product_or_category_name) to all of my urls (in appropriate products.tpl (or in my case, products_t.tpl) file, subcategories.tpl, categories.tpl, and a few misc others).

Then, in your code I before the query I added:

Code:
if (!empty($options['title'])){ $options['result_title'] = $options['title']; unset($options['title']); }

I also had to unset title from the _category_callback and _product_callback functions to remove ?title= from the URL:

Code:
function _category_callback($found, $uri_only = false, $title = false) { $options = $this->_check_uri($found[3]); $options['result_title'] = $title; if($options['cat']){ $filename = $this->_category_filename($options); unset($options['title']); $filename .= $this->_query_string_append($options); if($uri_only) return $filename; else return $found[1] . $found[2] . $this->_base_uri . $filename . $f }else{ return $found[0]; } }

This saved about 30 - 50+ queries per page. I am using memcache and it still sped things up significantly.
__________________
xCart GOLD V 4.1.9
Reply With Quote
  #14  
Old 05-20-2008, 09:07 AM
 
intel352 intel352 is offline
 

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

Default Re: [MODULE] XC SEO v1.4.0 Released for X-Cart 4.0 and 4.1

Hi Mike, nice change. I've actually implemented query result caching in XCSEO Pro to avoid situations with the same data being fetched repeatedly. I'm also investigating other improvements, such as building an array of all urls that need replacing, and build one-time queries that would fetch data for everything that needs to be replaced.

Any improvements that I come up with in Pro, that can be backported to basic, I'll backport.

BTW, while your method definitely improves performance, I do prefer to avoid having to edit template files. I've found users often have their skins replaced, or add mods that replace changes that have already been implemented, etc, more so with tpl files than php files. While you're a savvy user, and obviously know your way around code, most users aren't, so XC SEO basic is aimed at the "lowest common denominator", in this case.

But I appreciate your feedback, and I'll keep it in mind when making other changes to improve performance

Ideally, I'd rather modify the function in X-Cart that pulls back product data, to cache that data to be globally accessible, same for categories, etc. There are multiple occasions when X-Cart itself queries more than once for the same dataset, and having that info cached already would be nice. Maybe I could develop that as a separate performance patch (would have to weigh the memory use against the benefit of less queries), and have XC SEO check for the existence of that performance patch, as an added optional speed boost.

EDIT: just as a note, I've worked on proprietary code before, that functions as a cache class. You could flag cache data as session based or persistent, and if persistent & memcache is available, the persistent data would be stored in memcache. That would be nice to have developed for X-Cart
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote
  #15  
Old 05-23-2008, 12:01 AM
 
m28m m28m is offline
 

Member
  
Join Date: Feb 2008
Posts: 20
 

Default Re: [MODULE] XC SEO v1.4.0 Released for X-Cart 4.0 and 4.1

Hi jon,i use XC SEO v1.3.0 but the Product rating star can not show ,it's my website problem ? V1.4.0 alredy fix this problem ?
__________________
Ken

X-Cart Gold version 4.1.9
Add-ons: x-fancycat-4,x-aom-4, x-offers-4, x-magnifier-4
Reply With Quote
  #16  
Old 05-23-2008, 02:41 AM
 
intel352 intel352 is offline
 

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

Default Re: [MODULE] XC SEO v1.4.0 Released for X-Cart 4.0 and 4.1

Hi Ken, contact me via email (in my sig), we'll figure out what's going on
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote
  #17  
Old 05-23-2008, 05:33 PM
 
Lingerieblowout Lingerieblowout is offline
 

X-Adept
  
Join Date: Sep 2003
Location: Annapolis, MD
Posts: 415
 

Default Re: [MODULE] XC SEO v1.4.0 Released for X-Cart 4.0 and 4.1

Any idea how to get XML Sitemap Generator to generate all the files site map XML etc .... there is no html files to be found in my XC ... http://www.xml-sitemaps.com/
__________________
http://www.lingerieblowout.com
Version 4.1.10

http://www.topnichewebsites.com
Version 4.4.5

Michael
Reply With Quote
  #18  
Old 05-24-2008, 10:23 AM
 
Auren_B Auren_B is offline
 

Member
  
Join Date: Mar 2008
Posts: 12
 

Default Re: [MODULE] XC SEO v1.4.0 Released for X-Cart 4.0 and 4.1

Greetings! Does anyone know or have experience with XC SEO 1.3.0 correctly rewriting product pages, but not category pages. The links to category pages are bringing up a 404. Could it possibly be from using BCS Category Meta Titles? Thanks!
__________________
X-Cart Version 4.1.9
Reply With Quote
  #19  
Old 05-24-2008, 12:26 PM
 
intel352 intel352 is offline
 

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

Default Re: [MODULE] XC SEO v1.4.0 Released for X-Cart 4.0 and 4.1

Hi Lingerieblowout, I've sent you a PM to see if I can help you figure out the problem you're experiencing.

Auren, contact me via my email (in my sig), with your website URL, I'll see if I can help you troubleshoot.

Cheers
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote
  #20  
Old 05-24-2008, 12:51 PM
 
Auren_B Auren_B is offline
 

Member
  
Join Date: Mar 2008
Posts: 12
 

Default Re: [MODULE] XC SEO v1.4.0 Released for X-Cart 4.0 and 4.1

John, my associate Gary tells me he sent you a few emails during the last week about this, without reply. We're working on the same project. He's sending again right now. Thanks!
__________________
X-Cart Version 4.1.9
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 03:14 AM.

   

 
X-Cart forums © 2001-2018