#47304 closed defect (bug) (fixed)
Feed <lastBuildDate> Bug
Reported by: | onlanka | Owned by: | desrosj |
---|---|---|---|
Milestone: | 5.2.1 | Priority: | normal |
Severity: | normal | Version: | 5.2 |
Component: | Feeds | Keywords: | has-patch commit dev-reviewed |
Focuses: | Cc: |
Description
My wordpress site's feed doesn't show latest post's date and time in the
<lastBuildDate>
Eg:
<lastBuildDate>Wed, 15 May 2019 10:42:52 +0000</lastBuildDate>
<pubDate>Fri, 17 May 2019 08:43:44 +0000</pubDate>
There is a gap of 2 days between latest post and Last Build Date!
I don't use any cache plugin.
PHP Version: 7.3
Please explain me how to fix this issue.
My website's feed URL:
https://www.onlanka.com/feed
Attachments (2)
Change History (15)
#3
@
5 years ago
@SergeyBiryukov Yes, I disabled all the plugins, also activated default theme twentynineteen.
But it is still happening
My blog is older than 8 years, but I did regular updates in timely manner. only older WordPress installations affected.
Please release a patch to repair feed
#4
@
5 years ago
- Keywords needs-dev-note dev-feedback added
Finally I fixed it, But this might be Not the correct way.
But I had to do this until official patch released for this issue.
What I did is, in wp-includes/feed-rss2.php
Code line 45 was:
<lastBuildDate><?php echo get_feed_build_date( 'r' ); ?></lastBuildDate>
I replaced it with:
<lastBuildDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></lastBuildDate>
This has fixed the problem, but again this might not the correct way to fix this problem!
I applied this fix to my live blog, it's feed URL is:
https://www.onlanka.com/feed
#5
@
5 years ago
- Keywords has-patch added; needs-patch reporter-feedback needs-dev-note dev-feedback removed
- Severity changed from critical to normal
Yeah, it's a bug in new function since it relies on string sort in max()
after it applies arbitrary date format (so result is not all necessarily string sortable). Adding patch.
#6
@
5 years ago
@Rarst added fix patch. i have not updated page so i can't get update and added patch.
I got confirmed, this is a database issue.
Wordpress sites older than 7-8 years could be affected.
Here what I did to get confirm the place of issue:
New Test location:
https://www.onlanka.com/wptest/
twentynineteen
https://www.onlanka.com/wptest/feed
<lastBuildDate>
not updating with latest posts.https://www.onlanka.com/wptest/feed
, it gives the file asfeed
but I checked another fresh installation of wordpress and it givesxcGddgR
random letters as feed file name.If you have a way to repair feed updating part in the database, this could be fixed.
Please give me a solution for this.