Ticket #8781: 8781.4.patch
File 8781.4.patch, 5.1 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 $plugin_slugs = array(); 715 foreach ( $all_plugins as $slug => $plugin ) 716 $plugin_slugs[] = $slug; 717 update_option( 'plugin_slugs', $plugin_slugs ); 718 } 719 711 720 foreach ( array( 'popular' => __('Most Popular'), 'new' => __('Newest Plugins'), 'updated' => __('Recently Updated') ) as $feed => $label ) { 712 721 if ( !isset($$feed->items) || 0 == count($$feed->items) ) 713 722 continue; 714 723 715 724 $$feed->items = array_slice($$feed->items, 0, 5); 716 $item_key = array_rand($$feed->items);717 725 726 // Pick a random, non-installed plugin 727 unset( $item ); 728 while ( empty($item) ) { 729 // Abort entirely if there's no items left for this part 730 if ( 0 == count($$feed->items) ) 731 continue 2; 732 733 $item_key = array_rand($$feed->items); 734 $item = $$feed->items[$item_key]; 735 736 list($link, $frag) = explode( '#', $item['link'] ); 737 738 $link = clean_url($link); 739 if( preg_match('|/([^/]+?)/?$|', $link, $matches) ) 740 $slug = $matches[1]; 741 else 742 $slug = ''; 743 744 // Check to see if this random plugin is already installed. If so, try a different one. 745 reset( $plugin_slugs ); 746 foreach ( $plugin_slugs as $plugin_slug ) { 747 if ( $slug == substr( $plugin_slug, 0, strlen( $slug ) ) ) { 748 unset( $item, $$feed->items[$item_key] ); 749 continue 2; 750 } 751 } 752 753 // We can stop looping as this random plugin isn't installed 754 break; 755 } 756 718 757 // Eliminate some common badly formed plugin descriptions 719 758 while ( ( null !== $item_key = array_rand($$feed->items) ) && false !== strpos( $$feed->items[$item_key]['description'], 'Plugin Name:' ) ) 720 759 unset($$feed->items[$item_key]); … … 722 761 if ( !isset($$feed->items[$item_key]) ) 723 762 continue; 724 763 725 $item = $$feed->items[$item_key];726 727 764 // current bbPress feed item titles are: user on "topic title" 728 765 if ( preg_match( '/"(.*)"/s', $item['title'], $matches ) ) 729 766 $title = $matches[1]; … … 733 770 734 771 $description = wp_specialchars( strip_tags(html_entity_decode($item['description'], ENT_QUOTES)) ); 735 772 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 773 $ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $slug, 'install-plugin_' . $slug) . 745 774 '&TB_iframe=true&width=600&height=800'; 746 775 -
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
213 213 $recent_plugins = array(); 214 214 $recently_activated = (array) get_option('recently_activated'); 215 215 216 //Clean out any plugins which were deactivated over a week ago. 216 // Update the slug cache 217 $plugin_slugs = array(); 218 foreach ( $plugin_slugs as $slug => $plugin ) 219 $plugin_slugs[] = $slug; 220 update_option( 'plugin_slugs', $plugin_slugs ); 221 222 // Clean out any plugins which were deactivated over a week ago. 217 223 foreach ( $recently_activated as $key => $time ) 218 224 if ( $time + (7*24*60*60) < time() ) //1 week 219 225 unset($recently_activated[ $key ]);