Jump to content
Jack_mcs

Google XML Sitemap SEO

Recommended Posts

Yes, manually I get 

CONGRATULATIONS! All files generated successfully.

and get the google and bing submission links.

One thing I have noticed that could be the problem is that in my Admin console at the bottom of the google sitemap xml page, there are two Create Now tabs, the first one has generate all sitemaps now, and the text is in blue, this link does not work, the second tab the writing is in red and works fine.

Share this post


Link to post
Share on other sites

You will need to ask your host to look at the cron job failure. Explain to them that the script run fine when ran manually. If the won't look at it or if you prefer not to do that, you can edit the index.php file a little at a time, running the cron job after each change to see if it fails the same way. You will eventually find the problem this way but it will take a while.

Share this post


Link to post
Share on other sites

Jack I am having a few problems with the manual create sitemaps feature. There is also a problem with the cron not working either.

I have read and installed everything and checked and double checked the install. After the install when I go to http://MY_DOMAIN/googlesitemap/index.php all the files generate as they should. No problems there, so assume that everything is as it should be.

When I hit one of two the manual run buttons in the admin area no files are created and a new browser page opens with the following url. https://mydomain/admin14/' . HTTPS_CATALOG_SERVER . '/googlesitemap/index.php. Which is not right.When going into the configure file HTTPS_CATALOG_SERVER  is present and is my full website address so something must be wrong somewhere.

I have spoken to my host about the cron job and they say that it should work fine as it is, so it must be a coding error. I can only believe what they say. Could this all be releted to the incorrect url above.

Any help or advice you can give me would be appreciated.


REMEMBER BACKUP, BACKUP AND BACKUP

Get the latest Responsive osCommerce CE (community edition) here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites

The manual run option not working is due to an error in the code for the setting. A fix was posted in this thread but it appears that persons posts were deleted. But that would not have anything to do with the cron job failing. As far as I know, the cron job is working in the shops I've installed this into. But I use a different version than the released one.

For the url problem, you need to replace the last two insert commands in the sql file with this one:

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) 
 VALUES('Create Now', 'GOOGLE_XML_SITEMAP_CREATE_NOW', 'false', 'Click this link to run the script now<br><center><a href=\"../googlesitemap/index.php\" target=\"new\"><font color=red>Generate All Sitemaps Now</font></a></center>', @this_id, '50', NULL,  now(), NULL, NULL);

Then delete all of the entries for this addon in the configuration and configuration_group tables and then run the sql script again.

For the cron job, I will have to test that to be sure that what I have here is working. I'll upload a new version when I do that. Hopefully it won't be too long before I can do that.

Share this post


Link to post
Share on other sites

Thanks Jack @Jack_mcs , that fixed the one part. Appreciated.


REMEMBER BACKUP, BACKUP AND BACKUP

Get the latest Responsive osCommerce CE (community edition) here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites

Hello @14steve14 thank you for your explanation to Jack, that is what I was failing to get to in my previous posts, I could not understand why there were two Create Now entries in the Admin area,.

Hopefully they were conflicting with each other which is why the cron was not working for us both.

I will wait until my cron is first run at midnight, fingers crossed all will work.

 

Regards Shaun

Share this post


Link to post
Share on other sites

A new version has been uploaded with these changes:

  • Made changes to fix mistakes in the database file thanks to member wHiTeHaT.
  • Replaced the database file with a php install script to make the DB changes easier.
  • Removed the option for the mobile addon and partially removed the code for it. That means this and future versions will no longer work with mobile addon.

 

Share this post


Link to post
Share on other sites
2 hours ago, Jack_mcs said:

A new version has been uploaded with these changes:

  • Made changes to fix mistakes in the database file thanks to member wHiTeHaT.
  • Replaced the database file with a php install script to make the DB changes easier.
  • Removed the option for the mobile addon and partially removed the code for it. That means this and future versions will no longer work with mobile addon.

 

I have the previous version installed on a CE shop.

To upgrade, is it simply to replace the files in catalog or...?

Thank you


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

You should replace the files in the googlesitemap directory and also run the database install script. Use the delete option when it runs and then check the settings in admin to make sure they are as you want. See the update doc for this file for more specific instructions.

Share this post


Link to post
Share on other sites
1 hour ago, Jack_mcs said:

You should replace the files in the googlesitemap directory and also run the database install script. Use the delete option when it runs and then check the settings in admin to make sure they are as you want. See the update doc for this file for more specific instructions.

Thanks for the info...I had this working up to today, but not I get this error

This page isn’t working

www.mysite.com is currently unable to handle this request.

HTTP ERROR 500
 
Switched to alternate sitemap file...same error
 
enabled diagnostics and upon doing so, when running I just get the same error as above.
 
On my cPanel, looking under meters and the errors generated by the server, I do not see any error related to this.
 
I did install today's ultimate seo urls and that is working fine.
 
Thanks
 
 

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

Jack, I forgot to mention that the 500 error was on Chrome.  Testing on Firefox, I just get a blank white page.


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

Steve, when you say you get a blank page, are you referring to http://your site.com/googlesitemap/index.php or http://your site.com/index.php? This addon has nothing to do with the latter so if that is the case, the problem is something else.

Share this post


Link to post
Share on other sites

Regarding the new version and cron not working, I have tested this latest version in a shop running php 7.2 and the cron job ran fine.

Share this post


Link to post
Share on other sites
53 minutes ago, Jack_mcs said:

Steve, when you say you get a blank page, are you referring to http://your site.com/googlesitemap/index.php or http://your site.com/index.php? This addon has nothing to do with the latter so if that is the case, the problem is something else.

Jack, it was the sitemap url. I've uninstalled for now and will try a couple things tomorrow and see how it goes.


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

I tried again today, even after cleaning up some php related issues, it still won't work. I'm going to give this a rest and look at what I may have done in the shop to cause this and then give it another go.

Thanks


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

I'm not clear how this is failing. When this addon is installed, none of the shop files are changed so as far as the shop is concerned, the addon doesn't exist. But if I am understanding you correctly, you are saying when you install it the pages on the shop, like index.php, fail to load. I don't see how that is possible so I must not be understanding the problem.

Share this post


Link to post
Share on other sites
10 hours ago, Jack_mcs said:

I'm not clear how this is failing. When this addon is installed, none of the shop files are changed so as far as the shop is concerned, the addon doesn't exist. But if I am understanding you correctly, you are saying when you install it the pages on the shop, like index.php, fail to load. I don't see how that is possible so I must not be understanding the problem.

I have a support ticket into my host company about the server error 500 on this matter.  We'll see what they come up with.

This is for url: 

https://www dot myshop dot com/googlesitemap/index.php


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

Jack, I was on with the support guy for a while, he took the matter to tier 2 support.  After all that, they conclude it's not the server. for the googlesitemap/index.php file they simply replaced the code with plain text to see if the file would show..and it does....says "Test Page".

This is for:
https://www.mydomain dot com/googlesitemap/index.php

My cron email came back this AM with this info:

Status: 500 Internal Server Error

X-Powered-By: PHP/7.0.31

Set-Cookie: osCsid=e49acaa263514efa79d54d19f37461fe; path=/; domain=.mydomain.com

Expires: Thu, 19 Nov 1981 08:52:00 GMT

Cache-Control: no-store, no-cache, must-revalidate

Pragma: no-cache

Vary: Accept-Encoding

Content-type: text/html; charset=utf-8

Here's part of the cron email from two days ago..showing things working.

X-Powered-By: PHP/7.0.31

Set-Cookie: osCsid=a3151e4d0fae5141117ac8a54641f89f; path=/; domain=.mydomain.com

Expires: Thu, 19 Nov 1981 08:52:00 GMT

Cache-Control: no-store, no-cache, must-revalidate

Pragma: no-cache

Vary: Accept-Encoding

Content-type: text/html; charset=utf-8

<style>.red { color:red; } </style>

<pre><span class="red"><strong>CONGRATULATIONS! All files generated successfully.</strong></span>

.......................

I've tried the most current version, and then I've tried the version just before that I had installed for a while.

The only other store modifications I have made during the past couple days is to install some modules (that don't affect the core code) and Ultimate SEO Urls.

So anyway...all just FYI and for now I'll give this a rest and come back to it later.

Thanks for your time.

SK

 


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

Steve - I'm sorry but I am totally confused about this. Previously you said with this installed you would get a white page at https://www dot myshop dot com/.  Are you sure about that? This addon doesn't make changes to the shops files so that should be impossible. Or are you saying that when you visit https://www dot myshop dot com/googlesitemap/index.php you get a white page and that your site still works? 

Also, you mentioned cron. Is the failure only with cron?

Have you looked in your root directory to see if there is an error_log file there? If there is it may contain the reason for the failure.

Share this post


Link to post
Share on other sites
2 hours ago, Jack_mcs said:

Steve - I'm sorry but I am totally confused about this. Previously you said with this installed you would get a white page at https://www dot myshop dot com/.  Are you sure about that? This addon doesn't make changes to the shops files so that should be impossible. Or are you saying that when you visit https://www dot myshop dot com/googlesitemap/index.php you get a white page and that your site still works? 

Also, you mentioned cron. Is the failure only with cron?

Have you looked in your root directory to see if there is an error_log file there? If there is it may contain the reason for the failure.

Hi Jack, sorry for the confusion.

What I am reporting is related to just the cron url only

https://www.mydomain.com/googlesitemap/index.php

Please note for the purposes here, I have changed the domain name.

When running that url

1 in Chrome I get this error message

This page isn’t working
www.mydomain.com is currently unable to handle this request.
HTTP ERROR 500

2 in FF I get a blank white page for the cron.

3 in IE I get a blank white page for the cron.

Accordingly then, the sitemap pages, all set to 0755 are empty after running the cron.

When in contact with my host support, after much back and forth they conclude the issue is not a server problem.
They said it's a PHP problem.

To make their point, they changed the /googlesitemap/index.php file to just plain text and ran it.  It displayed just text properly.    

They said that means the problem is not a server issue but a php issue.

Whether that's accurate, I don't know. But that's what they said.

However, I do have an php error log, and I see nothing in it related to running the above url.


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

Thank you. That clears up quite a bit. But one last question: can you run the script manually (not with cron)?

Assuming you can, there must be something in the file that is not working with your server. The easiest way to find this since there are no errors showing is to edit the googlesitemap/index.php file with lines to display text. So before the line

chdir('../');

add

echo 'start<br>';
exit;

Then run the cron job and you should see start displayed. If not, then you need to go back to your host since that should always work. If it works, then move those two lines down a ways, like after

require_once('googlesitemap/' . $mapfile);

 and try again. If it just shows a white page, then the cause of the failure is above where you added it and you need to move it up until you find the cause. If it works, then move it farther down.

It will probably turn out to be something simple but without any indication of the failure, that's the only way to go about it. I can tell you that the script definitely works with php 7.2. But if your hosting account allows you to switch php versions, you might try a lower version just to see if that is related somehow.

Share this post


Link to post
Share on other sites
1 hour ago, Jack_mcs said:

Thank you. That clears up quite a bit. But one last question: can you run the script manually (not with cron)?

Assuming you can, there must be something in the file that is not working with your server. The easiest way to find this since there are no errors showing is to edit the googlesitemap/index.php file with lines to display text. So before the line


chdir('../');

add


echo 'start<br>';
exit;

Then run the cron job and you should see start displayed. If not, then you need to go back to your host since that should always work. If it works, then move those two lines down a ways, like after


require_once('googlesitemap/' . $mapfile);

 and try again. If it just shows a white page, then the cause of the failure is above where you added it and you need to move it up until you find the cause. If it works, then move it farther down.

It will probably turn out to be something simple but without any indication of the failure, that's the only way to go about it. I can tell you that the script definitely works with php 7.2. But if your hosting account allows you to switch php versions, you might try a lower version just to see if that is related somehow.

Manually running...

Looks like it starts at line 48

    require_once(DIR_WS_INCLUDES . 'filenames.php');


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

Jack,  these errors must have appeared while I was following your instructions to troubleshoot..and may help.

[07-Sep-2018 19:06:30 UTC] PHP Warning:  Use of undefined constant DIR_WS_HTTP_CATALOG - assumed 'DIR_WS_HTTP_CATALOG' (this will throw an Error in a future version of PHP) in /home/MyUserName/public_html/googlesitemap/index.php on line 45
[07-Sep-2018 19:06:30 UTC] PHP Warning:  Use of undefined constant DIR_WS_INCLUDES - assumed 'DIR_WS_INCLUDES' (this will throw an Error in a future version of PHP) in /home/MyUserName/public_html/googlesitemap/index.php on line 48
[07-Sep-2018 19:06:30 UTC] PHP Warning:  require_once(DIR_WS_INCLUDESfilenames.php): failed to open stream: No such file or directory in /home/MyUserName/public_html/googlesitemap/index.php on line 48
[07-Sep-2018 19:06:30 UTC] PHP Fatal error:  require_once(): Failed opening required 'DIR_WS_INCLUDESfilenames.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/MyUserName/public_html/googlesitemap/index.php on line 48


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

It appears you didn't upload the latest file since the files in this last version don't contain

require_once(DIR_WS_INCLUDES . 'filenames.php'); 

That will definitely cause a failure since DIR_WS_INCLUDES isn't defined and filenames.php doesn't exist (unless you've added it).

Share this post


Link to post
Share on other sites
11 hours ago, Jack_mcs said:

It appears you didn't upload the latest file since the files in this last version don't contain


require_once(DIR_WS_INCLUDES . 'filenames.php'); 

That will definitely cause a failure since DIR_WS_INCLUDES isn't defined and filenames.php doesn't exist (unless you've added it).

Hi Jack....downloading package oscom-google-xml-sitemap-seo-QN8hJ-XvqMV from https://apps.oscommerce.com/QN8hJ&amp;google-xml-sitemap-seo

In \oscom-google-xml-sitemap-seo-QN8hJ-XvqMV\catalog\googlesitemap\index.php I see starting on 47 thru 51 

    require_once('includes/configure.php');
    require_once(DIR_WS_INCLUDES . 'filenames.php');
    require_once(DIR_WS_INCLUDES . 'database_tables.php');
    require_once(DIR_WS_FUNCTIONS . 'database.php');
    tep_db_connect() or die('Unable to connect to database server!');

 


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

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

×