Make WordPress Core

Opened 15 years ago

Closed 12 years ago

#4231 closed enhancement (wontfix)

Change update-links to use RSS feeds instead of pingomatic

Reported by: Otto42 Owned by:
Milestone: Priority: low
Severity: normal Version: 2.3
Component: Cron API Keywords: needs-patch
Focuses: Cc:


pingomatic appears to not be working at the moment for the updated-batch function. But having these checks centralized in the first place is a bit silly, IMO. Why not have each blog check its own links? There's a space in the links for an RSS feed. While people probably don't fill it in, if they did, you could easily pull the RSS feed and check the last modified header. Just like so:

require_once( dirname( dirname(__FILE__) ) . '/wp-config.php');
require_once( ABSPATH . 'wp-includes/class-snoopy.php');
require_once( ABSPATH . 'wp-includes/rss.php');

if ( !get_option('use_linksupdate') )
	wp_die(__('Feature disabled.'));

$link_rsses = $wpdb->get_col("SELECT link_rss FROM $wpdb->links");
if ( !$link_rsses )
	wp_die(__('No links'));

foreach ($link_rsses as $rssurl)
	$feed = fetch_rss($rssurl);
	$mod = $feed->last_modified;
	if ($mod != null) {
		$modtime = strtotime($mod);
		$wpdb->query("UPDATE $wpdb->links SET link_updated = FROM_UNIXTIME($modtime) WHERE link_rss = '$rssurl'");

This uses the built in Magpie reader and checks the Last Modified http header that it finds/returns. Doesn't work with every RSS feed, but it does with all major blog feeds. And for those links without RSS feeds, they just don't get checked at all. No strain of pingomatic, no dependency on a centralized server.

Attachments (1)

4231.diff (2.9 KB) - added by Otto42 14 years ago.
Patch for #4230 AND #4231

Download all attachments as: .zip

Change History (6)

14 years ago

Patch for #4230 AND #4231

#1 @Otto42
14 years ago

  • Keywords has-patch added
  • Milestone changed from 2.4 (future) to 2.3 (trunk)
  • Version set to 2.3

Attached patch for #4230 and #4231 (combined patch for both, since they sorta relate). #4230 already has patch attached to it for just that issue (linking updated-links functionality to wp-cron), this does that but also changes update_links to use rss feeds instead of pingomatic.

#2 @Nazgul
14 years ago

  • Milestone changed from 2.3 to 2.4 (next)

#3 @ffemtcj
14 years ago

  • Milestone changed from 2.5 to 2.6

#4 @Denis-de-Bernardy
12 years ago

  • Component changed from Optimization to Cron
  • Keywords needs-patch added; has-patch removed
  • Milestone changed from 2.9 to Future Release

#5 @dd32
12 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

I've removed the Link update checking from core. This is better left for plugin material. See #12437

Note: See TracTickets for help on using tickets.