Jump to content
Jack_mcs

Header Tags SEO

Recommended Posts

I get an error in the admin

 

Parse error: syntax error, unexpected ':' in /home/xyz/public_html/admin/header_tags_seo.php on line 912

 

Any Idea?

 

I think this is caused by php version, you must change all example:

 

$header_tags_array['title'] ?: $review['products_name']

 

into

 

$header_tags_array['title'] ? $header_tags_array['title'] : $review['products_name']

Share this post


Link to post
Share on other sites

The minimum requirement for the latest version is php 5.3. The code will fail on pre-5.3 servers. The change you mention will work though I think there are other code changes that may be needed as well. It just happens that yesterday was the 3-year anniversary of when support for 5.2 ended - http://www.php.net/eol.php - and it has security holes in it that were fixed in 5.3. If your host is still on 5.2 I strongly suggest you see if they will upgrade or switch to a more secure hosting environment since you have bigger problems than getting this addon to work.

Share this post


Link to post
Share on other sites

I've installed without problems but i've got does Notices on frontpage:

 

Notice: Undefined index: manufacturers_id in /home/xx/public_html/xx/includes/header_tags.php on line 35

Notice: Undefined index: title in /home/xx/public_html/xx/includes/header_tags.php on line 218

Notice: Undefined index: desc in /home/xx/public_html/xx/includes/header_tags.php on line 219

Notice: Undefined index: keywords in /home/xx/public_html/xx/includes/header_tags.php on line 220

Notice: Use of undefined constant store_logo - assumed 'store_logo' in /home/xx/public_html/xx/includes/modules/header_tags_opengraph.php on line 22

Notice: Use of undefined constant png - assumed 'png' in /home/xx/public_html/xx/includes/modules/header_tags_opengraph.php on line 22

Notice: Undefined variable: db in /home/xx/public_html/xx/includes/modules/header_tags_opengraph.php on line 24

Notice: Undefined index: title in /home/xx/public_html/xx/includes/modules/header_tags_opengraph.php on line 26

Notice: Undefined index: desc in /home/xx/public_html/xx/includes/modules/header_tags_opengraph.php on line 27

Notice: Undefined index: logo_text in /home/xx/public_html/xx/includes/header.php on line 29

 

newest oscommerce and newest Header Tags SEO

Edited by slupostrupek

Share this post


Link to post
Share on other sites

All of those, while technically errors, are considered warnings and of little importance. Though the ones for open graph are due to mistakes in the code. You can download a replacement file from here: http://www.oscommerce-solution.com/pub/header_tags_opengraph_3.3.1_fix.zip.

 

For most of the others, the error reporting line in includes/application_top.php should prevent those from showing unless it has been altered or you have some addon installed that overrides it. You can change it to the following though and that may help

error_reporting(E_ALL ^ E_NOTICE);

 

For the last one, that isn't related to this addon.

Share this post


Link to post
Share on other sites

That fix helped only with undefined 'db' and created undefined creator.

 

About store_logo it's reletaed to this addon. It's this line:

<div><div id="storeLogo"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'store_logo.png', (tep_not_null($header_tags_array['logo_text']) ? $header_tags_array['logo_text'] : STORE_NAME)) . '</a></div>';

 

All those notices i've got is because this add doesn't work on index.php.

Share this post


Link to post
Share on other sites

You'll need to turn down the error reporting as mentioned or work on changing the code to fix the rest yourself or, if they bother you and you don't know how to change the code, pay someone to do it for you. I can't provide site-specific fixes in a support forum since that would be all I ever had time for.

Share this post


Link to post
Share on other sites

Is it possible to indicate that content is actually in current language and not the main one:

 

if ($defaultTags['meta_language']) { $langName = explode(",", $_SERVER["HTTP_ACCEPT_LANGUAGE"]); echo ' <meta http-equiv="Content-Language" content="' . $langName[0] . '" >'."\n"; }

 

In ther words, how to get e.g. this:

 

<meta http-equiv="Content-Language" content="it">

Share this post


Link to post
Share on other sites

There is the language meta tag box in Page Control that should do what you want.

Edited by Jack_mcs

Share this post


Link to post
Share on other sites

As far as I can see, there is only one place - default Tags in Page Control. And when I select this option under Meta Tags / Language, I get <meta http-equiv="Content-Language" content="Main Language"> in accordance with the code defined by $langName[0], for all languages.

Share this post


Link to post
Share on other sites

In includes/header_tags.php, find this line

if ($defaultTags['meta_language']) { $langName = explode(",", $_SERVER["HTTP_ACCEPT_LANGUAGE"]); echo ' <meta http-equiv="Content-Language" content="' . $langName[0] . '" >'."\n"; }

Replace with

$lang_query = tep_db_query( "select code from " . TABLE_LANGUAGES . " where languages_id = '" . (int)$languages_id . "'");
$lang = tep_db_fetch_array($lang_query);
if ($defaultTags['meta_language'])  echo ' <meta http-equiv="Content-Language" content="' . $lang['code'] . '" >'."\n";

Share this post


Link to post
Share on other sites

@@Jack_mcs I just wanted to confirm...

 

I didn't think to mention that this last version of Header Tags SEO requires php 5.3. If your host is still running 5.2, or before, don't install this update.

 

Version 3.3.1 is not backward compatible for PHP verions 5.2 or below?

Share this post


Link to post
Share on other sites

No, the line has to be drawn somewhere. With 5.3 nearing EOL, it seems silly to still support 5.2. I thought about not using 5.3 code and about providing a check for 5.2 but that is more work for me and I didn't have the time.

Share this post


Link to post
Share on other sites

Hi Jack,

 

Sorry to ask you another question, but I have an interesting anomaly with one of my 2.3.3.4 sites running header tags seo 3.3.0 on a php 5.4.21 server - and this only seems to affect one site.

 

Sometimes when I visit the site, or a product on the site, the title does not match the category / product - so I need to go to admin / header tags / page control / all pages and hit update - then all is as it should be again.

 

Any ideas what may be causing this?

 

Many Thanks


Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Share this post


Link to post
Share on other sites

Updating Page Control would only affect the settings for the pages as setup in Page Control. Or, in other words, once done, doing again would not make any changes. If that is not the case for you, which it sounds like it isn't, then it would seem a setting is being reset somehow. I've never heard of this problem and can't think of anything that would cause it. I suppose that if the cache option was on, it might cause it, though I don't see how. But you could try turning it off to see if it makes a difference. If you can somehow get it to fail consistently it might help to find the cause.

Share this post


Link to post
Share on other sites

@@Jack_mcs Thanks - I have tried clearing the cache to see if that helps, I will update you if it continues. Im wondering if the configuration cache modification could be causing this - but I dont see how it could.


Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Share this post


Link to post
Share on other sites

I've had problems with that addon not clearing cache with some changes. If the problem still occurs, try deleting the cache file and creating a new one.

Share this post


Link to post
Share on other sites

Hi

 

I'm fairly new to osCommerce I have worked on a number of Zen Cart installations a few years back, I have a client on their own hosting, They are running osCommerce v2.3.1 and they only have PHP 4.4.9 installed on the server, will I still be able to use a version of this plugin?

 

If so which version would you suggest?

 

I will not be able to upgrade their osCommerce or PHP version as it is managed by another company, are there any other plugins you could suggest, my SEO team only need to be able to amend Page Titles and Meta Descriptions on Pages, Categories and Products pages.

 

Thanks

Share this post


Link to post
Share on other sites

You can use version 3.3.0. I will probably remove the 5.3 requirements in the next version because of the large number of servers still using out-dated php versions. I thought for sure that after this amount of time, all hosts would have upgraded but that, it turns out, is far from the fact.

 

If all you want is to change titles and tags, you can use any of the meta tags addons. But none of them would come close to what this one offers and, sooner or later, your SEO team will realize the need the other features.

Share this post


Link to post
Share on other sites

I am running header tags 3.2.9

 

Can I upgrade directly to 3.3.1 without doing 3.3.0 first ?

Share this post


Link to post
Share on other sites

Yes, as long as you perform all of the steps for upgrading to 3.3.1. There are database changes made in the upgrade to 3.3.0 that you will skip if you do that but they are just for keeping the size of the database down and are not required for proper operation.

Share this post


Link to post
Share on other sites

Just installed the latest version. Seems to work great. I wasn't using a file compare program, so I followed the text instructions. Just wanted to mention that instructions for HeaderTags_SEO_V_3.3.1\Use_if_version_greaterthan_2.3\Install_Admin.txt has a few errors:

 

1) Instructions that modify admin/categories.php, the FIND (around line 771) requires an addition with REPLACE WITH: (the PHP tag is missing)

} elseif ($action == 'new_product_preview') {
/*** Begin Header Tags SEO ***/
$product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_title_tag_alt, pd.products_head_title_tag_url, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_head_breadcrumb_text, pd.products_head_listing_text, pd.products_head_sub_text, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'");
/*** End Header Tags SEO ***/

should be

<?php
} elseif ($action == 'new_product_preview') {
/*** Begin Header Tags SEO ***/
$product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_title_tag_alt, pd.products_head_title_tag_url, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_head_breadcrumb_text, pd.products_head_listing_text, pd.products_head_sub_text, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'");
/*** End Header Tags SEO ***/

 

2) Across the file, the folllowing

<br>

needs to change to

<br />

 

Nothing major. Thanks!

Share this post


Link to post
Share on other sites

Yes, as long as you perform all of the steps for upgrading to 3.3.1. There are database changes made in the upgrade to 3.3.0 that you will skip if you do that but they are just for keeping the size of the database down and are not required for proper operation.

 

Thanks Jack.

 

I tried but it isn't going to work if it requires php 5.3. I am running 5.2. My host offers up to 5.4. Tried switching to 5.4 yesterday and crashed all my sites.

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Hello Jack,

I've installed last version and all works fine, but I have a problem with header_tags_seo_social.php in admin side. I can't change any social bookmark.

Google say: "Images and url do not match"

Why?

Thanks

Edited by mau965

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

×