Jump to content
Jack_mcs

Header Tags SEO

Recommended Posts

How very odd.

My /admin/includes/english.php must have been overwritten to a default recently in an upgrade.

setlocale(LC_ALL, ['en_AU.UTF-8', 'en_AU.UTF8', 'ena_au']);

the other english.php remains like above too.

I've changed it but it remains the same.

Could you direct me in which file its picked up in the addon code and I will see if its my set-up.

Mark

 

Edited by MyBookShop

Share this post


Link to post
Share on other sites

It is in this file:  includes/modules/header_tags_seo/header_tags_opengraph.php

Share this post


Link to post
Share on other sites

Thanks J,

What I think I've learnt.

if (isset($_SERVER["HTTP_ACCEPT_LANGUAGE"])) {
    $loc = explode(',',$_SERVER["HTTP_ACCEPT_LANGUAGE"]);
    $ogArray['locale']  = str_replace('-', '_', $loc[0]);

HTTP_ACCEPT_LANGUAGE is a Apache2/NGNIX variable that's passed thou to PHP and is probably set in the servers config.ini files.

The '<meta property="og:locale" content="en_US" />' is not about location as I thought, but about language, here being English_US style.

So its not important like I thought, changeable, but ultimately not really worth the effort.

Thanks m8

Share this post


Link to post
Share on other sites

Have just installed Header Tags 3.3.12 

I needed to add to catalog_only_new_files\admin\includes\languages\english\header_tags_seo.php

 

define('HEADING_TITLE_HTS', '<b>Errors:</b>');
define('TEXT_CLOSE_POPUP_HTS', 'Close');

Anyway a couple of questions if anyone can help,

1) Even with the permissions for /includes/header_tags.php  set to 777 I still get an error message that the permissions are set to the wrong level, is there a simple way to see if the file is being sucessfully updated so I can happily ignore it?

2) Should there be a button to update the "Deafult Tags" on the Page Control page of header_tags_test.php? I used phpmyadmin to set my values.  In the right column there are 2  "Submit Query" links for the Meta Tags and add a Pseudo Page options.

3) Finally on www.storegalore.co.uk testing on cpath 13 the keywords are not poulated as shown below, any ideas anyone?

 

image.thumb.png.34fa33c8efb02b2e8d2ac884b8a93b52.png

 

header_tags_seo.php


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

Share this post


Link to post
Share on other sites

Hi Geoffrey,

2 hours ago, geoffreywalton said:

1) Even with the permissions for /includes/header_tags.php  set to 777 I still get an error message that the permissions are set to the wrong level, is there a simple way to see if the file is being sucessfully updated so I can happily ignore it?

The code checks the permissions on the includes/header_tags.php file and compares them to those of the images directory. So first compare the two and change the former if different. There is also an option in the settings to ignore the difference. You probably know that it is not a good idea to use permissions of 777 so I suggest changing that, if possible.

 

2 hours ago, geoffreywalton said:

2) Should there be a button to update the "Deafult Tags" on the Page Control page of header_tags_test.php? I used phpmyadmin to set my values.  In the right column there are 2  "Submit Query" links for the Meta Tags and add a Pseudo Page options.

The default tags are set with the same button that sets the meta tags.

 

2 hours ago, geoffreywalton said:

3) Finally on www.storegalore.co.uk testing on cpath 13 the keywords are not poulated as shown below, any ideas anyone?

You have to enter cPath=13 in the View Result box.

Share this post


Link to post
Share on other sites

Thanks for the quick feedback!!

1) The error message showed when the permissions on header_tags.php were 755 and 777. I didn't just want to turn off the error message if something was supposed tpo be writen to this file, so as I suspect the file is updated by actions on this screen wondered if there was a simple test you could recomend. Guess I'll try updating some keywords, accessing that page on the site and seeing if the file size/date time/ contents of header_tags.php  changes.

2) I thought it might be that, but even though I added extra words in the default keywords box and clicked on save and they just disappeared, so I am unable to update them without using phpmyadmin.

3) The screenshot above is after entering "cpath=13" in the box and clicking on view results check box. I would expect "Storage, storage units, Wymondham, Attleborough, Heathersett, Hingham, Barnham Broom, Catfield, Ludham" from the keywords box above to appear in the empty keywords box above the save key, not for it to be empty and highlighted in red.

When entering the same data on the test page, the From Site Meta Keywords field is blank and highlighted in red.

Whilst I am here could I ask if the Keywords screen should be populated automatically? The showing page drop down is empty but the display drop down has 3 values.

 

image.thumb.png.49835fbec4692b0dc65e2e19c9331695.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 ======>>>>>.

Share this post


Link to post
Share on other sites

So I added a search word to the table

INSERT INTO `headertags_keywords` (`id`, `keyword`, `counter`, `last_search`, `google_last_position`, `google_date_position_check`, `found`, `ip_number`, `language_id`) VALUES ('1', 'storage', '1', '0000-00-00 00:00:00.000000', '0', '0000-00-00 00:00:00.000000', '0', '0', '1');

Which disyled on the keywords page but clicking on get position button gave these errors, I am using the from the 1.0.7.4 and later files.

 

image.thumb.png.012e5e88cb18560f7b3ca267208ab602.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 ======>>>>>.

Share this post


Link to post
Share on other sites

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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

admin/header_tags_seo.php -> Check for Updates box

Notice: Undefined offset: 1 in /admin/includes/functions/version_checker.php on line 39

AND

Header Tags SEO V 3.3.11 is the latest version

 

Phoenix 1.0.7.14

PHP 7.4

Share this post


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

Share this post


Link to post
Share on other sites

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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('"', '&quot;', $_POST['products_seo_title'][$language_id]) : str_replace('"', '&quot;', $_POST['products_name'][$language_id])))),
            'products_seo_description' => Text::prepare(strip_tags((tep_not_null($_POST['products_seo_description'][$language_id]) ? str_replace('"', '&quot;', $_POST['products_seo_description'][$language_id]) : str_replace('"', '&quot;', $_POST['products_name'][$language_id])))),
            'products_seo_keywords' => Text::prepare(strip_tags((tep_not_null($_POST['products_seo_keywords'][$language_id]) ? str_replace('"', '&quot;', $_POST['products_seo_keywords'][$language_id]) : str_replace('"', '&quot;', $_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('"', '&quot;', $_POST['categories_htc_title_tag_alt'][$l]['id']) : str_replace('"', '&quot;', $_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('"', '&quot;', $_POST['categories_htc_title_tag_url'][$l]['id']) : str_replace('"', '&quot;', $_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('"', '&quot;', $_POST['categories_htc_breadcrumb_text'][$l]['id']) : str_replace('"', '&quot;', $_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.
 


 

Share this post


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

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

×