Ticket #19573: 19573.2.diff
File 19573.2.diff, 7.3 KB (added by , 12 years ago) |
---|
-
wp-admin/includes/dashboard.php
70 70 wp_add_dashboard_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_incoming_links', 'wp_dashboard_incoming_links_control' ); 71 71 } 72 72 73 // WP Plugins Widget74 if ( ( ! is_multisite() && is_blog_admin() && current_user_can( 'install_plugins' ) ) || ( is_network_admin() && current_user_can( 'manage_network_plugins' ) && current_user_can( 'install_plugins' ) ) )75 wp_add_dashboard_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_plugins' );76 77 73 // QuickPress Widget 78 74 if ( is_blog_admin() && current_user_can('edit_posts') ) 79 75 wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press' ); … … 934 930 } 935 931 } 936 932 937 function wp_dashboard_plugins() {938 wp_dashboard_cached_rss_widget( 'dashboard_plugins', 'wp_dashboard_plugins_output', array(939 'http://wordpress.org/extend/plugins/rss/browse/popular/',940 'http://wordpress.org/extend/plugins/rss/browse/new/',941 'http://wordpress.org/extend/plugins/rss/browse/updated/'942 ) );943 }944 945 933 /** 946 * Display plugins most popular, newest plugins, and recently updated widget text.947 *948 * @since 2.5.0949 */950 function wp_dashboard_plugins_output() {951 $popular = fetch_feed( 'http://wordpress.org/extend/plugins/rss/browse/popular/' );952 $new = fetch_feed( 'http://wordpress.org/extend/plugins/rss/browse/new/' );953 $updated = fetch_feed( 'http://wordpress.org/extend/plugins/rss/browse/updated/' );954 955 if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) {956 $plugin_slugs = array_keys( get_plugins() );957 set_transient( 'plugin_slugs', $plugin_slugs, 86400 );958 }959 960 foreach ( array( 'popular' => __('Most Popular'), 'new' => __('Newest Plugins'), 'updated' => __('Recently Updated') ) as $feed => $label ) {961 if ( is_wp_error($$feed) || !$$feed->get_item_quantity() )962 continue;963 964 $items = $$feed->get_items(0, 5);965 966 // Pick a random, non-installed plugin967 while ( true ) {968 // Abort this foreach loop iteration if there's no plugins left of this type969 if ( 0 == count($items) )970 continue 2;971 972 $item_key = array_rand($items);973 $item = $items[$item_key];974 975 list($link, $frag) = explode( '#', $item->get_link() );976 977 $link = esc_url($link);978 if ( preg_match( '|/([^/]+?)/?$|', $link, $matches ) )979 $slug = $matches[1];980 else {981 unset( $items[$item_key] );982 continue;983 }984 985 // Is this random plugin's slug already installed? If so, try again.986 reset( $plugin_slugs );987 foreach ( $plugin_slugs as $plugin_slug ) {988 if ( $slug == substr( $plugin_slug, 0, strlen( $slug ) ) ) {989 unset( $items[$item_key] );990 continue 2;991 }992 }993 994 // If we get to this point, then the random plugin isn't installed and we can stop the while().995 break;996 }997 998 // Eliminate some common badly formed plugin descriptions999 while ( ( null !== $item_key = array_rand($items) ) && false !== strpos( $items[$item_key]->get_description(), 'Plugin Name:' ) )1000 unset($items[$item_key]);1001 1002 if ( !isset($items[$item_key]) )1003 continue;1004 1005 // current bbPress feed item titles are: user on "topic title"1006 if ( preg_match( '/"(.*)"/s', $item->get_title(), $matches ) )1007 $title = $matches[1];1008 else // but let's make it forward compatible if things change1009 $title = $item->get_title();1010 $title = esc_html( $title );1011 1012 $description = esc_html( strip_tags(@html_entity_decode($item->get_description(), ENT_QUOTES, get_option('blog_charset'))) );1013 1014 $ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $slug, 'install-plugin_' . $slug) .1015 '&TB_iframe=true&width=600&height=800';1016 1017 echo "<h4>$label</h4>\n";1018 echo "<h5><a href='$link'>$title</a></h5> <span>(<a href='$ilink' class='thickbox' title='$title'>" . __( 'Install' ) . "</a>)</span>\n";1019 echo "<p>$description</p>\n";1020 1021 $$feed->__destruct();1022 unset($$feed);1023 }1024 }1025 1026 /**1027 934 * Checks to see if all of the feed url in $check_urls are cached. 1028 935 * 1029 936 * If $check_urls is empty, look for the rss feed url found in the dashboard -
wp-admin/js/plugin-install.dev.js
27 27 28 28 $(window).resize(function(){ tb_position(); }); 29 29 30 $(' #dashboard_plugins a.thickbox,.plugins a.thickbox').click( function() {30 $('.plugins a.thickbox').click( function() { 31 31 tb_click.call(this); 32 32 33 33 $('#TB_title').css({'background-color':'#222','color':'#cfcfcf'}); -
wp-admin/js/dashboard.dev.js
33 33 'dashboard_incoming_links', 34 34 'dashboard_primary', 35 35 'dashboard_secondary', 36 'dashboard_plugins'37 36 ]; 38 37 39 38 ajaxPopulateWidgets = function(el) { -
wp-admin/index-extra.php
31 31 wp_dashboard_secondary(); 32 32 break; 33 33 34 case 'dashboard_plugins' :35 wp_dashboard_plugins();36 break;37 38 34 } 39 35 40 36 ?> 41 No newline at end of file -
wp-admin/css/wp-admin-rtl.dev.css
1749 1749 #dashboard_right_now p.sub, 1750 1750 #dashboard-widgets h4, 1751 1751 a.rsswidget, 1752 #dashboard_plugins h4,1753 #dashboard_plugins h5,1754 1752 #dashboard_recent_comments .comment-meta .approve { 1755 1753 font-family: Tahoma, Arial; 1756 1754 } … … 1789 1787 clear: left; 1790 1788 } 1791 1789 1792 #dashboard_plugins .inside span {1793 padding-left: 0;1794 padding-right: 5px;1795 }1796 1797 1790 #dashboard-widgets h3 .postbox-title-action { 1798 1791 right: auto; 1799 1792 left: 30px; -
wp-admin/css/wp-admin.dev.css
683 683 684 684 div.sidebar-name h3, 685 685 #menu-management .nav-tab, 686 #dashboard_plugins h5,687 686 a.rsswidget, 688 687 #dashboard_right_now td.b, 689 688 #dashboard-widgets h4, … … 5840 5839 content: '\2014'; 5841 5840 } 5842 5841 5843 /* Plugins */5844 #dashboard_plugins h4 {5845 line-height: 1.7em;5846 }5847 5848 #dashboard_plugins h5 {5849 font-weight: normal;5850 font-size: 13px;5851 margin: 0;5852 display: inline;5853 line-height: 1.4em;5854 }5855 5856 #dashboard_plugins h5 a {5857 line-height: 1.4em;5858 }5859 5860 #dashboard_plugins .inside span {5861 font-size: 12px;5862 padding-left: 5px;5863 }5864 5865 #dashboard_plugins p {5866 margin: 0.3em 0 1.4em;5867 line-height: 1.4em;5868 }5869 5870 5842 .dashboard-comment-wrap { 5871 5843 overflow: hidden; 5872 5844 word-wrap: break-word; -
wp-admin/css/ie-rtl.dev.css
103 103 margin-right: 335px !important; 104 104 } 105 105 106 #dashboard_plugins {107 direction: ltr;108 }109 110 #dashboard_plugins h3.hndle {111 direction: rtl;112 }113 114 106 #dashboard_incoming_links ul li, 115 107 #dashboard_secondary ul li, 116 108 #dashboard_primary ul li,