Hi all –
Ran into the same issues with the Sermon Manager plugin while using the WordPress SEO plugin. Was trying to generate a sitemap XML file for Google, and was constantly getting the error:
ERROR: This is not a valid feed template.
Turns out the problem is that the sermon manager plugin has a bad rewrite declaration in the code of the following file:
…/plugins/sermon-manager-for-wordpress/includes/podcast-functions.php
specifically, lines 132-139:
131 // Custom rewrite for podcast feed
132 function wpfc_sermon_podcast_feed_rewrite($wp_rewrite) {
133 $feed_rules = array(
134 'feed/(.+)' => 'index.php?feed=' . $wp_rewrite->preg_index(1),
135 '(.+).xml' => 'index.php?feed='. $wp_rewrite->preg_index(1)
136 );
137 $wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;
138 }
139 add_filter('generate_rewrite_rules', 'wpfc_sermon_podcast_feed_rewrite');
The problem is that the rewrite specified on line 135 basically takes over ALL files with an XML extension, which is definitely not right. Personally, I’ve disabled this code on at least one of the sites we manage, as the SEO functionality outweighs a podcast feed.
For a permanent fix, I’d suggest that the plugin should have a hard-set prefix for it’s own podcast XML files? For instance, changing lines 134-135 to be something like:
134 'feed/smpodcast-(.+)' => 'index.php?feed=' . $wp_rewrite->preg_index(1),
135 'smpodcast-(.+).xml' => 'index.php?feed='. $wp_rewrite->preg_index(1)
So that it doesn’t interfere with other XML feed files or declarations that people might use… but I’ll leave the choice on that approach vs. another up to the plugin author.
For now, you can also solve this issue by commenting out line 139 (that activates the XML filter being declared), and then re-saving your permalink settings in WordPress.
Hope that helps!
twykr