Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Header Tags SEO


Jack_mcs

Recommended Posts

@Jack_mcs

more on this addon…

/Use_if_version_BootStrap/catalog_only_new_files/includes/modules/header_tags_social_bookmarks.php

 

In this file there is code calling for the /ext/javascript/plusone.js file. After doing a site search, this is the only place where this file is called. So,.. that plusone.js file can be removed and the call replaced with the following for a cached copy of it from Google.

echo '<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>';

Though better yet,… you could remove that code block along with the database install code for Google Plus because Google Plus is no longer in existence.

Edited by Demitry

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Link to comment
Share on other sites

Also, in the /includes/header_tags.php file, you can combine the noodp and noydir meta tags into one. This should also reduce the related database configuration by one setting.

So, ..from this:

if ($defaultTags['meta_noodp'])     echo '<meta name="robots" content="noodp" />' . "\n";
if ($defaultTags['meta_noydir'])    echo '<meta name="slurp" content="noydir" />' . "\n";

to this:

if ($defaultTags['meta_noodp'])     echo '<meta name="robots" content="noodp,noydir" />' . "\n";

Reference article:  https://www.seoworkers.com/seo-articles-tutorials/using-noodp-and-noydir.html

 

 

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Link to comment
Share on other sites

more....

These files have no changes in them.

/Use_if_version_BootStrap/catalog/includes/.htaccess

/Use_if_version_BootStrap/catalog/includes/modules/content/index_nested/cm_in_category_description.php

/Use_if_version_BootStrap/catalog/includes/modules/content/index_nested/cm_in_category_listing.php

 

/Use_if_version_BootStrap/catalog_only_new_files/admin/header_tags_seo_popup_help.php - just calls the application_top file with no other code content.

/Use_if_version_BootStrap/catalog/index.php - (int)$HTTP_GET_VARS['manufacturers_id'] should be (int)$ _GET ['manufacturers_id']

/Use_if_version_BootStrap/catalog/product_info.php - echo "<a name=\"\$header_tags_array['title']\"></a>"; has an extra back-slash before the variable and really should be: echo '<a name="' . $header_tags_array['title'] . '"></a>';

/Use_if_version_BootStrap/catalog_only_new_files/admin/includes/functions/header_tags.php - font-size:10ps; should be font-size:10px; (2 instances – lines 213 and 214)

 

 

 

Edited by Demitry

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Link to comment
Share on other sites

7 hours ago, ce7 said:

so my question is that on main-oscommerce.com I tried to add the missing page under page control, update "index.htm"
but it seems ony read .php files, is it possible to add Tag / meta for this separated index.htm?

This addon can only work with php files and then only if they are part of the shop. If you have a non-php file,  you will need to add them manually to that 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

hi Jack,

In this file there is a style tag inside of an inline style tag for the Additional Words field.

/Use_if_version_BootStrap/catalog_only_new_files/admin/includes/modules/header_tags_seo.php 

And I rewrote that file for better formatting of the titles and fields. I used a table structure because the divs were messed up and frankly, it was easier to do it this way. File is attached and below is a screenshot of how it is formatted now.

HTSEO-categories-page-module.thumb.png.ccaf86ccede6d0845f880182f1de540a.png

header_tags_seo.php

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Link to comment
Share on other sites

@Jack_mcs

hi Jack,

Question for you about the purpose of the "currently viewing" link. I noticed that BS Edge product_info.php page has this same link for the product title and both, the "currently viewing" link and that product page title link reload the same page.

This is confusing for the user, and for bots it sends them into a loop. That's something search engines don't like too much on either front. They already have this issue with the logo image link on the home page. Is there another purpose for these two links that I am not aware of?

 

Edited by Demitry

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Link to comment
Share on other sites

@DemitryThe search engines follow all links on a page and those links count towards PageRank (maybe). It doesn't matter that it is to the same page. It won't cause a loop. They will follow the link and mark where it goes to and where it came from. When the page is visited again, they will see that they have already been there and not keep following it.

The link was more important in years past when PageRank was more easily tracked. But since google started hiding details about PageRank about five years ago, it is unknown how much internal links help.  That's why I said "maybe".  I think it still helps but some shop owners never have liked having it there, for whatever reason, and is why I added an option to turn it off.

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

  • 4 weeks later...

@Jack_mcs

hi Jack,

Question for you,.. I had to combine some code from my old MS2.2 admin/categories.php file and the new BS Edge version (on PHP 7.2). In doing this I came across a problem where some of the custom code I had did not work without the page preview option.

So, the problem is with the Back button on that preview page. When I go back to the categories.php product update page, all fields contain their related data except the product name and all of the fields for the header tags. Those fields are all empty.

I’ve been trying to find where this issue is located, but with no luck. My old MS2.2 site does not have this problem.

I even changed all instances of the deprecated each() function in the BS Edge version and still cannot get those HT SEO fields to display any content when going back to the product update page from the preview. Any idea of what it can be or where I should look?

 

Edited by Demitry

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Link to comment
Share on other sites

@DemitryThere is a section of code for the preview section that no longer exists since the preview was removed from CE. The code is still in the pre-2.3 file so you can get it from there. I think that will fix 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

@Jack_mcs

yeah, I've been using a comparison tool to find this part in both my MS2.2 related file and the one in your addon package in the Use_if_version_lessthan_2.3 folder. I cannot seem to locate it.

 

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Link to comment
Share on other sites

Thanks Jack,

I looked at that a number of times, but there is not much difference between the new BS Edge categories.php file, my older MS2.2 file and the Use_if_version_lessthan_2.3 folder file in regards to this section. The product preview code is the same (except for the custom images code I have). The issue is with keeping the text content value in the HT SEO fields when going back from the preview via the back button. That back button has a parameter of name="edit" ..I could not find anything related to that. So, could that be it? or is that parameter not utilized?

 

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Link to comment
Share on other sites

Maybe you are looking at an edited file? The one included in V 3.3.5 has the following code:

  } elseif ($action == 'new_product_preview') {
    if (tep_not_null($HTTP_POST_VARS)) {
      $pInfo = new objectInfo($HTTP_POST_VARS);
      $products_name = $HTTP_POST_VARS['products_name'];
      $products_description = $HTTP_POST_VARS['products_description'];
      $products_head_title_tag = $HTTP_POST_VARS['products_head_title_tag'];
      $products_head_title_tag_alt = $HTTP_POST_VARS['products_head_title_tag_alt'];
      $products_head_title_tag_url = $HTTP_POST_VARS['products_head_title_tag_url'];
      $products_head_desc_tag = $HTTP_POST_VARS['products_head_desc_tag'];
      $products_head_keywords_tag = $HTTP_POST_VARS['products_head_keywords_tag'];
      $products_head_breadcrumb_text = $HTTP_POST_VARS['products_head_breadcrumb_text'];
      $products_head_listing_text = $HTTP_POST_VARS['products_head_listing_text'];
      $products_head_sub_text = $HTTP_POST_VARS['products_head_sub_text'];
      $products_head_additional_words = $HTTP_POST_VARS['products_head_additional_words'];
      $products_url = $HTTP_POST_VARS['products_url'];

 

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

yeah, mine is the same. see below:

  } elseif ($action == 'new_product_preview') {
    if (tep_not_null($_POST)) {
      $pInfo = new objectInfo($_POST);
      $products_name = $_POST['products_name'];
      $products_description = $_POST['products_description'];
      $products_url = $_POST['products_url'];
// BOF: Header Tags SEO
      $products_head_title_tag = $_POST['products_head_title_tag'];
      $products_head_title_tag_alt = $_POST['products_head_title_tag_alt'];
      $products_head_title_tag_url = $_POST['products_head_title_tag_url'];
      $products_head_desc_tag = $_POST['products_head_desc_tag'];
      $products_head_keywords_tag = $_POST['products_head_keywords_tag'];
      $products_head_breadcrumb_text = $_POST['products_head_breadcrumb_text'];
      $products_head_listing_text = $_POST['products_head_listing_text'];
      $products_head_sub_text = $_POST['products_head_sub_text'];
      $products_head_additional_words = $_POST['products_head_additional_words'];
// EOF: Header Tags SEO

 

I also thought that it might be in this block which is a bit further down for the preview page. Here I have one of the deprecated each() functions updated, but it makes no difference either way in terms of the issue at hand.

      reset($_POST);
      //while (list($key, $value) = each($_POST)) {
      foreach($_POST as $key => $value) {
        if (!is_array($_POST[$key])) {
          echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
        }
      }
	  
      $languages = tep_get_languages();
      for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
        echo tep_draw_hidden_field('products_name[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_name[$languages[$i]['id']])));
        echo tep_draw_hidden_field('products_description[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_description[$languages[$i]['id']])));
      // BOF: Header Tags SEO
        echo tep_draw_hidden_field('products_head_title_tag[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_head_title_tag[$languages[$i]['id']])));
        echo tep_draw_hidden_field('products_head_title_tag_alt[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_head_title_tag_alt[$languages[$i]['id']])));
        echo tep_draw_hidden_field('products_head_title_tag_url[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_head_title_tag_url[$languages[$i]['id']])));
        echo tep_draw_hidden_field('products_head_desc_tag[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_head_desc_tag[$languages[$i]['id']])));
        echo tep_draw_hidden_field('products_head_keywords_tag[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_head_keywords_tag[$languages[$i]['id']])));
        echo tep_draw_hidden_field('products_head_breadcrumb_text[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_head_breadcrumb_text[$languages[$i]['id']])));
        echo tep_draw_hidden_field('products_head_listing_text[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_head_listing_text[$languages[$i]['id']])));
        echo tep_draw_hidden_field('products_head_sub_text[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_head_sub_text[$languages[$i]['id']])));
        echo tep_draw_hidden_field('products_head_additional_words[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_head_additional_words[$languages[$i]['id']])));
      // EOF: Header Tags SEO
        echo tep_draw_hidden_field('products_url[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_url[$languages[$i]['id']])));
      }

 

So,.. what I did was to replace the categories.php file with the one from the less than 2.3 version. And after replacing all the directory and filename definitions for a basic test run, I went through to the preview page and then clicked the Back button and the result was the same -- all of the fields for the header_tags_seo.php module were empty.

I tried doing the same thing by swapping out the header_tags_seo.php module, which is where all the HT fields are coming up empty, with no change. I cannot seem to pin point it. Maybe it's something else that PHP7.2 doesn't like.

 

Edited by Demitry

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Link to comment
Share on other sites

I don't have an answer for you. There's no way for me to test pre-2.3 code with 7.2 short of setting up a special file for that purpose and that's beyond what I can do in a support thread. I think you would be better off figuring out how to get rid of the preview code. There's really no reason to have it that I can see. It just adds another step in managing the product.

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

Quote

There's really no reason to have it that I can see. It just adds another step in managing the product.

For the most part I agree, but I have custom image code that is not part of osC and it creates folders inside the catalog/image folder and uploads images to that folder. So, I have to figure out how to integrate that code with insert product and update product instead of using it for preview. Or keep the preview and possibly use localStorage for those fields.

I'll figure something out, thanks.

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Link to comment
Share on other sites

  • 4 weeks later...

admin/includes/functions/header_tags.php line 104

    if (($fileSaved && $cntNewFiles) || (! $fileSaved && (count($existingFiles) != $cntNewFiles))) {     

count($existingFiles)

Notice: Undefined variable: existingFiles

Warning: count(): Parameter must be an array or an object that implements Countable

$existingFiles is not an array or object

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

1 hour ago, 241 said:

Notice: Undefined variable: existingFiles

Thank you for reporting this. The $existingFiles was changed to $existingInDB several versions ago but that one instance was missed. Changing it to  $existingInDB should fix the issue.

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

No worries got a few more for you

admin/header_tags_fill_tags.php
Notice: Undefined variable: sleep in admin/header_tags_fill_tags.php on line 703
Notice: Undefined variable: sleep in admin/header_tags_fill_tags.php on line 704

missing initial declaration for the variable $sleep outside of action
either
  $sleep = '';
or
  $sleep = false;


admin/header_tags_seo_keywords.php
Notice: Undefined index: date in admin/header_tags_seo_keywords.php on line 371
Notice: Undefined index: searches in admin/header_tags_seo_keywords.php on line 372
Notice: Undefined index: google_last_position in admin/header_tags_seo_keywords.php on line 373

admin/header_tags_seo_silo.php
Notice: Undefined offset: 1 in admin/header_tags_seo_silo.php on line 152
Notice: Undefined offset: 1 in admin/header_tags_seo_silo.php on line 156
Notice: Undefined offset: 1 in admin/header_tags_seo_silo.php on line 162 Date
Notice: Undefined offset: 1 in admin/header_tags_seo_silo.php on line 163 Name
Notice: Undefined offset: 1 in admin/header_tags_seo_silo.php on line 164 Best Seller
Notice: Undefined offset: 1 in admin/header_tags_seo_silo.php on line 165 Custom
Notice: Undefined offset: 1 in admin/header_tags_seo_silo.php on line 171
Notice: Undefined variable: selectedCats in admin/header_tags_seo_silo.php on line 174

admin/header_tags_seo_social.php
Notice: Undefined index: 24x24 in admin/header_tags_seo_social.php on line 245
Notice: Undefined index: 32x32 in admin/header_tags_seo_social.php on line 245
Notice: Undefined index: 48x48 in admin/header_tags_seo_social.php on line 245
Notice: Undefined index: creator in admin/header_tags_seo_social.php on line 306

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Warnings like the above are probably in quite a few of the files. The last update was over three years ago and at that time, as I recall, php 5.6 was just starting to be widely used by oscommerce shop owners.  I have fixed quite a few already but they are in the unreleased version. I do plan on releasing it but all I can say for now is that it will be sometime  this year. :sad: But please, anyone, feel free to post problems you find.

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

no worries these are not problems for me I have fixed, just thought to bring them to your attention in case you were unaware

A thought that you may want to use is_countable for future php  (PHP 7 >= 7.3.0) it can be implemented in compatibility mode now  as a function will help with all your count()

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

45 minutes ago, 241 said:

A thought that you may want to use is_countable for future php

Thanks but oscommerce won't run past 7.2, not even on 7.2 without changes, so using a 7.3 function is not of much use. I'm not familiar with a compatibility mode but I doubt it makes things compatible with php 5.4, which I still support since many of my clients have old shops. It's easy enough to write my own, of course, but I can't remember to check what is being counted I doubt I would remember to call a new 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

  • 1 month later...

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