Remove the now defunct link update checker from core. Fixes #12437

git-svn-id: http://svn.automattic.com/wordpress/trunk@13744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
dd32 2010-03-18 07:17:55 +00:00
parent 65423c7d16
commit d51a95d091
4 changed files with 2 additions and 67 deletions

View File

@ -246,7 +246,6 @@ function populate_options() {
// 1.5
'default_email_category' => 1,
'recently_edited' => '',
'use_linksupdate' => 0,
'template' => WP_DEFAULT_THEME,
'stylesheet' => WP_DEFAULT_THEME,
'comment_whitelist' => 1,
@ -355,7 +354,7 @@ function populate_options() {
// Delete unused options
$unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval', 'deactivated_plugins', 'can_compress_scripts',
'page_uris', 'update_core', 'update_plugins', 'update_themes', 'doing_cron', 'random_seed', 'rss_excerpt_length', 'secret');
'page_uris', 'update_core', 'update_plugins', 'update_themes', 'doing_cron', 'random_seed', 'rss_excerpt_length', 'secret', 'use_linksupdate');
foreach ($unusedoptions as $option)
delete_option($option);

View File

@ -27,14 +27,6 @@ include('admin-header.php');
<?php settings_fields('misc'); ?>
<table class="form-table">
<tr>
<th scope="row" class="th-full">
<label for="use_linksupdate">
<input name="use_linksupdate" type="checkbox" id="use_linksupdate" value="1"<?php checked('1', get_option('use_linksupdate')); ?> />
<?php _e('Track links&#8217; update times') ?>
</label>
</th>
</tr>
<?php do_settings_fields('misc', 'default'); ?>
</table>

View File

@ -36,7 +36,7 @@ if ( is_multisite() && !is_super_admin() && 'update' != $action )
$whitelist_options = array(
'general' => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string' ),
'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status', 'comments_notify', 'moderation_notify', 'comment_moderation', 'require_name_email', 'comment_whitelist', 'comment_max_links', 'moderation_keys', 'blacklist_keys', 'show_avatars', 'avatar_rating', 'avatar_default', 'close_comments_for_old_posts', 'close_comments_days_old', 'thread_comments', 'thread_comments_depth', 'page_comments', 'comments_per_page', 'default_comments_page', 'comment_order', 'comment_registration' ),
'misc' => array( 'use_linksupdate' ),
'misc' => array( '' ),
'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type', 'embed_autourls', 'embed_size_w', 'embed_size_h', 'uploads_use_yearmonth_folders', 'upload_path', 'upload_url_path' ),
'privacy' => array( 'blog_public' ),
'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'blog_charset', 'show_on_front', 'page_on_front', 'page_for_posts' ),

View File

@ -1,56 +0,0 @@
<?php
/**
* Send blog links to pingomatic.com to update.
*
* You can disable this feature by deleting the option 'use_linksupdate' or
* setting the option to false. If no links exist, then no links are sent.
*
* Snoopy is included, but is not used. Fsockopen() is used instead to send link
* URLs.
*
* @package WordPress
* @subpackage Administration
*/
/** Load WordPress Bootstrap */
require_once('../wp-load.php');
if ( !get_option('use_linksupdate') )
wp_die(__('Feature disabled.'));
$link_uris = $wpdb->get_col("SELECT link_url FROM $wpdb->links");
if ( !$link_uris )
wp_die(__('No links'));
$link_uris = urlencode( join( $link_uris, "\n" ) );
$query_string = "uris=$link_uris";
$options = array();
$options['timeout'] = 30;
$options['body'] = $query_string;
$options['headers'] = array(
'content-type' => 'application/x-www-form-urlencoded; charset='.get_option('blog_charset'),
'content-length' => strlen( $query_string ),
);
$response = wp_remote_get('http://api.pingomatic.com/updated-batch/', $options);
if ( is_wp_error( $response ) )
wp_die(__('Request Failed.'));
if ( $response['response']['code'] != 200 )
wp_die(__('Request Failed.'));
$body = str_replace(array("\r\n", "\r"), "\n", $response['body']);
$returns = explode("\n", $body);
foreach ($returns as $return) {
$time = substr($return, 0, 19);
$uri = preg_replace('/(.*?) | (.*?)/', '$2', $return);
$wpdb->update( $wpdb->links, array('link_updated' => $time), array('link_url' => $uri) );
}
?>