Skip to content
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

Link attributes injected in RSS feeds #51

Open
carlalexander opened this issue Feb 7, 2018 · 1 comment
Open

Link attributes injected in RSS feeds #51

carlalexander opened this issue Feb 7, 2018 · 1 comment
Assignees

Comments

@carlalexander
Copy link
Contributor

Amber injects its link attributes in RSS feeds. This isn't ideal since RSS feeds can't use this information. It would be better to disable this attribute injection for RSS feeds.

carlalexander added a commit to carlalexander/amber_wordpress that referenced this issue Feb 7, 2018
@jerclarke
Copy link

jerclarke commented Feb 7, 2018

Extra context: This was breaking our Varnish cache, which choked on RSS feeds which had long articles with many links because having all the Amber HTML inserted effectively doubles the length of such posts.

While we're also working to fix our Varnish to be able to handle extra-long content, it's nonetheless a big problem to have all this extra HTML which won't have any effect in RSS contexts. It increases the size of content which is likely to affect many different services that store the resulting HTML.

Thank you for considering fixing this. For anyone else who wants a fix, it is easily fixable using the filter we added in #48 with the following code:


/**
 * Disables Amber's URL lookup by returning an empty string for the URL.
 *
 * @param string $url
 *
 * @return string
 */
function gv_amber_disable_url_lookup($url) {
	if (is_feed())
		$url = '';

	return $url;
}
add_filter('amber_lookup_url', 'gv_amber_disable_url_lookup');

@jlicht jlicht self-assigned this Mar 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants