Ticket #8781: 8781.6.patch
File 8781.6.patch, 4.9 KB (added by , 16 years ago) |
---|
-
wp-admin/includes/dashboard.php
708 708 $new = @fetch_rss( 'http://wordpress.org/extend/plugins/rss/browse/new/' ); 709 709 $updated = @fetch_rss( 'http://wordpress.org/extend/plugins/rss/browse/updated/' ); 710 710 711 $plugin_slugs = get_option( 'plugin_slugs' ); 712 if ( !is_array($plugin_slugs) ) { 713 $all_plugins = get_plugins(); 714 update_option( 'plugin_slugs', array_keys($all_plugins) ); 715 } 716 711 717 foreach ( array( 'popular' => __('Most Popular'), 'new' => __('Newest Plugins'), 'updated' => __('Recently Updated') ) as $feed => $label ) { 712 718 if ( !isset($$feed->items) || 0 == count($$feed->items) ) 713 719 continue; 714 720 715 721 $$feed->items = array_slice($$feed->items, 0, 5); 716 $item_key = array_rand($$feed->items);717 722 723 // Pick a random, non-installed plugin 724 while ( true ) { 725 // Abort entirely if there's no items left for this part 726 if ( 0 == count($$feed->items) ) 727 continue 2; 728 729 $item_key = array_rand($$feed->items); 730 $item = $$feed->items[$item_key]; 731 732 list($link, $frag) = explode( '#', $item['link'] ); 733 734 $link = clean_url($link); 735 if( preg_match('|/([^/]+?)/?$|', $link, $matches) ) 736 $slug = $matches[1]; 737 else 738 $slug = ''; 739 740 // Check to see if this random plugin is already installed. If so, try a different one. 741 reset( $plugin_slugs ); 742 foreach ( $plugin_slugs as $plugin_slug ) { 743 if ( $slug == substr( $plugin_slug, 0, strlen( $slug ) ) ) { 744 unset( $$feed->items[$item_key] ); 745 continue 2; 746 } 747 } 748 749 // We can stop looping as this random plugin isn't installed 750 break; 751 } 752 718 753 // Eliminate some common badly formed plugin descriptions 719 754 while ( ( null !== $item_key = array_rand($$feed->items) ) && false !== strpos( $$feed->items[$item_key]['description'], 'Plugin Name:' ) ) 720 755 unset($$feed->items[$item_key]); … … 722 757 if ( !isset($$feed->items[$item_key]) ) 723 758 continue; 724 759 725 $item = $$feed->items[$item_key];726 727 760 // current bbPress feed item titles are: user on "topic title" 728 761 if ( preg_match( '/"(.*)"/s', $item['title'], $matches ) ) 729 762 $title = $matches[1]; … … 733 766 734 767 $description = wp_specialchars( strip_tags(html_entity_decode($item['description'], ENT_QUOTES)) ); 735 768 736 list($link, $frag) = explode( '#', $item['link'] );737 738 $link = clean_url($link);739 if( preg_match('|/([^/]+?)/?$|', $link, $matches) )740 $slug = $matches[1];741 else742 $slug = '';743 744 769 $ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $slug, 'install-plugin_' . $slug) . 745 770 '&TB_iframe=true&width=600&height=800'; 746 771 -
wp-admin/includes/schema.php
302 302 add_option('update_core', array()); 303 303 add_option('dismissed_update_core', array()); 304 304 305 // 2.7.1 306 add_option('plugin_slugs', '', '', 'no'); 307 305 308 // Delete unused options 306 309 $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'); 307 310 foreach ($unusedoptions as $option) : -
wp-admin/plugins.php
212 212 $inactive_plugins = array(); 213 213 $recent_plugins = array(); 214 214 $recently_activated = (array) get_option('recently_activated'); 215 update_option( 'plugin_slugs', array_keys($all_plugins) ); 215 216 216 // Clean out any plugins which were deactivated over a week ago.217 // Clean out any plugins which were deactivated over a week ago. 217 218 foreach ( $recently_activated as $key => $time ) 218 219 if ( $time + (7*24*60*60) < time() ) //1 week 219 220 unset($recently_activated[ $key ]);