Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

ULTIMATE SEO URLS 5 - who's interested?


FWR Media

Recommended Posts

ULTIMATE Seo Urls 5

by FWR Media

 

The new version of this contribution is a total rewrite ..

 

Faster:

Using a single cache file and NO database queries (after cache load) this is super fast ..(examples given further down). The cache is also updated "on demand" as opposed to one HUGE database fest.

 

Modern:

Using PHP 5 code .. no deprecated code and error free ( E_ALL | E_STRICT) and built in a strict MySQL 5 environment, this is code for now and the future.

 

Light:

Virtually no db queries .. small variable/define footprint .. no database install needed (although advised for ease of use) .. easy install .. slimmer code base.

 

Compatible:

Replicates old seo urls so no need for redirects or Google problems. Also inbuilt validation and 301 redirection.

 

Modular:

Contributions like .. info pages .. articles .. links etc can be added as one file modules.

 

Flexible:

Even with .htaccess in place with rewrites you can still choose (without code changes) between ..

 

  • Standard osC URIs
  • osc search engine safe URIs
  • Tradition seo url rewritten URIs
  • New seo urls with no .htaccess rewrites needed

Wasn't the original from 2005 good enough?

 

The old seo urls served us all well .. it was a good concept but had limitations.

 

Speed:

Most wont have analysed query use with the old seo urls but it makes HUGE use of the database .. even if you had installed Chemos old queries debug contrib you will still be in the dark as the original used its own database class (for no apparent reason) so seo url queries don't get reported .. even on average sites it produces literally hundreds of queries. The cache itself queries every time to assess if a cache entry is still live so the cache is in it's own way a bit of a hog.

 

The original also had literally tons of unnecessary code (1965 lines in total) .. unused or unimplemented features .. many errors if you run reporting E_ALL etc etc so on and so forth.

 

In addition if anyone ever looked at the global scope and defines the old version used an enormous amount of space .. much of which was unneccessary.

 

Example of the new code. (Stats from local environment .. my little old home pc .. so a server should manage :) )

 

Multiple loads explanation: I simply iterated loading the cache file X times on each page load to replicate server load.

 

Standard: (1 iteration) Tiny shop

Vanilla osc with 20 categories and 27 products

Cache loads in 0.0005 seconds (1/2000 sec)

 

Multiple loads (X 10,000) HUGE shop

PC didn't like this at all :)

Load time 4.6893 seconds (4 1/2 secs)

Approximately replicates ..

200,000 categories

270,000 products

 

Multiple loads (X 1000) Very very big shop

Load time 0.4694 seconds (1/2 a sec)

Approximately replicates ..

20,000 categories

27,000 products

 

Multiple loads (X 15) Average shop

load time 0.0073 seconds ( 1/136 second)

Approximately replicates ..

300 categories

405 products

 

Note: If anyone has comments about the validity of these "approximations" I'd be very interested. My initial view is that they are highly conservative. e.g. take the HUGE shop .. because of the way I'm testing that particular test loaded a 2kb file 10,000 times and ran unserialize() and gzinflate() on each of those iterations. In the real world the system would have loaded one 20,00kb file and called unserialize and gzinflate just once. (although on a shop of that size I would take a different approach ofc).

 

So to the reason for posting here: -

 

I have no intention of posting this as an available contribution until it has been successfully tested in other environments to my own. If you are interested .. email admin at <my forum name> dot co dot uk and I will send you the current revision .. purely on the understanding that you will test and provide feedback that will enable me to reach the stage of uploading a version to the community.

 

If you have the ability to test on an Windows server all the better as I don't have access and would like to know if the "non" rewrite version works on Windows.

 

Let me know your thoughts.

 

You can see the standard .. non rewrite urls working at my dev site

Edited by FWR Media
Link to comment
Share on other sites

  • Replies 50
  • Created
  • Last Reply

Top Posters In This Topic

I forgot to mention .. if you do visit the test site .. look at the bottom of the screen .. you will see performance figures there.

Link to comment
Share on other sites

Interesting version, if you do release it i would happily test it out....

Link to comment
Share on other sites

Interesting version, if you do release it i would happily test it out....

 

Thanks toyicebear .. it will need some testing before I put it up as a contribution.

 

It mostly works right now and I am currently adding validation and legacy url redirects.

Link to comment
Share on other sites

Update ..

 

Pretty much there bar some tidying

 

Redirects and validation:

 

rewrite url http://www.mysite.com/my-great-category-c-3.html

 

non rewrite url http://www.mysite.com/index.php/my-great-category-c-3

 

301 Redirects all old style urls to seo equivalents ( rewrite or non rewrite ) so

 

index.php?cPath=3

/index.php/cPath/3

 

301 redirects incorrect category to cPath with parent e.g. (vanilla osc example)

 

index.php?cPath=4

 

301 redirects to graphics-cards-c-1_4.html

 

404 file called for inexistant products or categories.

 

my-great-category-c-999.html returns a 404 page

 

http://www.mysite.com/-c-3.html

 

301 redirects to

 

http://www.mysite.com/my-great-category-c-3.html

Link to comment
Share on other sites

  • 2 weeks later...

This does seem like a very interesting release indeed.. (it far surpases my level of knowledge) so this is more a note of encouragement, rather than an offer of assistance in testing! I'll therefore take this oppourtunity to 'thank you' for your solid contributions to date, they certainly have proved invaluable in my store development!

 

Do you have a proposed timeline in the development/initial release of Ultimate SEO URLs 5?

 

Regards

James

Link to comment
Share on other sites

This does seem like a very interesting release indeed.. (it far surpases my level of knowledge) so this is more a note of encouragement, rather than an offer of assistance in testing! I'll therefore take this oppourtunity to 'thank you' for your solid contributions to date, they certainly have proved invaluable in my store development!

 

Do you have a proposed timeline in the development/initial release of Ultimate SEO URLs 5?

 

Regards

James

 

Hi and thanks for your kind comments.

 

It is fully built and I have a few testers (although this post was a waste of time as I only got one beta tester out of it .. thanks toyicebear).

 

Initial release should be imminent, I need to see if the standard seo urls work on Windows servers and don't have access to this type of server to test on.

Edited by FWR Media
Link to comment
Share on other sites

Hi and thanks for your kind comments.

 

It is fully built and I have a few testers (although this post was a waste of time as I only got one beta tester out of it .. thanks toyicebear).

 

Initial release should be imminent, I need to see if the standard seo urls work on Windows servers and don't have access to this type of server to test on.

 

No problem at all (re. the comments) they are well deserved! I wish I could help with the Windows server, but unfortunately mine is a *nix.. maybe a 'blanket post' on the forums would reveal a beta tester with access to a Windows server? Sorry I couldn't be of more help!

 

I look forward to the release in due course and once again, thanks for the hard work!

 

James

Link to comment
Share on other sites

Now tested and working on Windows/IIS (thanks to PerfectPassion)

 

Thanks also to those who beta tested:

Jan Zonjee

PerfectPassion

toyicebear

GLCustoms

 

 

 

There were path issues, windows seems to change $_SERVER path variables server by server. The Windows version will initially be an early beta as it has only been tested on one server (I don't have access to one).

 

Sooo .. I'll get this packaged up and released asap.

Edited by FWR Media
Link to comment
Share on other sites

I have to say that I'm looking forward to seeing/using this! Thanks again for all your hard work :D

 

Has now been released .. http://www.oscommerce.com/forums/index.php?showtopic=336702

Link to comment
Share on other sites

osCommerce Online Merchant v2.2 RC2a

Upgrade_From_Series2

 

Received this error when running usu2_removal.php

 

Fatal error: Call to a member function initiate() on a non-object in /home/aviation/public_html/catalog/includes/application_top.php on line 240

 

and on line 240 I have:

// ULTIMATE Seo Urls 5 by FWR Media

$seo_urls->initiate($SID, $languages_id, $language);

 

I commented the line and ran the usu2_removal.php

 

I then ran installer.php

 

I uncommented the line and get the same error

 

Any ideas?

 

Kind regards,

 

Debs

Link to comment
Share on other sites

osCommerce Online Merchant v2.2 RC2a

Upgrade_From_Series2

 

Received this error when running usu2_removal.php

 

Fatal error: Call to a member function initiate() on a non-object in /home/aviation/public_html/catalog/includes/application_top.php on line 240

 

and on line 240 I have:

// ULTIMATE Seo Urls 5 by FWR Media

$seo_urls->initiate($SID, $languages_id, $language);

 

I commented the line and ran the usu2_removal.php

 

I then ran installer.php

 

I uncommented the line and get the same error

 

Any ideas?

 

Kind regards,

 

Debs

 

Sounds like the code change has not been made in includes/functions/html_output.php where the class is instantiated.

 

catalog/includes/functions/html_output.php

 

tep_href_link() number 4 in the upgrade sequence

Link to comment
Share on other sites

Thank you for the quick reply.

 

I made the change and double checked to be certain.

 

My file looks like this:

<?php

/*

$Id: html_output.php 1739 2007-12-20 00:52:16Z hpdl $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2007 osCommerce

 

Released under the GNU General Public License

*/

 

////

// ULTIMATE Seo Urls 5 by FWR Media

// The HTML href link wrapper function

function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {

global $seo_urls, $languages_id, $request_type, $session_started, $sid;

if ( !is_object($seo_urls) ){

include_once DIR_WS_MODULES . 'ultimate_seo_urls5' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'usu.php';

$seo_urls = new usu($languages_id, $request_type, $session_started, $sid);

}

return $seo_urls->href_link($page, $parameters, $connection, $add_session_id);

}

 

// "On the Fly" Auto Thumbnailer using GD Library, servercaching and browsercaching

// Scales product images dynamically, resulting in smaller file sizes, and keeps

// proper image ratio. Used in conjunction with product_thumb.php t/n generator.

function tep_image($src, $alt = '', $width = '', $height = '', $params = '') {

 

// Set default image variable and code

$image = '<img src="' . $src . '"';

 

// Don't calculate if the image is set to a "%" width

if (strstr($width,'%') == false || strstr($height,'%') == false) {

$dont_calculate = 0; ................................................................................

...........

 

Thank you again

Link to comment
Share on other sites

Thank you for the quick reply.

 

I made the change and double checked to be certain.

 

My file looks like this:

<?php

/*

$Id: html_output.php 1739 2007-12-20 00:52:16Z hpdl $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2007 osCommerce

 

Released under the GNU General Public License

*/

 

////

// ULTIMATE Seo Urls 5 by FWR Media

// The HTML href link wrapper function

function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {

global $seo_urls, $languages_id, $request_type, $session_started, $sid;

if ( !is_object($seo_urls) ){

include_once DIR_WS_MODULES . 'ultimate_seo_urls5' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'usu.php';

$seo_urls = new usu($languages_id, $request_type, $session_started, $sid);

}

return $seo_urls->href_link($page, $parameters, $connection, $add_session_id);

}

 

// "On the Fly" Auto Thumbnailer using GD Library, servercaching and browsercaching

// Scales product images dynamically, resulting in smaller file sizes, and keeps

// proper image ratio. Used in conjunction with product_thumb.php t/n generator.

function tep_image($src, $alt = '', $width = '', $height = '', $params = '') {

 

// Set default image variable and code

$image = '<img src="' . $src . '"';

 

// Don't calculate if the image is set to a "%" width

if (strstr($width,'%') == false || strstr($height,'%') == false) {

$dont_calculate = 0; ................................................................................

...........

 

Thank you again

 

Hmmm that's not meant to happen. That file seems fine.

 

ok includes/application_top.php

 

Find ..

 

// ULTIMATE Seo Urls 5 by FWR Media
 $seo_urls->initiate($SID, $languages_id, $language);

 

 

Change to ...

 

// ULTIMATE Seo Urls 5 by FWR Media
 if ( !isset($seo_urls) || !is_object($seo_urls) ){
include_once DIR_WS_MODULES . 'ultimate_seo_urls5' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'usu.php';
$seo_urls = new usu($languages_id, $request_type, $session_started, $SID);
 }
 $seo_urls->initiate($SID, $languages_id, $language);

 

Wonder why it didn't happen to any testers .. oh well.

Edited by FWR Media
Link to comment
Share on other sites

Warning: include_once(includes/modules/ultimate_seo_urls5/modules/_vti_cnf) [function.include-once]: failed to open stream: No such file or directory in /home/aviation/public_html/catalog/includes/modules/ultimate_seo_urls5/classes/usu.php on line 163

 

Warning: include_once() [function.include]: Failed opening 'includes/modules/ultimate_seo_urls5/modules/_vti_cnf' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/aviation/public_html/catalog/includes/modules/ultimate_seo_urls5/classes/usu.php on line 163

 

Fatal error: Class '_vti_cnf' not found in /home/aviation/public_html/catalog/includes/modules/ultimate_seo_urls5/classes/usu.php on line 164

Link to comment
Share on other sites

I double checked the install a couple of times. Perhaps something got messed up on the upload. I will start over, delete and reupload new files and try the install again. Thank you again

Link to comment
Share on other sites

Warning: include_once(includes/modules/ultimate_seo_urls5/modules/_vti_cnf) [function.include-once]: failed to open stream: No such file or directory in /home/aviation/public_html/catalog/includes/modules/ultimate_seo_urls5/classes/usu.php on line 163

 

Warning: include_once() [function.include]: Failed opening 'includes/modules/ultimate_seo_urls5/modules/_vti_cnf' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/aviation/public_html/catalog/includes/modules/ultimate_seo_urls5/classes/usu.php on line 163

 

Fatal error: Class '_vti_cnf' not found in /home/aviation/public_html/catalog/includes/modules/ultimate_seo_urls5/classes/usu.php on line 164

 

That's a frontpage folder .. what's a frontpage folder doing in the modules directory?

Link to comment
Share on other sites

I use frontpage and frontpage tends to create files within all folders. I have never had a direct call to a frontpage folder before... I am not sure why it picked it up

Link to comment
Share on other sites

I use frontpage and frontpage tends to create files within all folders. I have never had a direct call to a frontpage folder before... I am not sure why it picked it up

 

Scrubbed this making another change.

Edited by FWR Media
Link to comment
Share on other sites

Timed out on the above

 

includes/modules/ultimate_seo_urls5/classes/usu.php

 

Change these two functions to the below: -

 

 

  /**
 * Load modules for Seo Urls
 * 
 * Modules allow Seo Urls to deal with the different requests and added contributions
 * @example categories, products, manufacturers - contributions may be articles or information pages
 */
 private function getUsuModules(){
include_once $this->abstracts_path . 'aDataMap.php';
$modules = $this->dirIterator($this->modules_path);
foreach ( $modules as $index => $module ){
  $class = str_replace('.php', '', $module);
  if ( (substr($module, -4, 4) == '.php') ){
	include_once $this->modules_path . $module;
	$class = new $class();
	self::$modules[$class->dependency] = $class;
  }
}
 } // End method

 /**
 * Directory iterator
 * 
 * @param string $fullpath - full path to the director we wish to iterate
 * @return array - numerical index of returned pages
 */
 private function dirIterator($fullpath){
$it = new DirectoryIterator($fullpath);
while( $it->valid() ){
 if ( !$it->isDot() && $it->isFile() && $it->isReadable() ){
   $files[] = $it->getFilename();
 }
 $it->next();
}
return $files;
 } // End method

Link to comment
Share on other sites

This time I did not use frontpage. (still I wonder why it had originally picked up the "vti_cnf" within the folder)

 

I did have to make the additional change you said to try in application top.

I updated the htaccess as well.

 

All seems to work other then this error:

1054 - Unknown column 'info_title' in 'field list'

 

SELECT info_title AS iName FROM information WHERE information_id='9' AND languages_id='1' LIMIT 1

 

If I comment out my call to my information box... then no error (no information box)

 

Any ideas to the fix?

 

Thank you

Link to comment
Share on other sites

This time I did not use frontpage. (still I wonder why it had originally picked up the "vti_cnf" within the folder)

 

I did have to make the additional change you said to try in application top.

I updated the htaccess as well.

 

All seems to work other then this error:

1054 - Unknown column 'info_title' in 'field list'

 

SELECT info_title AS iName FROM information WHERE information_id='9' AND languages_id='1' LIMIT 1

 

If I comment out my call to my information box... then no error (no information box)

 

Any ideas to the fix?

 

Thank you

 

Do you have the information pages contribution installed?

 

Or have you just created a non standard osC page called information?

Edited by FWR Media
Link to comment
Share on other sites

Yes I am using Information Pages Unlimited (2.04.2)

 

I am looking through the new file: Usu_Information but it will take me a while to understand how this new ULTIMATE_Seo_Urls works.

I will have to leve for the afternoon but will try this all again this evening or tomorrow. Thank you again!!

 

Do you have the information pages contribution installed?

 

Or have you just created a non standard osC page called information?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...