WordPress.org

Make WordPress Core

Opened 11 years ago

Last modified 9 years ago

#4604 closed enhancement

Feeds should be canonical — at Version 20

Reported by: gnot Owned by: westi
Milestone: 2.7 Priority: high
Severity: normal Version: 2.2.1
Component: General Keywords: feed, needs-patch
Focuses: Cc:

Description (last modified by lloydbudd)

Feeds should be canonical

WAS

The author feed _always_ delivers full content

The author-feed neither respects the WP options or the the use of the <!--more--> tag.

Full content is always delivered.

Change History (21)

#1 @Otto42
11 years ago

No, it doesn't. At least, not that I see.

We need more information. How do you reproduce this issue?

#2 @foolswisdom
11 years ago

  • Milestone set to 2.4 (future)

#3 follow-up: @gnot
11 years ago

The settings:

  • Options->Reading->Syndication Feeds
    • Show 10
    • Full text
  • The post has the <!--more--> tag

Assuming that the author's ID is 1, visit:

http://example.org/wp-rss2.php?author=1
http://example.org/wp-atom.php?author=1
http://example.org/wp-rdf.php?author=1

The <!--more--> tag is ignored.

Indeed, it does not occur when using the permalink, eg

http://example.org/author/USERNAME/feed/

If you still cannot reproduce it, I will test it in a fresh wp installation. Didn't have the time to do so.

#4 @gnot
11 years ago

Forgot to mention that the same happens (full feed is delivered), if the settings include:

  • Options->Reading->Syndication Feeds
    • Show 10
    • Summary

And you visit ht eforementioned URLs

http://example.org/wp-rss2.php?author=1
http://example.org/wp-atom.php?author=1
http://example.org/wp-rdf.php?author=1

#5 in reply to: ↑ 3 @Otto42
11 years ago

Replying to gnot:

Assuming that the author's ID is 1, visit:

http://example.org/wp-rss2.php?author=1
http://example.org/wp-atom.php?author=1
http://example.org/wp-rdf.php?author=1

The <!--more--> tag is ignored.

Indeed, it does not occur when using the permalink, eg

http://example.org/author/USERNAME/feed/

If you still cannot reproduce it, I will test it in a fresh wp installation. Didn't have the time to do so.

I have yet to test it that way, however:
http://example.org/wp-rss2.php

Is not a valid feed URL. Feed url's should always be one of the following:
http://example.org/feed/
http://example.org/?feed=rss2
http://example.org/index.php?feed=rss2

Calling wp-rss2 or any of those php files directly is very likely going to give you different results. This is why using any of the functions in WordPress that actually *generate* the feed URLs will never, ever, give you a direct link to those PHP files.

As for your specific problem with these author URLs, while I cannot say that that is intended behavior, I could explain why it happens. But I can also tell you that if you use the internal WP functions to generate feed links (like get_author_rss_link() ), you won't be getting back http://example.org/wp-rss2.php?author=1, ever.

I recommend you use the get_author_rss_link() function to get author feed links instead of trying to build them yourself. Or, at least, use normal feed links and don't directly link to files outside of the normal execution path.

I also recommend closing this ticket as invalid, but I'll leave that call to somebody else.

#6 @gnot
11 years ago

Hello Otto,

Despite the http://example.org/wp-rss2.php?author=N, for example, not being considered a valid RSS 2.0 feed address, this URL still delivers the full content, regardless of the publisher's wish in many cases.

Although I agree with you that it is not a problem when judging it from the perspective of functionality, as no wordpress template function will ever return such a feed URL, on the other hand it is a decent way to leech the full content of a website in a clean and easy way. What I want to emphasize is the fact that if a publisher chooses not to deliver full content through the feeds, the software should respect that wish and should not deliver the full content to third parties by any other method except for the HTML page.

As you say, what happens is not the intended behaviour, the result is 100% unexpected, so I don't see why this ticket should be closed or why it should be marked as invalid. I recommend that you give it a second thought.

Kind regards

#7 follow-up: @Otto42
11 years ago

Well, the simplest solution is simply to delete those files entirely. Remove the wp-rss2.php and wp-rdf.php and wp-atom.php and wp-rss.php and wp-commentsrss2.php files... Those are only there for backward compatibility anyway, and in Wordpress 2.2.1 and up, they're entirely unnecessary.

Heck, even after you dump them, their URLs will still work, because there are rewrite rules in place to handle those old URLs, assuming you have mod_rewrite and the .htaccess file working.

So the simplest fix: Delete them. That would get a +1 from me. Modifying them to fix this issue is a wasted effort.

#8 @Nazgul
11 years ago

Axing them would get a +1 from me as well.

#9 follow-up: @markjaquith
11 years ago

What about a transition period during which those files redirect to their ?feed=foo counterparts? Wouldn't be nice to just yank those cold turkey.

#10 @gnot
11 years ago

After a second thought, the transition period Mark suggested gets a +1 from me, as long as it does not raise any issues.

Nevertheless, I am off to delete those files! :)

#11 in reply to: ↑ 7 @gnot
11 years ago

Replying to Otto42:

Heck, even after you dump them, their URLs will still work, because there are rewrite rules in place to handle those old URLs, assuming you have mod_rewrite and the .htaccess file working.

Indeed, but, fortunately, the content is delivered in the proper way. Thanks for the solution.

#12 in reply to: ↑ 9 @Otto42
11 years ago

Replying to markjaquith:

What about a transition period during which those files redirect to their ?feed=foo counterparts? Wouldn't be nice to just yank those cold turkey.

Assuming the rewriting is working, the URLs continue to work even without those files being actually present. Is that enough, or do you think we should replace them with actual redirects?

#13 @markjaquith
11 years ago

People without mod_rewrite permalinks are MUCH more likely to be using these files directly. So yeah, I still think that the files should do a PHP 301 redirect.

@Otto42
11 years ago

Makes the root feed files do 301 redirects.

#14 @Otto42
11 years ago

Added patch to make all the root feed files do redirects to the correct URLs (as given by bloginfo() calls).

I still think the better course is to delete these files entirely from trunk. Let people fix their templates to not reference them at all. Still, if you really prefer to force 301's, this should work.

#15 @Otto42
11 years ago

  • Keywords has-patch added

#16 @markjaquith
11 years ago

That won't help people who are already subscribed. Without a 301 redirect, blogs who used those URLs will lose all of their subscribers.

#17 @ryan
10 years ago

I'm +1 for 301.

#18 @westi
10 years ago

  • Owner changed from anonymous to westi
  • Status changed from new to assigned

I can't reproduce the original issue.

But I think the 301 idea is good..

Make sure feeds are canonical!

#19 @westi
10 years ago

  • Keywords needs-patch added; has-patch removed

Note that for Permalink enabled blogs the builtin rewrite rules from [4551] for #3214 ensure that these files are never used if called directly with no arguments.

If we want to redirect and make feed link canonical the this change alone won't help for permalink enabled blogs.

This change will only be required for permalink free blogs.

Marking as needs_patch as the patch is incorrect (use get_bloginfo as bloginfo echo's) and no longer applies.

#20 @lloydbudd
10 years ago

  • Description modified (diff)
  • Milestone changed from 2.5 to 2.7
  • Summary changed from The author feed _always_ delivers full content to Feeds should be canonical
  • Type changed from defect to enhancement
Note: See TracTickets for help on using tickets.