Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Google XML Sitemap SEO


Jack_mcs

Recommended Posts

Some servers have software installed that won't allow setting permissions to 777, which is correct. If you try to set them to 777 and the file is accessed, the 500 error occurs. So 755 is correct in your case, or it sounds like it is. The error is saying it can't find the files. Assuming this addon is installed correctly, that is probably failing due to an incorrectly setup configure file.

 

Hi Jack,

 

Thanks for your reply.

Yes, the admin folder name I had changed for security reason, which did not updated correctly and made the error message appeared. It is fixed and submitted to the google. Most of them all ok, but there is 1 error message, with the sitemappages.xml, it said it doesn't contain any URLs. I am not sure about this one, could you please help to explain what this mean and how can I fix it? Many thanks in advance.

 

Lyn

Link to comment
Share on other sites

When the sitemap files are uploaded, they are empty. The pages file only gets populated if you enable that option in the settings. So it sounds like you told google to look at that file, or maybe they are just grabbing it, and you haven't enabled that option.

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

  • 2 weeks later...

Anything in the works to add product reviews to this sitemap contribution? Search engines love review pages and give them some hefty ranking.

 

 

To have products reviews sitemap:

 

create file sitemapreviews.xml

 

changes:

 

googlesitemap/index.php

 

find:

 

if ($google->GenerateProductSitemap()){

echo 'Generated Google Product Sitemap Successfully' . "\n\n";

} else {

$submit = false;

echo 'ERROR: Google Product Sitemap Generation FAILED!' . "\n\n";

}

after add:

 

if ($google->GenerateProductReviewsSitemap()){

echo 'Generated Google Product Reviews Sitemap Successfully' . "\n\n";

} else {

$submit = false;

echo 'ERROR: Google Product Reviews Sitemap Generation FAILED!' . "\n\n";

}

 

find:

 

echo 'Here is your product sitemap: ' . $google->base_url . 'sitemapproducts.xml' . "\n";

 

after add:

 

echo 'Here is your reviews sitemap: ' . $google->base_url . 'sitemapreviews.xml' . "\n";

 

googlesitemap/sitemap.class.php

 

line 490 add:

 

/**

* Function to generate product reviews sitemap data

* @@author Bobby Easland

* @version 1.1

* @@Return boolean

*/

function GenerateProductReviewsSitemap(){

$quotes = (defined('QUOTES_CATEGORY_NAME') ? " and customers_email_address = '' and quotes_email_address = ''" : '');

$sql = "SELECT products_id as pID, products_date_added as date_added, products_last_modified as last_mod, products_ordered

FROM " . TABLE_PRODUCTS . "

WHERE products_status='1'" . $quotes . "

ORDER BY products_ordered DESC";

if ( $products_query = $this->DB->Query($sql) ){

$this->debug['QUERY']['PRODUCTS']['STATUS'] = 'success';

$this->debug['QUERY']['PRODUCTS']['NUM_ROWS'] = $this->DB->NumRows($products_query);

$container = array();

$number = 0;

$top = 0;

while( $result = $this->DB->FetchArray($products_query) ){

$top = max($top, $result['products_ordered']);

$location = $this->hrefLink(FILENAME_PRODUCT_REVIEWS, 'products_id=' . $result['pID'], 'NONSSL', false);

$lastmod = $this->NotNull($result['last_mod']) ? $result['last_mod'] : $result['date_added'];

$changefreq = GOOGLE_SITEMAP_PROD_CHANGE_FREQ;

$ratio = $top > 0 ? $result['products_ordered']/$top : 0;

$priority = $ratio < .1 ? .1 : number_format($ratio, 1, '.', '');

 

$container[] = array('loc' => htmlspecialchars(utf8_encode($location)),

'lastmod' => date ("Y-m-d", strtotime($lastmod)),

'changefreq' => $changefreq,

'priority' => $priority

);

if ( sizeof($container) >= 50000 ){

$type = $number == 0 ? 'reviews' : 'reviews' . $number;

$this->GenerateSitemap($container, $type);

$container = array();

$number++;

}

} # end while

$this->DB->Free($products_query);

if ( sizeof($container) > 0 ) {

$type = $number == 0 ? 'reviews' : 'reviews' . $number;

return $this->GenerateSitemap($container, $type);

} # end if

} else {

$this->debug['QUERY']['PRODUCTS']['STATUS'] = 'false';

$this->debug['QUERY']['PRODUCTS']['NUM_ROWS'] = '0';

}

} # end function

Link to comment
Share on other sites

To notify Bing:

 

catalog/admin/includes/modules/dashboard/d_google_sitemap.php

 

find:

$url_gs_ping = 'http://www.google.com/webmasters/sitemaps/ping?sitemap=' . $base_url . 'sitemapindex.xml';

 

after add:

$url_bing_ping = 'http://www.bing.com/ping?sitemap=' . $base_url . 'sitemapindex.xml';

 

find:

' <tr class="dataTableRow" onmouseover="rowOverEffect(this);" onmouseout="rowOutEffect(this);">' .

' <td class="dataTableContent" colspan="2"><a href="' . $url_gs_ping . '" target="blank">' . MODULE_ADMIN_DASHBOARD_GOOGLE_SITEMAP_PING . '</a></td>' .

' </tr>' .

 

after add:

' <tr class="dataTableRow" onmouseover="rowOverEffect(this);" onmouseout="rowOutEffect(this);">' .

' <td class="dataTableContent" colspan="2"><a href="' . $url_bing_ping . '" target="blank">' . MODULE_ADMIN_DASHBOARD_BING_SITEMAP_PING . '</a></td>' .

' </tr>' .

 

In catalog/admin/includes/languages/english/d_google_sitemap.php

 

find:

 

define('MODULE_ADMIN_DASHBOARD_GOOGLE_SITEMAP_PING', 'Ping Google (to notify them of the update to your XML sitemap.)');

 

replace with:

 

define('MODULE_ADMIN_DASHBOARD_GOOGLE_SITEMAP_PING', 'Ping <font color="red">Google</font> (to notify them of the update to your XML sitemap.)');

define('MODULE_ADMIN_DASHBOARD_BING_SITEMAP_PING', 'Ping <font color="red">Bing</font> (to notify them of the update to your XML sitemap.)');

Link to comment
Share on other sites

hello every one

when i setup the site map for os 1.2 and run http://192.168.1.93/leon/googlesitemap/index.php'>http://192.168.1.93/leon/googlesitemap/index.php it show the error like that

Opening /sitemapproducts.xml

FS_CAT /home/leon/

Server http://192.168.1.93

Save Path /

WS_CAT /leon/

ERROR: Google Product Sitemap Generation FAILED!

 

Opening /sitemapcategories.xml

FS_CAT /home/leon/

Server http://192.168.1.93

Save Path /

WS_CAT /leon/

ERROR: Google Category Sitemap Generation FAILED!

 

Opening /sitemappages.xml

FS_CAT /home/leon/

Server http://192.168.1.93

Save Path /

WS_CAT /leon/

ERROR: Google Pages Sitemap Generation FAILED!

 

Opening /sitemapindex.xml

FS_CAT /home/leon/

Server http://192.168.1.93

Save Path /

WS_CAT /leon/

ERROR: Google Sitemap Index Generation FAILED!

 

Array

(

[QUERY] => Array

(

[PRODUCTS] => Array

(

[sTATUS] => success

[NUM_ROWS] => 30

)

 

[CATEOGRY] => Array

(

[sTATUS] => success

[NUM_ROWS] => 71

)

 

)

 

[sAVE_FILE_XML] => Array

(

[0] => Array

(

[file] => /sitemapproducts.xml

[status] => failure

[file_exists] => false

)

 

[1] => Array

(

[file] => /sitemapcategories.xml

[status] => failure

[file_exists] => false

)

 

[2] => Array

(

[file] => /sitemappages.xml

[status] => failure

[file_exists] => false

)

 

[3] => Array

(

[file] => /sitemapindex.xml

[status] => failure

[file_exists] => false

)

 

)

 

)

 

 

any one can help for this error

Link to comment
Share on other sites

Amazing contrib! I am so happy I found it!

Have a couple of quick questions:

1. How and where and on which format do I set up a list of files to exclude from sitemappages.xml and what do I enter in admin for "Exclude these pages" - a relative path?

2. Looks like when I generate sitemapindex.xml, one of the sitemaps it lists there is "sitemaps.xml" which is not part of this contrib. I do have that file but it os from another contrib and that file has links to old sitemap products and pages files that have nothing to do with this implementation...

 

Kevin

Link to comment
Share on other sites

To exclude a file enter ifs name, like index.php.

 

This addon doesn't have anything to do with a file named sitemaps.xml.

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

vlad36

 

 

please, let me know how this line:

$location = $this->hrefLink(FILENAME_PRODUCT_REVIEWS, 'products_id=' . $result['pID'], 'NONSSL', false);

change to like: (?)

$location = $this->hrefLink(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $result['pID'] . '&reviews_id=' . $reviews['reviews_id'], 'NONSSL', false);

What i need is put every single review to sitemap. Now it doesn't work because can't find reviews_id. Do you know how to do it ?

 

Thanks,

Adrian

Link to comment
Share on other sites

You need to remove the

, 'NONSSL', false

to make the url correct. And the review id will have to be loaded if it isn't available at that point in the code.

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

No, I'm sorry but I don't know it off the top of my head and I don't provide specialized support in the forums due to the number of requests and time it would take.

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

 

Attempting to download from add-ons page, which dated download should I go for. Shows 19 to chose from, some are fixes and changes. have Ultimate Seo 5 installed on 2.3.1 shop.

 

thanks man,

 

Timmy C

Link to comment
Share on other sites

OK, even with SEU URL switched off I cannot get a product sitemap although categories and index are ok.

 

Opening /var/www/vhosts/mysite.co.uk/httpdocs/sitemapproducts.xml

FS_CAT /var/www/vhosts/mysite.co.uk/httpdocs/

Server http://109.xxx.xx.x

Save Path /var/www/vhosts/mysite.co.uk/httpdocs/

WS_CAT /

ERROR: Google Product Sitemap Generation FAILED!

 

Opening /var/www/vhosts/mysite.co.uk/httpdocs/sitemapcategories.xml

FS_CAT /var/www/vhosts/mysite.co.uk/httpdocs/

Server http://109.xxx.xx.x

Save Path /var/www/vhosts/mysite.co.uk/httpdocs/

WS_CAT /

Write /var/www/vhosts/mysite.co.uk/httpdocs/sitemapcategories.xml

Generated Google Category Sitemap Successfully

 

Opening /var/www/vhosts/mysite.co.uk/httpdocs/sitemapindex.xml

FS_CAT /var/www/vhosts/mysite.co.uk/httpdocs/

Server http://109.xxx.xx.x

Save Path /var/www/vhosts/mysite.co.uk/httpdocs/

WS_CAT /

Write /var/www/vhosts/mysite.co.uk/httpdocs/sitemapindex.xml

Generated Google Sitemap Index Successfully

 

Array

(

[QUERY] => Array

(

[PRODUCTS] => Array

(

[sTATUS] => success

[NUM_ROWS] => 125

)

 

[CATEOGRY] => Array

(

[sTATUS] => success

[NUM_ROWS] => 42

)

 

)

 

[sAVE_FILE_XML] => Array

(

[0] => Array

(

[file] => /var/www/vhosts/mysite.co.uk/httpdocs/sitemapproducts.xml

[status] => failure

[file_exists] => true

)

 

[1] => Array

(

[file] => /var/www/vhosts/mysite.co.uk/httpdocs/sitemapcategories.xml

[status] => success

[file_exists] => true

)

 

[2] => Array

(

[file] => /var/www/vhosts/mysite.co.uk/httpdocs/sitemapindex.xml

[status] => success

[file_exists] => true

)

 

)

 

)

 

 

After some investigation it seems it should be producing a product sitemap even with that add on installed, especially if its switched off.

I have seen a patch to get it working with SEU URL 5 but first I need the basic version working

Link to comment
Share on other sites

Dear Jack,

 

Installed your add-on, seems to be working. However, the category links are all doubled, so two identical links to the same category in the default language directly below each other. The product links are all single by the way. Do you have an idea what can cause this?

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