• Resolved hauruapai

    (@hauruapai)


    Hi,

    I have just installed this into a WP 3.0 – when I run the thesubdomain.mydomain.com/sitemap.xml it works fine, but when I run mydomain.com/sitemap.xml it gives the following errors:


    Warning: Division by zero in /home/inthenew/public_html/wp-content/plugins/xml-sitemap-feed/feed-sitemap.php on line 37

    Warning: Cannot modify header information – headers already sent by (output started at /home/inthenew/public_html/wp-content/plugins/xml-sitemap-feed/feed-sitemap.php:37) in /home/inthenew/public_html/wp-content/plugins/xml-sitemap-feed/feed-sitemap.php on line 50

    Then it prints out all of the info and if I do a view source, as well as getting the above errors, it does have the xml markup showing.

    Any ideas on how to fix this?

    thank you for your time

    https://www.ads-software.com/extend/plugins/xml-sitemap-feed/

Viewing 15 replies - 1 through 15 (of 20 total)
  • Hmmm… The second error is caused by the output of first error message. The first error makes me wonder…

    Do you have only one post on the main site? Or no post at all maybe?

    I can write a fix when I know which circumstances might cause this.

    Ok, think I found the cause and committed a fix. Version 3.6.1 should be available in 10 minutes…

    Please let me know if that did or did not do the trick ??

    Hi, that did not do the trick. Still getting the Division by zero line 37 error.

    https://mnpoliticalroundtable.com/?feed=sitemap

    Warning: Division by zero in /var/www/html/mn/mnpoliticalroundtable.com/wp-content/plugins/xml-sitemap-feed/feed-sitemap.php on line 37

    Warning: Cannot modify header information – headers already sent by (output started at /var/www/html/mn/mnpoliticalroundtable.com/wp-content/plugins/xml-sitemap-feed/feed-sitemap.php:37) in /var/www/html/mn/mnpoliticalroundtable.com/wp-content/plugins/xml-sitemap-feed/feed-sitemap.php on line 50

    Hi, thanks for the plugin! You rock.

    that did not do the trick. Still getting the Division by zero line 37 error.

    https://mnpoliticalroundtable.com/?feed=sitemap

    Warning: Division by zero in /var/www/html/mn/mnpoliticalroundtable.com/wp-content/plugins/xml-sitemap-feed/feed-sitemap.php on line 37

    Warning: Cannot modify header information – headers already sent by (output started at /var/www/html/mn/mnpoliticalroundtable.com/wp-content/plugins/xml-sitemap-feed/feed-sitemap.php:37) in /var/www/html/mn/mnpoliticalroundtable.com/wp-content/plugins/xml-sitemap-feed/feed-sitemap.php on line 50

    that’s funny, when i follow the link i see the sitemap (saying it is indeed version 3.6.1) … maybe you need to clear your browser cache ?

    Ha, maybe it was something dumb like that. I did edit the file and remove lines 36 and 37 though, and then it worked.

    Thanks for the code! YOU ROCK.

    @hollycca3
    ah, well… as long as it works ??

    i notice you have no robots.txt file. i ‘d advise you to do so. even better would be to switch on some form of fancy permalinks ofcourse but i suppose you have a reason not to do that so just copy the content of https://mnpoliticalroundtable.com/?robots=1 to a new file named robots.txt and upload it to your site root ??

    Thread Starter hauruapai

    (@hauruapai)

    Hi again,

    Firstly thank you for answering so promptly ??

    I have installed the new version and still get the same thing – but a different error message now:

    XML Parsing Error: no element found
    Location: https://inthenewsheadlines.com/sitemap.xml
    Line Number 5935, Column 1:
    ^

    And a view source will show will show all of the xml there but the last line in the view source says:

    <b>Fatal error</b>: Allowed memory size of 67108864 bytes exhausted (tried to allocate 88 bytes) in <b>/home/inthenew/public_html/wp-includes/load.php</b> on line <b>552</b>

    which could be the reason for the first error?

    Is there a limit for how many links there can be?

    It works fine on https://naturaldisasters.inthenewsheadlines.com/sitemap.xml

    The one where it is not working has heaps of posts and the subdomain at the moment only has one post

    Thank you for your time ??

    Hmmm… I’m getting ERROR: sitemap is not a valid feed template. on both URLs. Did you remove the plugin by any chance? Without deactivating it through the WP Plugins interface, the permalink structure is not reset to it’s original so that would cause the system to look for a file template that is no longer there.

    Anyway, that first “XML Parsing” error message is caused by exactly that Fatal error message you found in the source. Now the cause of that last error, I can only guess at. It is a server thing about memory allocation ( 67 108 864 bytes = 64 megabytes ! ) being taken by WordPress during the creation of the feed.

    I suspect that you have a huge number of posts? The fact that the error happens on line number 5935 would indicate around 1000 urls being processed already… Not that this should be a problem though. There is obviously something happening (hogging memory) that should not be happening. I’ll look into it and let you know if I can figure it out from this distance ??

    Thanks for reporting!

    @hauruapai
    Searching Google and ending up back on this forum I found this thread
    https://www.ads-software.com/support/topic/253495?replies=13#post-1017842

    You seem to have run into the memory limit on your server (64MB) so you might want to try and increase that limit to 128MB or more.

    That is the only advise I can give right now until I figure out if there is a way to make The Loop flush its memory from time to time.

    Sorry.

    @hauruapai,
    One other thing you might try ( if you don’t mind editing a plugin file ) is to change the maximum number of URLs the XML Sitemap Feed template will put out.

    Go to Plugins > Editor in your WP back-end, browse to the file xml-sitemap-feed/feed-sitemap.php and change the value of $maxURLS to a low enough number. Start with 1000 but go lower if you need to.

    Please let me know if that helps ??

    Thread Starter hauruapai

    (@hauruapai)

    Thank you RavanH for all of your input – looking at the other post and options and your suggestions, I decided to first change the $maxURLS to a low enough number – starting at 1000 and it worked! so I started to up in in 1000 increments and it still worked – although I only have 1001 posts at the mo ?? I will let you know if it starts spitting the dummy when the post count gets higher.

    Also, I had inactivated it as I was trying to get another plugin to work and needed to find the plugin culprit that it did not like – but happy to say it is not yours that my other plugin has issues with and is re-activated now.

    Once again thank you RavanH for all of your time and help – it is appreciated ??

    You’re welcome ?? and thank you for this opportunity to get to know how the plugin works on another server! I have no means to duplicate this interesting situation:

    Even though you have no more than 1300 posts, when $maxURLS is set to 10.000 memory is bogged up but when set to 2.000 (do i understand correctly?) there is no problem? The plugin template file uses the normal WP Loop and no extra queries are done so I do not really understand why this is happening. Funny, these interesting inner workings of WP.

    I am going to push a new version with some major improvements to the changefreq and also priority calculation. Any update will overwrite your customization to the $maxURLS value so but before I make it public, would you please be so kind as to test something for me? Could you test with changing the $maxURLS to -1 (that is: minus one) ? If this creates that memory problem again, please let me know.

    Thanks! ??

    TIP: Refresh the sitemap in your browser bypassing the browser cache with (in most cases) Ctrl+F5 or better: completely clear the browser cache to make sure you are looking at the most recent version (see https://en.wikipedia.org/wiki/Wikipedia:Bypass_your_cache for alternatives). Also if you are using a server cache plugin like WP Super Cache, you might want to make sure it is switched of during testing.

    Thread Starter hauruapai

    (@hauruapai)

    I have done as you asked and tested the $maxURLS to -1 and that worked – no problems. I am also not using a cache plugin.

    I then changed it back to 10000 and then using the Ctrl+F5 the sitemap page loaded fine so I have left it at $maxURLS 10000 seeing as it seems to be working ok ??

    If you need me to test anything else, please let me know – I am more than happy to help ??

    That ‘s OK. I’m happy now ?? thanks.

    Just this: Could you mark this tread as Solved? And I notice an empty https://inthenewsheadlines.com/robots.txt … Is there an empty robots.txt file in your root ? If so, better remove it and let WP handle the output. If not, I wonder why WordPress is not creating output for the URL. I have seen this behaviour on blogs that have no posts (just pages) but your blog certainly does not lack that …

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘[Plugin: XML Sitemap Feed] WP3.0 Multi Sites – works on subdomains and not main domain’ is closed to new replies.