WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
[resolved] sitemap.xml wrong date for blog (10 posts)

  1. staze
    Member
    Posted 3 years ago #

    Odd issue that I'm having trouble debugging.

    Latest version of wordpress-seo, on WP3.1... the sitemap generation is creating a bad date for the toplevel site.

    The "last change date" ends up being something like "3094-03-18 04:30". Each time I regenerate the sitemap, the year of the date goes up.

    I can't quite figure out how the blog modification date is gathered. but I also don't see anything that changed with wordpress-seo with regards to this, so I'm not sure why it would have broken just now.

    Any ideas?

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. staze
    Member
    Posted 3 years ago #

    I attempted adding "$url['mod'] = ''" to the initial blog stuff (under "//Add the homepage first") in xml-sitemap-base.php, but that seems to make no difference.

    If I could figure out where the initial date comes from, I might be able to better debug this... could you fill me in on where the blog "last modified date" comes from?

    Also, I've noticed that wordpress-seo doesn't give an error if it can't generate the sitemap due to a permissions error. it just acts like normal, but doesn't actually write out the new sitemap.xml(.gz).

    Thanks!

  3. staze
    Member
    Posted 3 years ago #

    AH HA! Typos be damned!

    On line 96 of xml-sitemap-base-class.php you have:

    $time = time();

    This is incorrect, as mysql2date is expecting a mysql statement. It SHOULD read:

    $time="time()";

    What I can't figure out is how that typo got in there, since the svn change logs don't seem to indicate you did anything with that line. And if it's been that way for a while, then what changed? time() is a php function... so really, this never should have worked.

    Anyway... fixed!

  4. staze
    Member
    Posted 3 years ago #

    looks like the change was made in rev 315637. switched from using the php date() function to using mysql2date, but didn't change what $time was equal to.

    What I still can't figure out is why I only hit this bug today... I've updated my site between this change (and my update of wordpress-seo) and now, yet I only hit it today.

    Weird weird weird. Anyway, thanks for the awesome product. I'm just happy I can contribute back a bit. =)

  5. mbartizmo
    Member
    Posted 3 years ago #

    thanks for the investigation =) your solution worked for me, except instead of using the full quotes (") i had to use the single apostrophe '

    $time='time()';

    lord love a duck.
    -MB

  6. staze
    Member
    Posted 3 years ago #

    mbartizmo,

    Good to know. Though it _shouldn't_ matter in this case, it's probably safer for the real fix by Yoast to be single quotes.

    Also glad to know I'm not the only one that saw this issue. If it weren't for my site being in Google's webmaster tools, I would have never known the issue existed (Webmaster Tools was nice enough to warn me that there was a bad date in my sitemap).

  7. aquaeferuginae
    Member
    Posted 3 years ago #

    staze - mbartizmo,

    I had the same problem. $time='time()'; wonderfully solved the problem. Thanks to both!

  8. Pothi
    Member
    Posted 3 years ago #

    Thanks staze & mbartizmo!

    I found the issue too after checking with Google's Webmaster tools.

    It's fixed now.

    Thanks for your time staze!

  9. Joost de Valk
    Member
    Plugin Author

    Posted 3 years ago #

    Fixed this in 0.2.3.3, thanks :)

  10. staze
    Member
    Posted 3 years ago #

    Sweet. Just installed 0.2.3.3.

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic