-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Helper For Feed: XML Error Due To Empty Attribute "data-rocket-preload" #121
Comments
Hewwo, I'm coming back with almost 3 hours of playing around with said plugin. So the issue is that this LCP optimization kicks in. And from how I got it, this could be prevented by setting the I've tried quite a lot of variations on where to put the constant to, because I don't have a feed template in my theme, and frankly, the only reason I would need one, is to prevent WP Rocket from "optimizing" the RSS feed. So the plugin should do it. :) What I have tried is the following: in add_action( 'plugins_loaded', 'wp_rocket_cache_feed_init' ); and added this below that line: add_action('template_redirect', 'wp_rocket_cache_feed_but_without_optimization');
function wp_rocket_cache_feed_but_without_optimization() {
if ( is_feed() ) {
echo '<!--';
if ( defined( 'DONOTROCKETOPTIMIZE' ) ) {
var_dump( DONOTROCKETOPTIMIZE );
} else {
echo '!! bool(false)'.PHP_EOL;
define( 'DONOTROCKETOPTIMIZE', true );
var_dump( DONOTROCKETOPTIMIZE );
}
echo '-->';
if ( ! defined( 'DONOTROCKETOPTIMIZE' ) ) {
define( 'DONOTROCKETOPTIMIZE', true );
}
}
} The hook Obviously, I have some debug code in my snippet because I wanted to see where we are. When I am logged in, As a guest, This seems to be too late though. While I DO HAVE confirmation as a comment in the cached feed: <!--!! bool(false)
bool(true)
--> it still applies the optimizations, and thus the Is anyone smarter than me? How can I set Thank you! |
Hello, it's me again :) I am sorry to report I had to disable this plugin. It invalidated the feeds too much, so not only Feedburner has a problem with them, but also other readers, ex. WordPress' very own RSS parser which we use as a sidebar widget. It says:
Well, there was no line 197, but 196 was a bunch of WPR bacon JS (after |
Describe the bug
The helper handles a feed like a regular HTML page, and thus notes preload attributes. Leaving them empty causes a parse error (on pedantic readers at least), see:
https://feeds.feedburner.com/apfelpage
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Maybe the helper should prevent changing code in non-html documents.
Screenshots

Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
We've installed the feed cacher because Claudebot was a little over-ambitious and since feeds were loaded from the database, it put a lot of work on the server. Thus, the feed cacher.
This issue might be slightly related with this one.
#117
The text was updated successfully, but these errors were encountered: