Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Header Tags SEO


Jack_mcs

Recommended Posts

@@Jack_mcs

 

small bug - but I'm pulling my hair out looking where to fix it.

per https://developers.facebook.com/tools/debug/

 

<meta property="og:locale" content="en-US" />

 

should be using   en_US

 

Where do I sort that?

 

Also, FB wants images at least 200x200. All my main images are too small - is it possible to use the first large image if available, if not existing, then default main image?

 

Thanks as usual... :)

Edited by Roaddoctor

-Dave

Link to comment
Share on other sites

For those that might want the code change for the first problem, change this line in the includes/modules/header_tags_opengraph.php file

$ogArray['locale']  = $loc[0];

to

$ogArray['locale']  = str_replace('-', '_', $loc[0]);

For the image problem, that is a difficult one to do automatically since there are many possibilities between sites and I try to code for the vast majority of them. The code loads in the product image (I assume you are talking about products) since that is the only thing that is common across all versions of oscommerce. A field could be added in admin for it but that's a lot of extra work for the shop owner. I suppose a setting could be used to provide the database name of the alternate field. But short of that, you can just edit the MySQL call in the above file and have it load whichever image you want to use.

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

 

Good morning. Little question about includes/functions/header_tags.php. I see this

Error: Use of undefined constant DIR_WS_BOXES - assumed 'DIR_WS_BOXES'

File: includes/functions/header_tags.php

Line: 213

I have DIR_WS_BOXES defined in admin configure, but do not see it on shop side. The code looks like your breaking into 2.2 vs 2.3, is my configure correct or is it correct as is?  just trying to understand

/*****************************************************************
Used to retrieve a link for a tag cloud keyword
*****************************************************************/
function GetHTSTagCloudLink($keyword, $languages_id) {
    $quotes = (defined('QUOTES_CATEGORY_NAME')) ? " and p.customers_email_address = '' and p.quotes_email_address = '' " : '';
  
    $kwrd = tep_db_input($keyword);

    $searchDesc = '';
    $boxLocn = DIR_WS_BOXES . 'search.php';
    if (file_exists(DIR_WS_INCLUDES . 'template_top.php')) {  //this is a 2.3 shop
        $boxLocn = DIR_WS_MODULES . 'boxes/bm_search';
    } 
    if (file_exists($boxLocn)) {
        $fileStr = file_get_contents($boxLocn);
        if ($fileStr !== FALSE) {
            if (strpos($fileStr, "search_in_description','1'") !== FALSE) {
                $searchDesc = " or pd.products_description like '%" . $kwrd . "%' ";
            }
        }
    }

-Dave

Link to comment
Share on other sites

When coding an if statement, it is a little faster, and clearer to me, to set one of the conditions before the first if so I do that out of habit. But in this case, it is not correct. It won't hurt anything but will give the error you mention. The code should be like this:

    if (file_exists(DIR_WS_INCLUDES . 'template_top.php')) {  //this is a 2.3 shop
        $boxLocn = DIR_WS_MODULES . 'boxes/bm_search';
    } else {
        $boxLocn = DIR_WS_BOXES . 'search.php';
    }

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

installing HT's 3_3_3_1 on regular osc234

 

in In product_reviews_info.php

FIND (around line 47):
  require(DIR_WS_INCLUDES . 'template_top.php');


ADD BENEATH:
<?php /*** Begin Header Tags SEO ***/
  <a name="<?php echo $header_tags_array['title']; ?>"></a>
  $review['products_name'] = $header_tags_array['title_alt'];


  if (tep_not_null($review['products_model'])) {
    $products_name = $review['products_name'] . '<br><span class="smallText">[' . $review['products_model'] . ']</span>';
  } else {
    $products_name = $review['products_name'];
  }
  /*** End Header Tags SEO ***/ 
<?php /*** End Header Tags SEO ***/ ?>

Dreamweaver giving syntax error 

changed this

  /*** End Header Tags SEO ***/ 
<?php /*** End Header Tags SEO ***/ ?>

tothis

/*** End Header Tags SEO ***/ ?>

but still getting them here.

<?php /*** Begin Header Tags SEO ***/
  <a name="<?php echo $header_tags_array['title']; ?>"></a>
Edited by zpupster
Link to comment
Share on other sites

I think you've made some sort of cut and past error... the block looks like this

  require(DIR_WS_INCLUDES . 'template_top.php');
 /*** Begin Header Tags SEO ***/ ?>
<a name="<?php echo $header_tags_array['title']; ?>"></a>
<?php
  $review['products_name'] = $header_tags_array['title_alt'];

  if (tep_not_null($review['products_model'])) {
    $products_name = $review['products_name'] . '<br><span class="smallText">[' . $review['products_model'] . ']</span>';
  } else {
    $products_name = $review['products_name'];
  }
  /*** End Header Tags SEO ***/ 
?>

-Dave

Link to comment
Share on other sites

ty road dr,

 

i copied that from the instructions.

 

 <?php /*** Begin Header Tags SEO ***/ ?>
<a name="<?php echo $header_tags_array['title']; ?>"></a>
<?php
  $review['products_name'] = $header_tags_array['title_alt'];


  if (tep_not_null($review['products_model'])) {
    $products_name = $review['products_name'] . '<br><span class="smallText">[' . $review['products_model'] . ']</span>';
  } else {
    $products_name = $review['products_name'];
  }
  /*** End Header Tags SEO ***/ 
?>

this worked

Link to comment
Share on other sites

@@zpupster

I haven't looked at the instructions text to see, but if you ever come across something in written instructions and have some sort of issue, use WinMerge or any comparison program to compare the package file to your own. Very helpful sometimes. Backup first...

Edited by Roaddoctor

-Dave

Link to comment
Share on other sites

Jack - Love the work you do and this is an awesome package.

 

That said, I have a weird error that I can't track down. Running OSC 2.3.3.4 and Header Tags SEO 3.3.2.  All tests run fine, no errors.

 

This page (and several like it):

http://mrwnh.com/product_info.php?products_id=100

works fine. But one of the links in the product text is coded as:

<a href="harnesses_from_udogu.php">UDogU Easy-On Dog Harness</a>

but when you hover over it, it converts itself to

mrwnh.com/<strong>Harnesses</strong>_from_udogu.php

and of course if you click on it the page fails.

 

This happens with all products that use this link in the description, not with just this one product.

 

The Product Description as typed into the product itself in Admin looks like this:

<p>Our <b>Teacup Easy-On Harness</b> is made of 1/2" webbing and is designed for a dog measuring 11" to 13" around the ribcage. Please measure your dog carefully using the diagram on the <a href="harness_sizing_for_dogs.php">Harness  Sizing</a> page to avoid having to return your harness for a different size. For more information about our Easy-On Harnesses, please visit <a href="why_use_a_dog_harness.php">Why Use a Harness?</a> and <a href="harnesses_from_udogu.php">UDogU Easy-On Dog Harness</a>.

Only the very LAST link in the paragraph has this problem.

 

I think it maybe has something to do with SEO Header Tags bolding the keyword "harness" in the URL? But it doesn't seem to happen with the other links that include the same word.

 

Any ideas?

Edited by robinwarren
Link to comment
Share on other sites

Yes, it is probably because of the keyword highlighter. You can turn that off to check it. Although, you shouldn't use links like that in the products description. The embed link is meant for that purpose. The highlighter might still cause this problem but at least your links will be correctly formatted.

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

Hello

I need some help with Header Tags Seo in order to get it fully working.

Here is what i've done :

- I've installed a brand new Oscommerce 2.3.4 for test. No add-ons.

- I've also installed the last version of Header Tags Seo (HeaderTags_SEO_V_3.3.3_1) using the instructions in "Use_if_version_greaterthan_2.3" folder.

The install process was ok.
The admin side is ok.
The tags for products, categories, manufacturers and pages are all ok.

But i have problems with the front side of the shop. Here are the main ones.

1) The header-tags social box does not display correctly. No border, no box, only some social icons on white background. When the product page is displayed in internet explorer, the right column of the oscommerce interface is gone. Probably a html tag problem in this box. When the header-tags social box is not displayed, there is no problem. The 2 other boxes works ok.

2) There is a problem with product listing. When "Enable AutoFill - Listing Text" is true, the text is ok.
When i add a personnalised product listing text, it is displayed on top of the product listing, not with the product.

3) Problem on the product page (product_info.php). The product image reverts to old style (open a classic window when clicked to zoom).

 

Has someone already had these problems and found solutions ?

Or is there a bug in my test installation ?
 

Thanks for upcoming replies.

Link to comment
Share on other sites

As mentioned in a previous post, the install instructions may not be correct. That is my fault. It takes a while to create the instructions and now with three versions to maintain, it just came down to a matter of not having enough time. But I can't say for sure that that is the cause of all of your problems. It seems unlikely since I don't think the instructions are that far off. Since this is a new shop, you can just copy the files that are having a problem from the package and see if that fixes them. For the autofill one, replace the includes/modules/product_listing.php file and for the product one, the product_info.php file. Do them one at a time. Make backups of the originals. If replacing the file fixes the problem, download WinMerge, or use any compare program, and compare the two files to see where the mistake is at. I don't suggest just uploading the files and leaving them since I'm not sure which version of 2.3 they use.

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

 

Noticed yesterday that canonical on categories pages was showing /index.php instead of the category  - the mismatch triggers page not-indexable status with google. Clicking thru the categories, I noticed sometimes the /index.php would show, and sometimes the correct url would show.

After scouring this thread, found similar issues but no specific answers, but all related to the cache.

Disabling cache resolves the problem.

 

Any suggestions for me?

-Dave

Link to comment
Share on other sites

The gzip cache option has never worked correctly so if you are using that, try the other method (be sure to clear it using the admin setting). But if that fails too, then turn it off. I haven't changed the cache code in many years and it needs to be re-done but just haven't had the 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

In the past, secure pages should not have been seen by search engines so the code creates the links as non-ssl. But nowadays, some shops are running ssl for the whole shop, which I don't agree with, so for those sites the code will cause problems. If you are not running your site under full ssl, then something is wrong in your shops setup since those pages should not be visible to the search engines. If you are running your shop with full ssl, then you will need to edit the includes/header_tags.php and includes/functions/header_tags,php files and change the NONSSL entries to SSL.

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

What about having canonical correct regardless of SSL or NONSSL, and of course use Robot NoIndex Module properly to set no-index.

good idea or not?

includes/functions/header_tags.php

function GetCanonicalURL() {
  global $request_type;  // testing

  $parts = explode("&", $_SERVER['QUERY_STRING']);
  $cnt = count($parts);
  $args = array(); // testing

  if ($cnt == 1 && basename($_SERVER['SCRIPT_FILENAME']) === FILENAME_DEFAULT) { //home page
     global $cPath,$category_depth;

     if (tep_not_null($cPath) || (isset($_GET['manufacturers_id']) && $category_depth == 'top')) {
        $args = tep_get_all_get_params(array('action','currency', tep_session_name(),'cPath','manufacturers_id','sort','page', 'language'));
//        return StripSID(tep_href_link(FILENAME_DEFAULT, $args, 'NONSSL', false) );
        return StripSID(tep_href_link(FILENAME_DEFAULT, $args, $request_type, false) );
     }

//     $url = StripSID(tep_href_link('/', $args, 'NONSSL', false) );
     $url = StripSID(tep_href_link('/', $args, $request_type, false) );

     if (substr($url, -2) == '//') {
         $url = substr($url, 0, -1);       //remove duplicate slashes
     }    
     return $url;    
  }  

  $args = tep_get_all_get_params(array('action','currency', tep_session_name(),'cPath','manufacturers_id','sort','page', 'language'));
//  return StripSID(tep_href_link(basename($_SERVER['SCRIPT_FILENAME']), $args, 'NONSSL', false) );
  return StripSID(tep_href_link(basename($_SERVER['SCRIPT_FILENAME']), $args, $request_type, false) );

}

seems to be functioning as expected.

-Dave

Link to comment
Share on other sites

I haven't tested it but when I get around to making the change, that is the way I would add the ssl code. I don't understand your statement about the no index module. That doesn't exist in this addon.

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, i added this mod and the front end of the site appears to be working fine but my https admin page is all messed up now, its apparently trying to retrieve files over http instead of https on all the files, which files am i going to need to edit to fix the problem. heres what im seeing on the admin.php page load, the folder depicted below named myname depicts my admin folder, sorry if its a newbie question but im new to oscommerce, thanks in advance for any help

 


administrators.php:1 Mixed Content: The page at 'https://www.myserver/myname/administrators.php'was loaded over HTTPS, but requested an insecure script 'http://www.www.myserver/ext/jquery/jquery-1.8.0.min.js'. This request has been blocked; the content must be served over HTTPS.


administrators.php:1 Mixed Content: The page at 'https://www.www.myserver/myname/administrators.php'was loaded over HTTPS, but requested an insecure script 'http://www.www.myserver/ext/jquery/ui/jquery-ui-1.8.22.min.js'. This request has been blocked; the content must be served over HTTPS.


administrators.php:15 Uncaught ReferenceError: $ is not defined


administrators.php:1 Mixed Content: The page at 'https://www.www.myserver/myname/administrators.php'was loaded over HTTPS, but requested an insecure script 'http://www.www.myserver/ext/flot/jquery.flot.js'. This request has been blocked; the content must be served over HTTPS.


administrators.php:20 Mixed Content: The page at 'https://www.www.myserver/myname/administrators.php'was loaded over HTTPS, but requested an insecure stylesheet 'http://www.www.myserver/myname/includes/stylesheet.css'. This request has been blocked; the content must be served over HTTPS.


administrators.php:1 Mixed Content: The page at 'https://www.www.myserver/myname/administrators.php'was loaded over HTTPS, but requested an insecure script 'http://www.www.myserver/myname/includes/general.js'. This request has been blocked; the content must be served over HTTPS.


administrators.php:22 Mixed Content: The page at 'https://www.www.myserver/myname/administrators.php'was loaded over HTTPS, but requested an insecure stylesheet 'http://www.www.myserver/myname/includes/headertags_seo_styles.css'. This request has been blocked; the content must be served over HTTPS.


administrators.php:29 Mixed Content: The page at 'https://www.www.myserver/myname/administrators.php'was loaded over HTTPS, but requested an insecure image 'http://www.www.myserver/myname/images/oscommerce.png'. This content should also be served over HTTPS.


administrators.php:43 Uncaught ReferenceError: $ is not defined


administrators.php:59 Mixed Content: The page at 'https://www.www.myserver/myname/administrators.php'was loaded over HTTPS, but requested an insecure image 'http://www.www.myserver/myname/images/pixel_trans.gif'. This content should also be served over HTTPS.


administrators.php:67 Mixed Content: The page at 'https://www.www.myserver/myname/administrators.php'was loaded over HTTPS, but requested an insecure image 'http://www.www.myserver/myname/images/icons/success.gif'. This content should also be served over HTTPS.


administrators.php:83 Mixed Content: The page at 'https://www.www.myserver/myname/administrators.php'was loaded over HTTPS, but requested an insecure image 'http://www./myname/images/icon_status_green.gif'. This content should also be served over HTTPS.


administrators.php:84 Mixed Content: The page at 'https://www.www.myserver/myname/administrators.php'was loaded over HTTPS, but requested an insecure image 'http://www.www.myserver/myname/images/icon_arrow_right.gif'. This content should also be served over HTTPS.


Navigated to https://www.www.myserver/myname/administrators.php
administrators.php:87 Uncaught ReferenceError: $ is not defined
administrators.php:98 Uncaught ReferenceError: $ is not defined
administrators.php:98 Uncaught ReferenceError: $ is not defined
Edited by Ray59
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...