PressForward is a free plugin that provides an editorial workflow for content aggregation and curation within the WordPress dashboard. It is designed for bloggers and editorial teams who wish to collect, discuss, and share content from a variety of sources on the open web.
GNU Affero General Public License v3.0
120
stars
21
forks
source link
Health checks for RSS feeds should be separated out of creation flow #1174
RSS fetching is slow, especially when PF makes attempts to guess at feed URLs when requests fail. See https://github.com/PressForward/pressforward/blob/b201eed4618247ebda538c9da21430423711d5cd/Core/Schema/Feeds.php#L928, etc. I gather that this slowness is part of the reason for the 'rss-quick' feed type, which doesn't do this kind of external check and relies on the passed title (or, as a fallback, the URL) when creating the Feed. The slowness problem is greatly exacerbated when creating Feeds in bulk, as in the case of OPML import.
Let's separate out some of these concerns:
Feed creation should not require external pings. If no title is provided, use the feed URL. I'm hopeful this will allow us to do away with the concept of 'rss-quick', since all RSS feeds will be "quick".
It's reasonable to want to do a "health check", both to verify that the feed address is valid and also to collect Title info. Let's do it separately. We can create a cron job that will run right after creation.
I've made the necessary changes and removed all use of 'rss-quick', aside from what's necessary to maintain backward compatibility with existing installations that have feeds of this type.
When creating a Feed of the 'rss' type, PF fetches the feed. This is done to check whether the feed exists, and to collect certain pieces of information, like title, which are used to create the feed. See https://github.com/PressForward/pressforward/blob/b201eed4618247ebda538c9da21430423711d5cd/Core/Schema/Feeds.php#L922
RSS fetching is slow, especially when PF makes attempts to guess at feed URLs when requests fail. See https://github.com/PressForward/pressforward/blob/b201eed4618247ebda538c9da21430423711d5cd/Core/Schema/Feeds.php#L928, etc. I gather that this slowness is part of the reason for the 'rss-quick' feed type, which doesn't do this kind of external check and relies on the passed title (or, as a fallback, the URL) when creating the Feed. The slowness problem is greatly exacerbated when creating Feeds in bulk, as in the case of OPML import.
Let's separate out some of these concerns: