Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


Recommended Posts

A new version has been uploaded with the following changes:

  • Added a check in the Phoenix version to check if search engine friendly setting is present.
  • Added rewrite code for blog articles in Article Manager.
  • Added a new directory for Phoenix versions of 1.0.7.4 and above.
  • Changed code to prevent a warning in Phoenix shops.

 

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

Hi Jack,

Installing on Phoenix 1.0.7 and I went to install href_link.php (catalog/includes/functions/) and a file with the same name already exists. Do I replace the file or add your code to it?

Thanks!

Cary

Link to comment
Share on other sites

Hi Jack,

Thank you for the prompt reply! One other question. The previous version I had allowed the model number to be added to the SEO Url. Is that an option I'm missing or is that something I can add if not baked in?

Thanks!

Cary

Link to comment
Share on other sites

I don't recall that ever being an option in this addon. You might be thinking of Header Tags SEO, which has an option to display the model number.

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

  • 2 weeks later...

Hi Jack, know you have enough on your plate but giving a head's up that PHOENIX 1.0.7.7 breaks the addon because of the new configure.php file :

Use of undefined constant ENABLE_SSL - assumed 'ENABLE_SSL' (this will throw an Error in a future version of PHP) in /xx/xx/xx/xx/includes/classes/seo.class.php on line 755
Warning:  Use of undefined constant HTTPS_SERVER - assumed 'HTTPS_SERVER' (this will throw an Error in a future version of PHP) in /xx/xx/xx/xx/includes/classes/seo.class.php on line 756
Warning:  Use of undefined constant DIR_WS_HTTPS_CATALOG - assumed 'DIR_WS_HTTPS_CATALOG' (this will throw an Error in a future version of PHP) in /xx/xx/xx/htdocs/includes/classes/seo.class.php on line 756
Warning:  Use of undefined constant DIR_WS_HTTP_CATALOG - assumed 'DIR_WS_HTTP_CATALOG' (this will throw an Error in a future version of PHP) in /xx/xx/xx/htdocs/includes/classes/seo.class.php on line 753
Warning:  Use of undefined constant HTTP_COOKIE_DOMAIN - assumed 'HTTP_COOKIE_DOMAIN' (this will throw an Error in a future version of PHP) in /xx/xx/xx/htdocs/includes/classes/seo.class.php on line 775
Warning:  Use of undefined constant HTTPS_COOKIE_DOMAIN - assumed 'HTTPS_COOKIE_DOMAIN' (this will throw an Error in a future version of PHP) in /xx/xx/xx/htdocs/includes/classes/seo.class.php on line 775

My "dirty" fix to keep my site up and running was to take the defines from the old configure file and add them in includes/languages/english.php

  define('HTTPS_SERVER', 'https://www.mydomain.com');
  define('ENABLE_SSL', true);
  define('HTTP_COOKIE_DOMAIN', 'www.mydomain.com');
  define('HTTPS_COOKIE_DOMAIN', 'www.mydomain.com');
  define('HTTP_COOKIE_PATH', '/');
  define('HTTPS_COOKIE_PATH', '/');
  define('DIR_WS_HTTP_CATALOG', '/');
  define('DIR_WS_HTTPS_CATALOG', '/');

Know this is not good but it does work for the moment until you can help as I am no expert! Thanks so much.

 

Link to comment
Share on other sites

1 hour ago, Jack_mcs said:

Thanks for mentioning it. I haven't looked at the latest version but I don't think your fix will cause any problems for now.

Thanks Jack. For the moment it seems to work without causing problems so I can hold out till you give a cleaner solution!

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...

Hi @Jack_mcs  I have recently upgraded a bootstrap Gold/Frozen/Edge site to php 7.3 all is functioning well. I do however get a few warnings about the seo.class.php.  Seems mostly to happen during checkout.. which is interesting because seo urls are not used during the checkout but I guess the class is still be called. Anyway the warning is

Use of undefined constant CHARSET - assumed 'CHARSET' (this will throw an Error in a future version of PHP) in /home/woodtoys/public_html/includes/classes/seo.class.php on line 1831

I know this is not a big deal but would like to know what the issue might be.

Doug

 

Link to comment
Share on other sites

I don't have a frozen shop setup with this addon installed but I tested it in Phoenix and there isn't such a warning. As I recall, frozen wasn't setup to run with 7.3, though I may be mistaken, so you may need to lower the php version.

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

8 hours ago, douglaswalker said:

Use of undefined constant CHARSET - assumed 'CHARSET' (this will throw an Error in a future version of PHP) in /home/woodtoys/public_html/includes/classes/seo.class.php on line 1831

Note that CHARSET is still in the latest Phoenix:  https://github.com/gburton/CE-Phoenix/blob/master/includes/languages/english.php#L34

It's almost certainly also present in the default Frozen.  Perhaps you edited it out but need to put it back? 

Always back up before making changes.

Link to comment
Share on other sites

@ecartz @Jack_mcsIt is still in my installation but as a define not a const ...can that be the issue?

the only other one is also to do with a payment module when it calls back to the site.

These are the only 2 warnings I now receive on php7.3 and both involve the seo.class.php

The payment modules all work correctly so it is more something i am interested to find out why the mysqli warning happen. I have discovered it has always been there with the particular payment module and i just picked it up during the upgrade.

PHP Warning:  mysqli_insert_id() expects parameter 1 to be mysqli, null given in /home/***/public_html/includes/classes/seo.class.php on line 147
Edited by douglaswalker
more info
Link to comment
Share on other sites

2 hours ago, douglaswalker said:

@ecartz @Jack_mcsIt is still in my installation but as a define not a const ...can that be the issue?

the only other one is also to do with a payment module when it calls back to the site.

These are the only 2 warnings I now receive on php7.3 and both involve the seo.class.php

The payment modules all work correctly so it is more something i am interested to find out why the mysqli warning happen. I have discovered it has always been there with the particular payment module and i just picked it up during the upgrade.


PHP Warning:  mysqli_insert_id() expects parameter 1 to be mysqli, null given in /home/***/public_html/includes/classes/seo.class.php on line 147

There is something distinctly weird going on here, Doug. That should only get executed if the module is being installed. Do you know where it's coming from? Assuming that it's generating the urls properly elsewhere, my best guess is that a callback from a payment module isn't loading settings from the configuration table before the tep_href_link function is called. However another possiblity is that the class is broken and only works if it returns cached urls.

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Link to comment
Share on other sites

7 minutes ago, BrockleyJohn said:

There is something distinctly weird going on here, Doug. That should only get executed if the module is being installed. Do you know where it's coming from? Assuming that it's generating the urls properly elsewhere, my best guess is that a callback from a payment module isn't loading settings from the configuration table before the tep_href_link function is called. However another possiblity is that the class is broken and only works if it returns cached urls.

Hi there... yes the urls are all being created perfectly elsewhere with the cache either on or off and i get no errors unless one of the payment modules are called

 

I did wonder why the seo class was being called on the checkout pages as it is not needed there . I wondered like a module if there was a way to turn it off for those pages.

Edited by douglaswalker
more info
Link to comment
Share on other sites

@douglaswalker It doesn't get called to create the url in the address bar, but to create links on the page.

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Link to comment
Share on other sites

@BrockleyJohn Doh... yes of course.. anyway they are creating correctly I just checked,,, also now not getting the CHARSET error.. but the  error below is still there when using afterpay and afterpay then returns the customer to the site after payment ..successful or otherwise... that error has always been there and is not to do with the php version... ahh sigh...

This is the line in the seo class  

function InsertID() {
            return mysqli_insert_id($this->link_id);
        }

PHP Warning:  mysqli_insert_id() expects parameter 1 to be mysqli, null given 
Edited by douglaswalker
more info
Link to comment
Share on other sites

That's why it's worth getting modules written professionally

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Link to comment
Share on other sites

  • 5 weeks later...

Hello Jack,

Have a problem I have not run into before.... installing the search box on PHOENIX 1.0.7.9 when Ultimate SEO Urls are installed throws the error:

Error!

Unable to determine connection method on a link!

Known methods: NONSSL SSL

Everything else works just great, just the stock search box throwing the error whereas it works on a test site without Ultimate SEO Urls.  Any ideas?

Link to comment
Share on other sites

This isn't due to this addon but to fix it, change the following 

$form_output = tep_draw_form('quick_find', tep_href_link('advanced_search_result.php', '', null, false), 'get');

to

$form_output = tep_draw_form('quick_find', tep_href_link('advanced_search_result.php', '', 'SSL', false), 'get');

 

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

7 minutes ago, Jack_mcs said:

This isn't due to this addon but to fix it, change the following 


$form_output = tep_draw_form('quick_find', tep_href_link('advanced_search_result.php', '', null, false), 'get');

to


$form_output = tep_draw_form('quick_find', tep_href_link('advanced_search_result.php', '', 'SSL', false), 'get');

  

Thank you Jack!

Link to comment
Share on other sites

1 minute ago, Jack_mcs said:

This isn't due to this addon

That is incorrect. 

This add-on rewrites the tep_href_link function to require specifying whether the connection is SSL or non-SSL.  Since that is not necessary in 1.0.7.9, there is a conflict.  The add-on should be revised to not require choosing a "connection method" and just ignore the third parameter to tep_href_link. 

The expectation should be that more things will ignore the connection type in the future, further highlighting the difference between how this add-on handles it and how core does. 

Always back up before making changes.

Link to comment
Share on other sites

  • 1 month later...

A new version has been uploaded. The changes only applies to Phoenix to make it compatible with the latest version.

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

On 11/27/2020 at 6:40 PM, Jack_mcs said:

A new version has been uploaded. The changes only applies to Phoenix to make it compatible with the latest version.

Hi Jack,

With the new version there are notices in the logs (although everything seems to work):

PHP Notice:  Undefined index: path in /xx/xx/xx/xx/includes/classes/seo.class.php on line 2606
PHP Notice:  Undefined index: path in /xx/xx/xx/xx/includes/classes/seo.class.php on line 2643
PHP Notice:  Undefined index: path in /xx/xx/xx/xx/includes/classes/seo.class.php on line 2714
PHP Notice:  Undefined index: path in /xx/xx/xx/xx/includes/classes/seo.class.php on line 2744

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