Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo


Recommended Posts

By "something in your local setup," I was referring to how your shop is setup in it, not the actual apache/php setup. I assume the latter is working from your description. It is more likely a problem in the configure or .htaccess file or maybe a setting like cache or gzip.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Perhaps, but on the other hand, if it is setup shop and not the environment of locolhost, why at production machine everything works. I'm doing the zip file and just send to the production machine without any changes except configure files. Maybe the problem is in configure files, but I think it might be something in the localhost settings. Maybe I miss some php extension or something like that. Unfortunately, I don't know what it could be. That's why I wanted to try some other configuration of localhost programs.

Link to comment
Share on other sites

Be sure to have mod rewrite enabled in the php modules. Other than that, you should ask in the support forum for whatever package you are using for your local setup.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Jack - Thank you for this contribution and for Header Tags SEO and all you do over the years.

 

Now I have a stupid easy question. I'm running OSCommerce 2.3.3.4. I have Header Tags SEO installed and working.

 

Ultimate SEO URLs latest version says:

Clean install on sterile osCommerce MS-2.2 or RC2

but I'm not running MS or RC2.  Used to run RC2, never played with MS.

 

So can I install the newest version of Ultimate SEO URLs

Ultimate SEO 2-2.2d-14a

successfully into OSC 2.3.3.4?

 

Thank you so much.

 

Robin

Link to comment
Share on other sites

Hi

 

I have OsCommerce 2.3.4 with Ultimate SEO URLSv22d 14a. At browser window, at the first card, I have displayed the admin page SEO URLs, and at the second card I have displayed store page. When I start to browse the store page and then return to the admin page SEO URLs, all settings are disappear and when I click on the SEO URLs link, all settings appear again, but all they have default values. My previous settings are lost even they were worked at the store.

 

This happens only on localhost, on the production machine everything is fine.

 

I would be grateful for any advice and I'm sorry about my English.

 

Finally, I've installed XAMPP 1.8.2 and now it's OK.

Unfortunately, I've got another strange problem :) with polish special characters conversion. I put this:

Ą=>a,ą=>a,Ć=>c,ć=>c,Ę=>e,ę=>e,Ł=>l,ł=>l,Ń=>n,ń=>n,Ó=>o,ó=>o,Ś=>s,ś=>s,Ź=>z,ź=>z,Ż=>z,ż=>z

and works only ó=>o nothing else. Did anyone of You already have similar problem?

Link to comment
Share on other sites

Unfortunately, I've got another strange problem :) with polish special characters conversion. I put this:

Ą=>a,ą=>a,Ć=>c,ć=>c,Ę=>e,ę=>e,Ł=>l,ł=>l,Ń=>n,ń=>n,Ó=>o,ó=>o,Ś=>s,ś=>s,Ź=>z,ź=>z,Ż=>z,ż=>z

and works only ó=>o nothing else. Did anyone of You already have similar problem?

I've noticed that the only last version of this addon where polish special characters conversion works fine is

Ultimate Seo Urls 2.1d STABLE FINAL r172 by FWR Media.

Link to comment
Share on other sites

That version has a lot of problems so I don't suggest using it. I'm not aware of conversions not working. Try setting all of the settings, except the first one to false and see if that helps. If it does, turn a few on at a time to determine the one that causes the problem.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

trying to install this but the first code edit is different in my file (v2.3.4), it says-

find this code:
// include the language translations
  require(DIR_WS_LANGUAGES . $language . '.php');

and add this directly after:
// Ultimate SEO URLs v2.2d
 if ((!defined(SEO_ENABLED)) || (SEO_ENABLED == 'true')) {
   include_once(DIR_WS_CLASSES . 'seo.class.php');
   if ( !is_object($seo_urls) ){
     $seo_urls = new SEO_URL($languages_id);
   }
 }



but the code in my shop is-

// include the language translations
  $_system_locale_numeric = setlocale(LC_NUMERIC, 0);
  require(DIR_WS_LANGUAGES . $language . '.php');
  setlocale(LC_NUMERIC, $_system_locale_numeric);

and NOT:
// include the language translations
  require(DIR_WS_LANGUAGES . $language . '.php');

anyone else have this issue?

should I place it right after the full code?

if I place it after the 

// include the language translations
  $_system_locale_numeric = setlocale(LC_NUMERIC, 0);
  require(DIR_WS_LANGUAGES . $language . '.php');

it knocks out my header buttons...please help.

Link to comment
Share on other sites

like this

 

// include the language translations
  $_system_locale_numeric = setlocale(LC_NUMERIC, 0);
  require(DIR_WS_LANGUAGES . $language . '.php');
  setlocale(LC_NUMERIC, $_system_locale_numeric);d this directly after:

// Ultimate SEO URLs v2.2d
 if ((!defined(SEO_ENABLED)) || (SEO_ENABLED == 'true')) {
   include_once(DIR_WS_CLASSES . 'seo.class.php');
   if ( !is_object($seo_urls) ){
     $seo_urls = new SEO_URL($languages_id);
   }
 }

 

 

-Dave

Link to comment
Share on other sites

Try setting all of the settings, except the first one to false and see if that helps. If it does, turn a few on at a time to determine the one that causes the problem.

 

I did it, but still doesn't work :(

Link to comment
Share on other sites

@@Asteriks Gal Try using the last version I uploaded to see if that makes a difference. To make the change, use the uninstall options in the settings and then upload the includes/classes/seo.class.php file.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@@Jack_mcs

 

for grins, using kiss error handler, I took a peek at any current errors... wrote errors to file for about 1 minute as I clicked around.  Log fie is 11300 lines! 1.2mb!... in one minute. 99% of the errors logged are identical:

Date / Time: 05-03-2015 10:50:08
Error Type: [E_NOTICE] Constant PRODUCT_NAME_29 already defined
On line 1
File includes/classes/seo.class.php(2446) : eval()'d code
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Date / Time: 05-03-2015 10:50:08
Error Type: [E_NOTICE] Constant PRODUCT_NAME_30 already defined
On line 2
File includes/classes/seo.class.php(2446) : eval()'d code
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Date / Time: 05-03-2015 10:50:08
Error Type: [E_NOTICE] Constant PRODUCT_NAME_31 already defined
On line 3
File includes/classes/seo.class.php(2446) : eval()'d code
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

and on and on for every product and manufacturer, with every page load repeating... ie the huge log file in short order.

 

Yes I know they are all NOTICES, but thousands in less than a minute?

 

Any idea how to resolve?

 

the code from seo_class.php is:   line 2446 is the line pointed to by the errors.

/**
 * Function to get cache entry 
 * @[member=author] Bobby Easland 
 * @version 1.0
 * @[member=param] string $name
 * @[member=param] boolean $local_memory
 * @[member=Return] mixed
 */        
        function get_cache($name = 'GLOBAL', $local_memory = false){
                $select_list = 'cache_id, cache_language_id, cache_name, cache_data, cache_global, cache_gzip, cache_method, cache_date, cache_expires';
                $global = ( $name == 'GLOBAL' ? true : false ); // was GLOBAL passed or is using the default?
                switch($name){
                        case 'GLOBAL': 
                                $this->cache_query = $this->DB->Query("SELECT ".$select_list." FROM cache WHERE cache_language_id='".(int)$this->languages_id."' AND cache_global='1'");
                                break;
                        default: 
                                $this->cache_query = $this->DB->Query("SELECT ".$select_list." FROM cache WHERE cache_id='".md5($name)."' AND cache_language_id='".(int)$this->languages_id."'");
                                break;
                } # end switch ($name)
                $num_rows = $this->DB->NumRows($this->cache_query);
                if ( $num_rows ){ 
                        $container = array();
                        while($cache = $this->DB->FetchArray($this->cache_query)){
                                $cache_name = $cache['cache_name']; 
                                if ( $cache['cache_expires'] > @[member=date]("Y-m-d H:i:s") ) {
                                        $cache_data = ( $cache['cache_gzip'] == 1 ? gzinflate(base64_decode($cache['cache_data'])) : stripslashes($cache['cache_data']) );
                                        switch($cache['cache_method']){
                                                case 'EVAL': // must be PHP code
                                                        eval("$cache_data");
                                                        break;                                                        
                                                case 'ARRAY': 
                                                        $cache_data = unserialize($cache_data);                                                        
                                                case 'RETURN': 
                                                default:
                                                        break;
                                        } # end switch ($cache['cache_method'])                                        
                                        if ($global) $container['GLOBAL'][$cache_name] = $cache_data; 
                                        else $container[$cache_name] = $cache_data; // not global                                
                                } else { // cache is expired
                                        if ($global) $container['GLOBAL'][$cache_name] = false; 
                                        else $container[$cache_name] = false; 
                                }# end if ( $cache['cache_expires'] > @[member=date]("Y-m-d H:i:s") )                        
                                if ( $local_memory ) {
                                        if ($global) $this->data['GLOBAL'][$cache_name] = $container['GLOBAL'][$cache_name]; 
                                        else $this->data[$cache_name] = $container[$cache_name]; 
                                }                                                        
                        } # end while ($cache = $this->DB->FetchArray($this->cache_query))                        
                        unset($cache_data);
                        $this->DB->Free($this->cache_query);                        
                        switch (true) {
                                case ($num_rows == 1): 
                                        if ($global){
                                                if ($container['GLOBAL'][$cache_name] == false || !isset($container['GLOBAL'][$cache_name])) return false;
                                                else return $container['GLOBAL'][$cache_name]; 
                                        } else { // not global
                                                if ($container[$cache_name] == false || !isset($container[$cache_name])) return false;
                                                else return $container[$cache_name];
                                        } # end if ($global)                                        
                                case ($num_rows > 1): 
                                default: 
                                        return $container; 
                                        break;
                        }# end switch (true)                        
                } else { 
                        return false;
                }# end if ( $num_rows )                
        } # end function get_cache()

settings are

Enable SEO URLs? true   
Add cPath to product URLs? false Info  
Add category parent to product URLs? false Info  
Add category parent to begining of URLs? true Info  
Filter Short Words 0 Info  
Output W3C valid URLs (parameter string)? true Info  
Enable SEO cache to save queries? true Info  
Enable product cache? true Info  
Enable categories cache? true Info  
Enable manufacturers cache? true Info  
Enable Articles Manager Articles cache? false Info  
Enable Articles Manager Topics cache? false Info  
Enable FAQDesk Categories cache? false Info  
Enable Information Pages cache? true Info  
Enable Links Manager cache? false Info  
Enable NewsDesk Articles cache? false Info  
Enable NewsDesk Categories cache? false Info  
Enable Pollbooth cache? false Info  
Enable Page Editor cache? false Info  
Enable automatic redirects? true Info  
Enable use Header Tags SEO as name? false Info  
Enable performance checker? false Info  
Choose URL Rewrite Type Rewrite Info  
Enter special character conversions  Info  
Remove all non-alphanumeric characters? false Info  
Reset SEO URLs Cache false Info  
Uninstall Ultimate SEO false 

-Dave

Link to comment
Share on other sites

Notices are not usually worth the time it takes to fix them.  They can be useful if there is some problem that may affect the code in a negative way. In this case, it is saying the constant, which the code creates, already exists. So overwriting such a constant could be an error but, in this case, it isn't.

 

To fix this, you would need to evaluate the cached value that gets read in and then check if the constant exists and then proceed or not based on that result. So fixing this would cause the code to be slower due to the extra checking going on.

 

Making the following change may prevent the notices for that line from showing. Change

eval("$cache_data");

to

@eval("$cache_data");

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

We have run into a hickup while transfering our OSC to a new server. the URL is displaying the -p- but not the description as it did in the old server. The weird thing is that we took the new site we have up, as is, into WAMP and it works as expected. We have access to the Apache settings on our server, so that can help (Or F_ us in the okole if we are not careful) and we tried to add

LoadModule rewrite_module modules/mod_rewrite.so

but it gave us an error saying that it can't be added because it is added by default (I forgot the actual error). Our .htaccess has "RewriteEngine On" with no IF statement before going through the wall of

RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}

and from what I understand, if the mod_rewrite was NOT running we would get an error unless we used the IF, and we don't get an error, just no SEO description in the URL.

 

We tried adding the "AllowOverride Options" but it didn't give much instructions and we were not sure where to point it, but it killed the server no matter where we put it or which dir we pointed it to.

 

The old server was PHP 5.3 where the new one is 5.4. We are not sure if this is a problem, but we did have other problems concerning this, such as functions using "Pass by Ref (using the & operator)".

 

Any help or ideas would be appreciated!!

 

--Billynair

Link to comment
Share on other sites

I think it may be a problem with a server setting.

We reinstalled OSC 2.3.4 totally vanilla, new database and everything. Installed this SEO mod and we still get the -p- problem.

Example http://mywebsite.com/-p-27.html
does the same thing with categories eg. -c-

* we are using the latest version of this SEO mod
* I did the reset SEO Cache thing

Thanks in advance

Link to comment
Share on other sites

Sometimes the configure file can cause this. See this thread to check yours. Otherwise, it sounds like a server problem as you mentioned and you would need to talk to your host about that.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Might have something to do with the PHP version.

 

 

http://php.net/manual/en/language.references.pass.php
And as of PHP 5.4.0, call-time pass-by-reference was removed, so using it will raise a fatal error.

So if the new server is running PHP 5.4 then you will have problems because it looks like quite a few of the functions in the seo.class.php are  doing pass-by-reference which is now deprecated.

We rolled our Apache server from PHP 5.4 to PHP 5.3 and it works now.

We are going to update the seo.class code and see if we can make it work on PHP 5.4

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself.

Therefore, all progress depends upon the unreasonable man."

-- George Bernard Shaw

Link to comment
Share on other sites

There isn't any pass-by-reference in the code that I am aware of. I have installed this addon into many shops running 5.4 without any problems.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Is this not in the latest version of seo.class.php?

Line 2964:         function is_cached($name, &$is_cached, &$is_expired){ // NOTE: $is_cached and $is_expired is passed by reference !!

Do a search in seo.class.php for "passed by reference" or "&$" and there are about 8 or 9 references to it.

We would love to be able to use PHP 5.4. Is there something else we're doing wrong? Missing a library perhaps?

 

On the same server we run php 5.4, and it only gives the "yourwebsite.com/-p-27.html" URLs. Switching our php to 5.3 makes it work correctly producing "yourwebsite.com/product-name-p-27.html" URLs. The category URLs also do not work on the new PHP.

Thanks

Edited by yomama360

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself.

Therefore, all progress depends upon the unreasonable man."

-- George Bernard Shaw

Link to comment
Share on other sites

I have this addon (latest version!) running on a php 5.4.35 and 5.5.19 server, no problems at all.

Did you set the correct RewriteBase path?

I had same issue as you described, the URL showing only -p-xx.html without the name then i realized that the path inside the htaccess file was wrong and once that was fixed it worked.

Edited by Tsimi
Link to comment
Share on other sites

@@yomama360 You're misunderstanding the pass by reference error. Using &$ is perfectly OK as long as it is in the arguments for a function. But it cannot be used when calling that function.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

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...