• my feed is somehow corrupted. I can’t figure out why there is a javascript feature showing in my rss feed. the feed is http://feeds.feedburner.com/ChristianEcology

    the error is on line 515 I believe. There has to be some sort of wordpress template which is appending the ad code to the end of my feed. I need to know:
    1. which .php file it is, and
    2. how to change it to make the feed work properly.

    thanks for the help in advance…

Viewing 14 replies - 1 through 14 (of 14 total)
  • Well, that is probably not the fault of podPress.

    The W3C Feed Validator show the source code of your feed and line 510 – 526 shows that the code contains after the end of the RSS feed content some code which not belongs there. It seems to me that this code is from the Beacon Ads. Where have you inserted the code? Or is it a real WP plugin?
    Furthermore as the comment at the end says, something seems to be wrong with the super cache plugin.

    #  </item>
    # </channel>
    # </rss>
    #
    #
    # <!-- Beacon Ads Ad Code -->
    # <script type="text/javascript">
    # (function(){
    # var bsa = document.createElement('script');
    #    bsa.type = 'text/javascript';
    #    bsa.async = true;
    #    bsa.src = '//cdn.beaconads.com/ac/beaconads.js';
    # (document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(bsa);
    # })();
    # </script>
    # <!-- END Beacon Ads Ad Code -->
    # <!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->

    Regards,
    Tim

    Thread Starter chilimac02

    (@chilimac02)

    I know I changed the wp-blog-header.php to include the code for the ad. I guess my question was originally, which page (php) is this code coming from?

    I deleted the code from the wp-blog-header.php, and still no luck. So, I must’ve put the code somewhere else when attempting to get the ad to work. My problem is I have no idea where…

    A tertiary question would be, how do I fix super cache?

    I have not used this Super Cache plugin so far and I’m not sure but the comment in the source code of your feed says:

    WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed!

    I guess there are more helping comments in this file and as it says, you probably need to correct a directory name.

    I’m using the editor program Scite to edit all kinds of files e.g. php, js, css, etc. That program has a feature called search through files. it searches throught the content of all files in a specified directory and its sub folders.

    Regards,
    Tim

    Thread Starter chilimac02

    (@chilimac02)

    super-cache seems to have given me one of the problems. It turns out that it is not even installed anymore. I tried installing it, and it crashed my site. How can I manually uninstall it? I’ve tried deleting the folder from the plugin directory via ftp. But, the supercache error still persists.

    The super-cache plugin leaves a comment in the feed but that is not the problem. The <script> section of the Beacon Ad makes the feed not valid.

    I would search in all the files of the blog for this comment and the <script> section e.g. with Scite.
    If it is not in the files then it is maybe in some old and unused option in the wp_options database table. If you uninstall a plugin then sometimes the plugins don’t remove options database entries on removal. Maybe there something left over of the super cache plugin. (You could search the super-cache plugin files for strings like get_option('name_of_the_option') to find out the names of the options of the plugin.)

    On the other hand if you have made changes to the WP core files and you do not remember which files you had modified and you want to remove the changes then you could remove all core files and upload fresh WP files.
    If after such an action these lines after the end of the RSS Feed are appearing then it is maybe in one of the theme files (e.g. functions.php).

    I have no idea how these snippets ending up after </rss>. But it seems to me that the comment of the super cache plugin and the JS snippet of Beacon Ad are placed there with the same method.
    If both are hard coded to a file e.g. /wp-includes/feed-rss2.php then you will maybe find both when you are searching for one of them.
    But it is likely that these lines of codes are added dynamically by some function in one of the files. Because they are in every feed.

    One possibility to add something after the </rss> tag is to use the action hook e.g. do_feed_atom -> add_action('do_feed_atom', 'add_something_after_the_end_of_the_atom_feed');
    The function would look somehow like:

    function add_something_after_the_end_of_the_atom_feed() {
    echo "\n <!-- Hello World --> \n";
    }

    This could be in a theme or a plugin file (or a modified WP core file).

    Either way your best chance to find these lines, is to search on the PHP files of your blog for the lines which you can see in the source code of the news feeds.
    So download all the files of your blog e.g. via FTP and use a program like Scite to search.

    Thread Starter chilimac02

    (@chilimac02)

    OK, I’m going to do this tonight. I’ll do the following:
    1 Download the site to my home PC
    2 Search for the ad code that’s screwing things up and remove it
    3 upload it all back to the server (well I guess just the files I change)
    4 check to see if problem is solved.

    Thread Starter chilimac02

    (@chilimac02)

    Holy crap sciTE is complicated. I think I’ll just cry instead of get this fixed.

    Thread Starter chilimac02

    (@chilimac02)

    I managed to sort through everything and run the search command. Only one file had the script in it. This means that my “core” files are corrupt I guess. How do I replace that?

    sciTE is complicated.

    I don’t know. Click on “Search” in the menu bar and head for “Find in Files”. A dialog box opens. Specify the folder with the files and the file name extension(s) of the files you like to search. That is it.

    Only one file had the script in it.

    Which file?

    Thread Starter chilimac02

    (@chilimac02)

    I found the code in the wp-blog-header.php file. That is the only place it is right now. When I took it out and refreshed the feed had the same problem. So, I put it back.

    The wp-blog-header.php file is a WP Core file and definitely not a good place to insert such code snippets. One reason is that you would have to modify the file every you update your WP version.
    Putting the code into the wp-blog-header.php file make your normal blog page invalid because the code is added outside the <html>-section.

    Besides that. What was your goal by inserting this Beacon code there?
    If you have tried to add this to your blogs header then should insert the <script>-section into the header.php of your current theme. Or consider using the wp_register_script and wp_enqueue_script function vie the function.php file of your theme.
    Leave this code in the code in the wp-blog-header.php file is not a good idea.
    If you post here the content of the header.php of your theme, I would help you to find the right place for the code.

    When I took it out and refreshed the feed had the same problem.

    If you make modifications to the feed producing functions and files then you have to clear the browser resp. feed reader cache before you start to load the feed again. Otherwise you will see no change.
    Did used Firefox or an other browser control your modifications? In my experience it is very typical for Firefox to cache the feed and not refreshing it after clicking simply on the refresh button.

    Thread Starter chilimac02

    (@chilimac02)

    got it, thanks for the help. you are a lifesaver.

    Thread Starter chilimac02

    (@chilimac02)

    but I can’t figure out where to put the ad code to make this work. It is supposed to go after the first <body> tag… what file is that in?

    Actually I would put it into the <head> section of the page.

    As I told above, look for the header.php of your theme. It can probably be found in /wp-content/themes/{name_of_your_theme}/header.php

    This file contains typically the <head> section and the first <body> tag.

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘Podpress feed corrupted’ is closed to new replies.