Ready to get started?Download WordPress


[resolved] Feed Validation Re-visited! Where does my language go? (22 posts)

  1. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    OK, I posted about this years ago, never have I gotten this fixed.

    Just wondering if anyone has any ideas. My feed never validates because the language goes missing

    This feed does not validate.
    line 18, column 11: language must be an ISO-639 language code: [help]

    So, back in the day I would go into the options menu and manually update it every time it went away. Then after a while I just used a mysql query to update it whenever I noticed it missing.

    Still...it keeps disappearing. So I finally made it easy on myself and added an item to my settings->reading menu

    function voodoo_rss_language_string() {
    	<input name="rss_language" type="text" id="rss_language" value="<?php form_option('rss_language'); ?>" class="regular-text" />
    	<span class="description"><?php _e('RSS supports multiple languages through the language element, which contains a short code that identifies that the natural language employed in the channel. See on this table for your <a href="http://www.rssboard.org/rss-language-codes#table">language codes</a>.'); ?></span>

    Like so. Now while this is pretty darned convenient.... I find I have to do this every time I check my feed in the validator. Anybody have any idea where the crap my language keeps going?

    Thansk folks!

  2. Do you have define ('WPLANG', ''); in your wp-config.php file?

  3. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    Yup... is there!

  4. Have you tried disabling all plugins and switching themes?

  5. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    Yup, this has happened since I first started using WP years ago

    About 5 themes ago, and many total changes in plugin usage.

    I can't really run my site with no plugins anymore, as a lot of folks rely on the plugins for music and whatnot. And the problem can't be predicted by me...yet anyway

    the language just goes away randomly

  6. I've honestly never heard of this before. I'll drop this by the list, maybe someone has heard of it before.

  7. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    That'd be cool, seems pretty rare, as I had a hell of a time figuring out how to fix it over the years when I was a novice, and didn't know nuthin 'bout nuthin! Doesn't really pop up in the forum, or with my google-fu

    Thanks for the effort!

  8. esmi
    Forum Moderator
    Posted 4 years ago #

    When it does go "missing", what value is stored in the database in its place? Have you been with same host the entire time?

  9. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    it is just blanked out, nothing is stored.

    I have been with the same host the whole time. Same database. (I repair and optimize monthly)

  10. esmi
    Forum Moderator
    Posted 4 years ago #

    Have you tried re-uploading everything except wp-content from a fresh WP download in case you have a damaged older file? Any regular cron jobs running in WP? Noticed any connection with, say, a scheduled post being published?

  11. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    Yeah, I normally do a manual upgrade whenever I upgrade my WP install.
    -Just recently did a fresh upload of all files within the past 2 weeks trying to work out some various bugs

    I'm trying to look for patterns, currently my feed is still coming up valid, so it's been valid since I started this thread which....

    I re-added the language on Friday, in the morning....

    I have made one post since then which coincides with this info from my feed:
    <lastBuildDate>Fri, 17 Sep 2010 18:23:41 +0000</lastBuildDate>

    Didn't lose my language, so I don't think it happens when I publish a post. I don't use scheduled posts at all.....

  12. esmi
    Forum Moderator
    Posted 4 years ago #

    So it would be reasonably safe to assume that your files are all present & correct, yes/ That leaves the following possibilities:

    1. Something is writing to the db and wiping out the lang entry in the process.
    2. Something is interfering with a db write causing the lang entry to be wiped
    3. Something outside of WP is changing the db or causing a db write failure.

    Since you've changed themes & plugins, (1) seems unlikely. Would it be safe to assume that you don't have any custom functions that you've ported from 1 theme to the next?

    Option (2) was made me think of cron jobs.

    Option (3): do your hosts run regular backups/housekeeping tasks?

  13. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    My first theme didn't even have a functions.php! lol. But yeah, nothing is the same in that regard. My current functions are totally new actually, nothing in common

    As far as cron jobs, I'm not sure the best way to keep tabs on stuff.... just keep checking the feed for the lang attr to disappear and then investigate I guess?

    As for backups, etc.... I'm on godaddy, they keep backups of my files.... nothing for DB AFAIK, I run my own backups.... doesn't seem like those are related, but I'll test that too

  14. esmi
    Forum Moderator
    Posted 4 years ago #

    Getting some kind of timestamp on the db change would be a start...

    What if you wrote a function that was hooked into the init action that checked if the rss_language in the wp_option table was set and had a value == 'en'? If rss_language wasn't set or value != 'en', it could then send you an email.

  15. elfin
    Posted 4 years ago #

    esmi forgot to add, only do the above if you also reset the option up, otherwise you'll get flooded with emails.

    Either that or set a flag to say the email has been sent in last x hours and don't send it again.

  16. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    What if you wrote a function

    lol....good idea, if I knew how!

    I'm sure I can look into that, google is my friend!

    I did want to verify it wasn't post related, so I made another post now and reran the validator. All is well....so it seems I don't lose the lang attr when my feed is rebuilt

  17. elfin
    Posted 4 years ago #

    off the top of my head:

    function fix_my_rss_please(){
    		wp_mail('EMAIL ADDRESS', 'rss language lost again','but I auto fixed it');
  18. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    OK, its in place, thanks very much..... lets see what happens!

  19. elfin
    Posted 4 years ago #

    Don't forget to change 'EMAIL ADDRESS'

    and it wasn't quite off the top of my head, but you could do a quick test by deleting, or setting the option rss_language to something else.

  20. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    yeah, I adjusted the language to en-us, and put my email in there, thanks!

    Will give it a test now!

  21. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    Nice, it works, fixes my language, and sends me an email!

    Thanks very much. I'll consider this solved for my purposes. But next time the lang gets lost, I'll try to track down what happened and revisit this thread

  22. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    Ah hah! It just happened again, for the first time since this thread. I can't find anything causing it to happen. It was the middle of the day. I wasn't working on the site, nothing had been changed, I can't find anything that had occurred to cause it!

    But, thanks to the above code, at least its a non-issue

Topic Closed

This topic has been closed to new replies.

About this Topic