Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
YOAST Sitemap invalid date format
Avatar
Patrick Moering
Rookie
Free Members
sp_UserOfflineSmall Offline
Jan 23, 2015 - 8:49 pm

I'm using YOAST together with the sp sitemap plugin to generate sitemaps. While the sitemap itself is valid, the date on the main sitemap (sitemap_index.xml) which is generated by the sp plugin is not valid. I was able to fix this in the plugin code (sp-google-sitemap-components.php line 59):

Before:

$base = $GLOBALS['wp_rewrite']->using_index_permalinks() ? 'index.php/' : '';
 $date = spdb_table(SFPOSTS, '', 'post_date', 'post_date DESC', '1');
 $map.= '<sitemap>';
 $map.= '<loc>'.home_url($base.'forum-sitemap.xml').'</loc>';
 $map.= '<lastmod>'.htmlspecialchars($date).'</lastmod>';

After:

$base = $GLOBALS['wp_rewrite']->using_index_permalinks() ? 'index.php/' : '';
 $date = spdb_table(SFPOSTS, '', 'UNIX_TIMESTAMP(post_date)', 'post_date DESC', '1');
 $map.= '<sitemap>';
 $map.= '<loc>'.home_url($base.'forum-sitemap.xml').'</loc>';
 $map.= '<lastmod>'.htmlspecialchars(date('c', $date)).'</lastmod>';
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 23, 2015 - 9:20 pm

Interesting.. Is this one big huge site map vice multiple sub maps...

Will have to research why this one does not have a timestamp convert.  Curious no reports but most use sub maps...

Thanks for the info....

Avatar
Patrick Moering
Rookie
Free Members
sp_UserOfflineSmall Offline
Jan 23, 2015 - 10:32 pm

Google webmaster tools reported the invalid timestamp but also was able to recognize the correct date. I can't tell you if the report has any disadvantages.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 24, 2015 - 12:22 am

ticket open....

Avatar
Patrick Moering
Rookie
Free Members
sp_UserOfflineSmall Offline
Jan 28, 2015 - 12:41 am

Thanks for the plugin update, however it did not fix the problem. Now it just prints an unformatted timestamp since this part is missing:

date('c', $date)
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jan 28, 2015 - 4:36 am

Oh dear - bad timing! Mr Papa is away for a couple of days. 

I know he made some change last week. are you saying that you know what to do t get this how you mneed it? If so I would suggest you make the change and Mr Papa will get in touch as soon as he returns.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 30, 2015 - 12:16 pm

argh...  tested my change, but seems a second change needed further up stream... will try to get an update out here today or tomorrow...  sorry...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626