Jump to content
spidometrs

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

 

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
51 minutes ago, Cary said:

Do I replace the file or add your code to it?

Replace it.

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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.

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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.


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

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

Share this post


Link to post
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

Share this post


Link to post
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.


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
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');

 

Share this post


Link to post
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!

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×