Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Header Tags SEO


Jack_mcs

Recommended Posts

Finally, for tonight, I went on to the test screen, testing for cpath / 13 works fine using index.php but when using products id 20 you get 2 error messages both for redirection limit reached.

It would be a nice touch if the combination of Index.php and a product id threw an error message as should product_info and cpath. I don't think these combinations are possible in a shop.

 

image.thumb.png.df5b1ede15581161f8ff889a6596c519.png

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

I think you are trying to outsmart the code. There's no need to be making database changes, assuming you have a working installation. Also, it would surprise me if the url check in the test page worked since I haven't done anything with that code for years. 

Regarding the permissions on the includes/header_tags.php file, they are set to enable writing because when a page is added in admin's Page Control, the file gets edited. For some servers just having the permissions set to 644 will work. In any case, if they do not match those of the images directory and you don't want to change those of the file to match those settings, then turning the option off is the only choice.

For the keywords, be sure the setting for them is enabled, and not set to True. There was a mistake in an earlier version of the database file and if you didn't update it, that setting will be incorrect.

For the View Result on Page Control, you said the cpath was set in the box for it but if you look at the image you uploaded, it isn't.

For the keyword check, I see that it is failing because the code is still using definitions. I will fix that in the next version.

Regarding the error on the test page, as mentioned, I haven't changed that code in some time. I will fix it in the next version if I have time.

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

13 hours ago, Jack_mcs said:

I think you are trying to outsmart the code. There's no need to be making database changes, assuming you have a working installation.

True, I dont think I have a working installation, So I went back and read everything again and uninstalled the db and installed it again.

In the root directory of the installation package there are 2 files Install_ReadMe_First and Install_ReadMe_Last. The DB installation file in this read me first is to use http://www.mysite.com/headertags_seo_db_handler.php, then there is another installation text file in Use_if_version_Phoenix_V_1.0.7.4_and_later which says to use https://www.yoursite.com/headertags_seo_db_handler_hybrid.php

There are installation files for each branch so deleting these 2 top level read me files would be helpful!!!!!

So this time I used the Hybrid to uninstall and install.

4 Header tag modules have been removed and the changes to classes/seo.class.php not yet done as Enable use Header Tags SEO as name? is still set to false.

Went to Page control and selected Add Missing Pages.

Then Fill Tags and selected to fill missing tags.

This has cured the keywords not being populated in the Test page and and view result on Page Control, but FYI when you check the show results check box the input box on the screen is reset with the default prompt and the input value is lost, so it appears as if nothing has been input.

On the fill page I have selected index.php, so I can get a "Save" button visible, then I populated all the default meta fields, clicked on "Save" and they all disappear.

 

These are the Header Tags SEO settings

Quote
Separator - Description -  
Separator - Keywords ,  
Search Keywords False  
Store Keywords True  

Not sure which parameter you are refering to but have tried Store Keywords as False as well.

 

 

So I still have the problem of being unable to set the default tags and will have to continue to outsmart the code!!!

 

 

One question that occurred to me digging around is should header tags have a unique key page_name/language_id?

                               sortorder_root_3 tinyint(2) default 1 NOT NULL, 
                               sortorder_root_4 tinyint(2) default 1 NOT NULL, 
                               language_id int DEFAULT 1 NOT NULL, 
                               KEY idx_page_name (page_name), 
                               KEY idx_page_description (page_description), 
                               KEY idx_page_keywords (page_keywords) 

 

 

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

1 hour ago, geoffreywalton said:

The DB installation file in this read me first is to use http://www.mysite.com/headertags_seo_db_handler.php, then there is another installation text file in Use_if_version_Phoenix_V_1.0.7.4_and_later which says to use https://www.yoursite.com/headertags_seo_db_handler_hybrid.php

I apologize for the problems this caused. Managing more than one version of oscommerce has always been bothersome but now with multiple versions of Phoenix included, it gets a little harder.

For the View Result box entry disappearing and the details going away when the default tags are set,  they are working find for me here so I may have made some change that fixes them. 

1 hour ago, geoffreywalton said:

One question that occurred to me digging around is should header tags have a unique key page_name/language_id?

Maybe on a very large site. 

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

I put it down as my fault for not actually reading all the instructions carefully but am looking at the non updating to see if I can debug it.

Cheers

Geoffrey

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

Problem between keyboard and seat!!!!!

The first "Submit Query" updates both the Default Tags and Meta Tags whereas I was using the Save button, seemed logical to me!!!

Cheers

Geoffrey

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

  • 3 weeks later...

Hello Jack,

With Phoenix 1.0.7.14 of course I can not adapt the categories.php with the Header Tags code. I know you must be overwhelmed with work as Phoenix upgrades so often but when you have a chance if you could just take a look. I appreciate it.  Have a good night.

Link to comment
Share on other sites

Categories Edit problems found:

 

categories.php?xxxxxxxxxxxxxx&action=edit_category

Notice: Undefined index: id in /admin/includes/header_tags_seo/htc_categories_display.php on line 9

Notice: Trying to access array offset on value of type null in /admin/includes/functions/header_tags_general.php on line 27

 

Phoenix 1.0.7.14

PHP 7.4

Link to comment
Share on other sites

On 2/4/2021 at 5:39 AM, Jack_mcs said:

A version for 1.0.7.14 hasn't been released.

Pardon my ignorance, but isn't the whole point of having a "core" is so add-ons don't continuously have to be updated every time there is an update? Trying to wrap my head around why a Phoenix update would break so many free add-ons.

The water in a vessel is sparkling; the water in the sea is dark. The small truth has words which are clear; the great truth has great silence.

- Rabindranath Tagore

Link to comment
Share on other sites

3 hours ago, Smoky Barnable said:

Trying to wrap my head around why a Phoenix update would break so many free add-ons.

The changes in Phoenix will sometimes change the code to where it is no longer recognized by the code in addons. For example, a function may be moved to a class so the code in the addon can't find the function any longer. There's no way for developers to plan for this so we just have to react after the fact. But as soon as we upload a new version of the addon, the code in Phoenix changes and breaks the addon again. Testing the addon with the new version of Phoenix, identifying the new problems, fixing the code and then uploading the new version of an addon is not a small job so upgrading can't be done for every version of Phoenix. Unfortunately, there's just no way around it.

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

Core is always evolving and getting better, it will eventually end up in a place where everything can be done without core being affected at all.  To get to that place means some "hurt" for existing addons. What we have is a small team of addon developers who are actively involved in helping Matt @ecartz and myself to "bend" the core code to better suit their addon needs, which means their addons become much easier to install.

Think back to the days of 2.2 (or even 2.3) where you would see addons changing core code on lots of different pages to do something.  We've massively reduced that with the help of supportive addon makers and supportive shopowners.  

On the flip side of that coin are the addon makers and shopowners who have zero input into the core code.  If one has zero input, one should expect to have to deal with problems as they arise, rather than know upcoming problems in advance.

I can summarise this as so:

The core does not stand still because of addons.  

Link to comment
Share on other sites

22 hours ago, Jack_mcs said:

The changes in Phoenix will sometimes change the code to where it is no longer recognized by the code in addons. For example, a function may be moved to a class so the code in the addon can't find the function any longer. There's no way for developers to plan for this so we just have to react after the fact. But as soon as we upload a new version of the addon, the code in Phoenix changes and breaks the addon again. Testing the addon with the new version of Phoenix, identifying the new problems, fixing the code and then uploading the new version of an addon is not a small job so upgrading can't be done for every version of Phoenix. Unfortunately, there's just no way around it.

Jack, we tried messaging you and calling you on the phone.  What is the best method of speaking to you?

Link to comment
Share on other sites

  • 2 weeks later...

A new version has been uploaded with these changes:

  • Changed the code in the HTS display module in admin to prevent php warnings.
  • Changed the code in the HTS test file in admin to prevent php warnings.
  • Changed the code in admin/categories.php to automatically fill in the stock SEO fields. Found by @alix32.
  • Changed code on the keywords page to fix errors in the position code.
  • Changed code in the test file to fix errors.
  • Changed code in the Version Checker for php warning.
  • Corrected link in Version Checker that gave incorrect results.
  • Corrected the install instructions. Found by @geoffreywalton.
  • Moved the keyword search handler to a hook in Phoenix.
  • Removed some unused defines left over from a previous version.

Notes:

1 - The only changes are for the -14 and -15 Phoenix versions. Though the -14 changes will apply to some previous versions.

2 - Don't rely on the change instructions for the categories.php file. Due to the changes to that file with each Phoenix release, it is just not feasible to keep the install instructions updated. Use a compare program to find the needed changes.

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

20 hours ago, Jack_mcs said:

A new version has been uploaded with these changes:

  • Changed the code in the HTS display module in admin to prevent php warnings.
  • Changed the code in the HTS test file in admin to prevent php warnings.
  • Changed the code in admin/categories.php to automatically fill in the stock SEO fields. Found by @alix32.
  • Changed code on the keywords page to fix errors in the position code.
  • Changed code in the test file to fix errors.
  • Changed code in the Version Checker for php warning.
  • Corrected link in Version Checker that gave incorrect results.
  • Corrected the install instructions. Found by @geoffreywalton.
  • Moved the keyword search handler to a hook in Phoenix.
  • Removed some unused defines left over from a previous version.

Notes:

1 - The only changes are for the -14 and -15 Phoenix versions. Though the -14 changes will apply to some previous versions.

2 - Don't rely on the change instructions for the categories.php file. Due to the changes to that file with each Phoenix release, it is just not feasible to keep the install instructions updated. Use a compare program to find the needed changes.

Hi Jack,

Thank you for the update. I do have several issues. On Phoenix 1.0.7.15 the categories seo title and description were not saving so I had to change line 74-77 :

================================

           /*** Begin Header Tags SEO ***/
            'products_seo_title' => Text::prepare(strip_tags((tep_not_null($_POST['products_seo_title'][$language_id]) ? str_replace('"', '"', $_POST['products_seo_title'][$language_id]) : str_replace('"', '"', $_POST['products_name'][$language_id])))),
            'products_seo_description' => Text::prepare(strip_tags((tep_not_null($_POST['products_seo_description'][$language_id]) ? str_replace('"', '"', $_POST['products_seo_description'][$language_id]) : str_replace('"', '"', $_POST['products_name'][$language_id])))),
            'products_seo_keywords' => Text::prepare(strip_tags((tep_not_null($_POST['products_seo_keywords'][$language_id]) ? str_replace('"', '"', $_POST['products_seo_keywords'][$language_id]) : str_replace('"', '"', $_POST['products_name'][$language_id])))),

===========================

TO:

            'categories_seo_description' => Text::prepare($_POST['categories_seo_description'][$l['id']]),
            'categories_seo_title' => Text::prepare($_POST['categories_seo_title'][$l['id']]),
            'categories_seo_keywords' => Text::prepare($_POST['categories_seo_keywords'][$l['id']]),

Also the  'categories_htc_title_tag_alt' ,  'categories_htc_title_tag_url'  and  'categories_htc_breadcrumb_text'  only show in one language and do not fill (same for editing a product)

Lastly, the following warnings in the logs :

1 - PHP Warning:  Illegal offset type in /xx/xx/xx/xx/admin/categories.php on line 78 (and 79, 80)

-line 78-80 : 

          'categories_htc_title_tag_alt' => Text::prepare(strip_tags((tep_not_null($_POST['categories_htc_title_tag_alt'][$l]['id']) ? str_replace('"', '"', $_POST['categories_htc_title_tag_alt'][$l]['id']) : str_replace('"', '"', $_POST['categories_name'][$l]['id'])))),
          'categories_htc_title_tag_url' => Text::prepare(strip_tags((tep_not_null($_POST['categories_htc_title_tag_url'][$l]['id']) ? str_replace('"', '"', $_POST['categories_htc_title_tag_url'][$l]['id']) : str_replace('"', '"', $_POST['categories_name'][$l]['id'])))),
          'categories_htc_breadcrumb_text' => Text::prepare(strip_tags((tep_not_null($_POST['categories_htc_breadcrumb_text'][$l]['id']) ? str_replace('"', '"', $_POST['categories_htc_breadcrumb_text'][$l]['id']) : str_replace('"', '"', $_POST['categories_name'][$l]['id'])))),



2 - PHP Notice:  Undefined index: id in /xx/xx/xx/xx/admin/includes/header_tags_seo/htc_categories_display.php on line 9

These are beyond my competances! Thank you Jack.
 


 

Link to comment
Share on other sites

@artfulwebFor the first change you made, you replaced product handling code with category handling code so that won't work. For problem #1, that may be related to that incorrect change. For problem #2, it appears you didn't upload the new file for v 15. Previous versions of Phoenix changed language_id to id. In  v 15, some, but not all, of those changes were reversed. That's the only reason a version of this addon was needed for 15 .

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

39 minutes ago, Jack_mcs said:

@artfulwebFor the first change you made, you replaced product handling code with category handling code so that won't work. For problem #1, that may be related to that incorrect change. For problem #2, it appears you didn't upload the new file for v 15. Previous versions of Phoenix changed language_id to id. In  v 15, some, but not all, of those changes were reversed. That's the only reason a version of this addon was needed for 15 .

Sorry Jack, it was 

           /*** Begin Header Tags SEO ***/
          'categories_seo_title' => Text::prepare(strip_tags((tep_not_null($_POST['categories_seo_title'][$l]['id']) ? str_replace('"', '"', $_POST['categories_seo_title'][$l]['id']) : str_replace('"', '"', $_POST['categories_name'][$l]['id'])))),
          'categories_seo_description' => Text::prepare(strip_tags((tep_not_null($_POST['categories_seo_description'][$l]['id']) ? str_replace('"', '"', $_POST['categories_seo_description'][$l]['id']) : str_replace('"', '"', $_POST['categories_name'][$l]['id'])))),
          'categories_seo_keywords' => Text::prepare(strip_tags((tep_not_null($_POST['categories_seo_keywords'][$l]['id']) ? str_replace('"', '"', $_POST['categories_seo_keywords'][$l]['id']) : str_replace('"', '"', $_POST['categories_name'][$l]['id'])))),


 that I changed to 

            'categories_seo_description' => Text::prepare($_POST['categories_seo_description'][$l['id']]),
            'categories_seo_title' => Text::prepare($_POST['categories_seo_title'][$l['id']]),
            'categories_seo_keywords' => Text::prepare($_POST['categories_seo_keywords'][$l['id']]),
         /*** Begin Header Tags SEO ***/

 

and for products

            'products_seo_title' => Text::prepare(strip_tags((tep_not_null($_POST['products_seo_title'][$language_id]) ? str_replace('"', '"', $_POST['products_seo_title'][$language_id]) : str_replace('"', '"', $_POST['products_name'][$language_id])))),
            'products_seo_description' => Text::prepare(strip_tags((tep_not_null($_POST['products_seo_description'][$language_id]) ? str_replace('"', '"', $_POST['products_seo_description'][$language_id]) : str_replace('"', '"', $_POST['products_name'][$language_id])))),
            'products_seo_keywords' => Text::prepare(strip_tags((tep_not_null($_POST['products_seo_keywords'][$language_id]) ? str_replace('"', '"', $_POST['products_seo_keywords'][$language_id]) : str_replace('"', '"', $_POST['products_name'][$language_id])))),

TO:

            'products_seo_description' => Text::prepare($_POST['products_seo_description'][$language_id]),
            'products_seo_keywords' => Text::prepare($_POST['products_seo_keywords'][$language_id]),
            'products_seo_title' => Text::prepare($_POST['products_seo_title'][$language_id]),
 

 

Link to comment
Share on other sites

15 minutes ago, artfulweb said:

Sorry Jack, it was 

           /*** Begin Header Tags SEO ***/
          'categories_seo_title' => Text::prepare(strip_tags((tep_not_null($_POST['categories_seo_title'][$l]['id']) ? str_replace('"', '"', $_POST['categories_seo_title'][$l]['id']) : str_replace('"', '"', $_POST['categories_name'][$l]['id'])))),
          'categories_seo_description' => Text::prepare(strip_tags((tep_not_null($_POST['categories_seo_description'][$l]['id']) ? str_replace('"', '"', $_POST['categories_seo_description'][$l]['id']) : str_replace('"', '"', $_POST['categories_name'][$l]['id'])))),
          'categories_seo_keywords' => Text::prepare(strip_tags((tep_not_null($_POST['categories_seo_keywords'][$l]['id']) ? str_replace('"', '"', $_POST['categories_seo_keywords'][$l]['id']) : str_replace('"', '"', $_POST['categories_name'][$l]['id'])))),


 that I changed to 

            'categories_seo_description' => Text::prepare($_POST['categories_seo_description'][$l['id']]),
            'categories_seo_title' => Text::prepare($_POST['categories_seo_title'][$l['id']]),
            'categories_seo_keywords' => Text::prepare($_POST['categories_seo_keywords'][$l['id']]),
         /*** Begin Header Tags SEO ***/

 

and for products

            'products_seo_title' => Text::prepare(strip_tags((tep_not_null($_POST['products_seo_title'][$language_id]) ? str_replace('"', '"', $_POST['products_seo_title'][$language_id]) : str_replace('"', '"', $_POST['products_name'][$language_id])))),
            'products_seo_description' => Text::prepare(strip_tags((tep_not_null($_POST['products_seo_description'][$language_id]) ? str_replace('"', '"', $_POST['products_seo_description'][$language_id]) : str_replace('"', '"', $_POST['products_name'][$language_id])))),
            'products_seo_keywords' => Text::prepare(strip_tags((tep_not_null($_POST['products_seo_keywords'][$language_id]) ? str_replace('"', '"', $_POST['products_seo_keywords'][$language_id]) : str_replace('"', '"', $_POST['products_name'][$language_id])))),

TO:

            'products_seo_description' => Text::prepare($_POST['products_seo_description'][$language_id]),
            'products_seo_keywords' => Text::prepare($_POST['products_seo_keywords'][$language_id]),
            'products_seo_title' => Text::prepare($_POST['products_seo_title'][$language_id]),
 

 

Oh, plus I did overwrite all the HTC files with the new ones from "Use_if_version_Phoenix_V_1.0.7.15_and_later" but without the above changes when editing a product or category the header tags title, description and key words so not save.

Link to comment
Share on other sites

I don't know what to tell you. The code works fine here in two 15 shops. If the changes work for you, then they will be fine other that allowing invalid characters into the SEO fields, if present.

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

PHP 7.0

caught a few problems:
Social -> Notice: Undefined variable: storeName in /administracao/header_tags_seo_ajax.php on line 22

and if you disable the social and press save it does says "  Data Save was successful " but the icons stills shows up at product_info

 

If you Install: Breadcrumb - Header Tags and Remove (or dont):  Breadcrumb ->

Fatal error: Uncaught Error: Call to undefined method category_tree::getData() in /includes/modules/content/header/cm_header_breadcrumb_headertags.php:52 Stack trace: #0 /includes/system/versioned/1.0.7.9/osc_template.php(106): cm_header_breadcrumb_headertags->execute() #1 /templates/default/includes/components/header.php(15): oscTemplate->getContent('header') #2 /templates/override/includes/components/template_top.php(61): require('/xxx...') #3 /templates/default/includes/pages/product_info.php(13): require('/xxx...') #4 /loja/product_info.php(25): require('/xxx...') #5 {main} thrown in /includes/modules/content/header/cm_header_breadcrumb_headertags.php on line 52

 

Link to comment
Share on other sites

@Owl SauronThe attached should fix all of the issues you found. Just upload the files over the existing ones to apply.

HTS_QUCIK_FIX.zip

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

PHP 7.0

other previous bugs:

cm_pi_description_headertags.php (content product_info) has a problem. When you try to install that module it does not show with a module name and after installed it gets inactive.

 

it did fixed a few and new ones came:

Fatal error: Uncaught Error: Call to undefined method category_tree::getData() in /includes/modules/content/index_nested/cm_in_category_listing_headertags.php:27 Stack trace: #0 /includes/system/versioned/1.0.7.9/osc_template.php(106): cm_in_category_listing_headertags->execute() #1 /templates/default/includes/pages/index.php(23): oscTemplate->getContent('index_nested') #2 /index.php(17): require('/xxx...') #3 {main} thrown in /includes/modules/content/index_nested/cm_in_category_listing_headertags.php on line 27

 

Recreate these steps:

catalog-> Fruit gives the above error

catalog-> Vegetables messes the site structure

 

 

 

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