Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Google XML Sitemap SEO


Jack_mcs

Recommended Posts

You should set up a cron job to run the script if you haven't.

 

i don't know how to do that... :blush: :sweating:

 

I don't get any errors never have. If a cron job (what ever that is) can automate the process that would be awesome.

 

UPDATE:

 

Just figured it out. A bit of research can do wonders...lol

Setting up cron job now...

 

Thanks Jack.

Edited by Tsimi
Link to comment
Share on other sites

@@Jack_mcs

 

Hi Jack

 

It seems like the cron Job failed. Getting the following e-mail.

 

 

/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 1: ?php: No such file or directory
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 2: /bin: is a directory
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 3: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 4: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 5: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 6: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 7: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 8: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 9: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 10: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 11: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 12: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 13: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 14: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 15: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 16: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 17: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 18: product Imgs/: is a directory
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 20: syntax error near unexpected token `'../''
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 20: `    chdir('../');'

 

What went wrong? osC Version is 2.3.3.4. Permission to the googlesitemap folder is 755

Edited by Tsimi
Link to comment
Share on other sites

For your problem, it appears something is wrong with the file. I had a problem on a site a while back where the cron job would run and It was due to a conflict with the name because of a redirect in the shops code. I renamed the googlesitemap/index.php file to gs_index.php and then changed the cron job to call that file. Give that a try and see if it helps.

 

By the way, I just realized the instructions don't mention setting up a cron job so I can see where that would confuse people. I'll add that to the next version.

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

 

 

I renamed the googlesitemap/index.php file to gs_index.php and then changed the cron job to call that file. Give that a try and see if it helps.

 

Thanks Jack will do and report back asap.

 

 

 

By the way, I just realized the instructions don't mention setting up a cron job so I can see where that would confuse people. I'll add that to the next version.

 

that is a good idea. :thumbsup:

Edited by Tsimi
Link to comment
Share on other sites

I am attempting to add this contribution.  When I ran the sql I received this error

 

#1048 - Column 'set_function' cannot be null

 

But, when I go to the admin all the options seem to be there.  Do I need to change anything?

Edited by dhooper

Diana

Link to comment
Share on other sites

Please look at the settings and see if there is one named "Exclude these pages." That is probably the one that caused the failure so it may not have been added.

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

Try running this and see if it works:

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, use_function)
 VALUES ('Exclude these pages', 'GOOGLE_XML_SITEMAP_EXCLUDE_PAGES', '', 'Add these pages to the built-in file exclude list. This will prevent the links from being added to the pages site map.', '289', '20', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now(), NULL);

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

Yes, that worked! :)  Now, how do I add pages to exclude?  It only has a true/false setting.  I want to exclude conditions, privacy, password reset, and a few custom ones that I've created.

Diana

Link to comment
Share on other sites

@@Jack_mcs

 

Hi Jack

 

Got new e-mails and it seems that it failed again. Same messages as before.

Renamed the index.php and also adjusted the path for the cron job with same result.

Don't know exactly why that is happening but i guess i'll switch back to manual update mode.

I don't have that many new products on a regular basis so it's OK.

Link to comment
Share on other sites

The correct syntax for the above database problem us below, in case anyone else has this problem:

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) 
 VALUES ('Exclude these pages', 'GOOGLE_XML_SITEMAP_EXCLUDE_PAGES', '', 'Add these pages to the built-in file exclude list. This will prevent the links from being added to the pages site map.', '289', '20', now());

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

@@Jack_mcs - first, thank you for the contribution!

 

Sorry if the question was asked and answered before, but does this module support catalogs with over 50,000 products? Does it auto-generate additional sitemap files as required? Does it make sure the total file size of each sitemap is under 10mb?

Link to comment
Share on other sites

@dr_lucas I haven't looked at that part of the code in a while. I know it definitely creates multiple map files if the number of products is over 50,000. I don't recall it checking for file size but the limit is 50 MB, not 10 MB: see here. I suppose it is possible for a file to reach that large but I've not seen it yet.

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

Thanks, Jack. It seems google size limit is different than the standard, which is 10mb, and if we want sitemaps that can be read by all search spiders, it would be better to make the code check for that limit and create a new sitemap if reach the 10mb.

More details here: https://productforums.google.com/forum/#!topic/webmasters/nd5RDhMMfhk

Link to comment
Share on other sites

Good point. Even though I deal with SEO all the time, I still fall into the trap of thinking of things in relation to google.

 

But I'm still wondering if even 10 MB would be reached. Have you tested this on a site that would create multiple files?

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

Yes, I did on my own site and it generated only 1 file of 50,000 products (out of the 90,000 I have). The file size was 12MB.

I have an older version (1.2) so that is possibly the reason it did not generate the consecutive file, but still - 12MB form 50,000 products is larger than the allowed standard.

Link to comment
Share on other sites

Correction, it seems all the version files show the same version 1.2, so I believe mine maybe a newer one - 1.4 or 1.5, if that makes any difference.

Link to comment
Share on other sites

The option to create more than one file once the 50,000 limit was reached has been part of the addon since it was released. There's only one spot in the file where 50000 is mentioned. I just changed that to 50 for a site I have here and six product maps files were created so the code is working correctly. If you troubleshoot it, please keep in mind that there are two files, sitemap.class.php and sitemap.class_Alternate.php, so be sure to edit the correct one, which is determined by the first setting of 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

  • 1 month later...

I assume you mean the pages site map since that is what the setting in admin is for. In that case, it should be any page that shouldn't be listed in the search engines. There is an internal list that blocks the obvious ones, like the checkout pages. But there may be a page specific to your site that you don't want listed. The best thing to do is to create the pages map file and then go through it to see if there are any that shouldn't be. In general, any page that requires a login should not be listed.

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

A new version has been uploaded with these changes:

 

- Updated the sitemap schemas.
- Added an image sitemap.
- Added a mobile sitemap.
- Changed the input box for excluding pages for the pages map to make it easier to see.
- Fixed some coding mistakes that caused Article Manager topics not to be displayed correctly.
- Removed the alternate sitemap option.
- Changed the output when the script is ran manually.

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

 

2.3.4 standard, your new version 1.8. I do not have iOSC installed, 

 

I'm getting full failure for every type, like

Save Path /
WS_CAT    /
ERROR: Google Product Sitemap Generation FAILED!

 

The queries work fine

 

The next section like -

            [0] => Array
                (
                    [file] => /sitemapproducts.xml
                    [status] => failure
                    [file_exists] => false

 

sitemap.class.php, If I replace this:


		if (($pos = strpos(DIR_FS_CATALOG, "googlesitemap")) !== FALSE) { //fix for when path is gotten by dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME'
                    $pos = strlen("googlesitemap");                               //it includes the google sitemap directory so remove it
		    $this->savepath = substr(DIR_FS_CATALOG, 0, - $pos - 1);      //not returning right above - quick fix for now
  		  $this->savepath .= (substr($this->savepath, -1) !== '/') ? '/' : ''; //append a slash if needed
		} else {
	  	  $this->savepath = DIR_FS_CATALOG . (substr(DIR_FS_CATALOG, -1) !== '/') ? '/' : '';
                }
                $this->base_url = $domain_name;

reverting back to this, everything completes successfully - but I haven't tested further

		
		$this->savepath = DIR_FS_CATALOG;
		$this->base_url = HTTP_SERVER . DIR_WS_HTTP_CATALOG;

Also,

I have Enable mobile Map set to False, yet the generated sitemapindex.xml file is containing the mobile entries, such as

	<sitemap>
		<loc>http://www.mydomain.com/sitemap_mobileproducts.xml</loc>
		<lastmod>2015-03-15</lastmod>
	</sitemap>

Last,

Since my site is responsive, my mobile links are the same as the normal links. So should I put my standard domain in the "Mobile URL" field and enable mobile xml maps?

 

Thank you for the support!

Edited by Roaddoctor

-Dave

Link to comment
Share on other sites

That first error is probably due to how the DIR_FS_CATALOG is setup in the includes/configure.php file. Is yours set to the actual path (recommended) or it use some php function? The change you made is fine, though, for future releases, I would like to get it fixed.

 

For the mobile maps, the "Enable Mobile Map" is not used. It was used in my first version of this but later removed. Instead, the mobile url setting determines if the mobile maps are created or not. Leave it blank if you do not want mobile maps to be created. Otherwise, put the full url for your shop there. I needed to do it this way to make the code compatible with all possible mobile url's.  I apologize for the mistakes and poor instructions .

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

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