Make WordPress Core

Ticket #19573: 19573.2.diff

File 19573.2.diff, 7.3 KB (added by ryan, 12 years ago)

Remove Plugins dashboard widget.

  • wp-admin/includes/dashboard.php

     
    7070                wp_add_dashboard_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_incoming_links', 'wp_dashboard_incoming_links_control' );
    7171        }
    7272
    73         // WP Plugins Widget
    74         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 
    7773        // QuickPress Widget
    7874        if ( is_blog_admin() && current_user_can('edit_posts') )
    7975                wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press' );
     
    934930        }
    935931}
    936932
    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 
    945933/**
    946  * Display plugins most popular, newest plugins, and recently updated widget text.
    947  *
    948  * @since 2.5.0
    949  */
    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 plugin
    967                 while ( true ) {
    968                         // Abort this foreach loop iteration if there's no plugins left of this type
    969                         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 descriptions
    999                 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 change
    1009                         $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>&nbsp;<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 /**
    1027934 * Checks to see if all of the feed url in $check_urls are cached.
    1028935 *
    1029936 * If $check_urls is empty, look for the rss feed url found in the dashboard
  • wp-admin/js/plugin-install.dev.js

     
    2727
    2828        $(window).resize(function(){ tb_position(); });
    2929
    30          $('#dashboard_plugins a.thickbox, .plugins a.thickbox').click( function() {
     30         $('.plugins a.thickbox').click( function() {
    3131                tb_click.call(this);
    3232
    3333                $('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
  • wp-admin/js/dashboard.dev.js

     
    3333                'dashboard_incoming_links',
    3434                'dashboard_primary',
    3535                'dashboard_secondary',
    36                 'dashboard_plugins'
    3736        ];
    3837
    3938        ajaxPopulateWidgets = function(el) {
  • wp-admin/index-extra.php

     
    3131        wp_dashboard_secondary();
    3232        break;
    3333
    34 case 'dashboard_plugins' :
    35         wp_dashboard_plugins();
    36         break;
    37 
    3834}
    3935
    4036?>
    41  No newline at end of file
  • wp-admin/css/wp-admin-rtl.dev.css

     
    17491749#dashboard_right_now p.sub,
    17501750#dashboard-widgets h4,
    17511751a.rsswidget,
    1752 #dashboard_plugins h4,
    1753 #dashboard_plugins h5,
    17541752#dashboard_recent_comments .comment-meta .approve {
    17551753        font-family: Tahoma, Arial;
    17561754}
     
    17891787        clear: left;
    17901788}
    17911789
    1792 #dashboard_plugins .inside span {
    1793          padding-left: 0;
    1794          padding-right: 5px;
    1795 }
    1796 
    17971790#dashboard-widgets h3 .postbox-title-action {
    17981791        right: auto;
    17991792        left: 30px;
  • wp-admin/css/wp-admin.dev.css

     
    683683
    684684div.sidebar-name h3,
    685685#menu-management .nav-tab,
    686 #dashboard_plugins h5,
    687686a.rsswidget,
    688687#dashboard_right_now td.b,
    689688#dashboard-widgets h4,
     
    58405839        content: '\2014';
    58415840}
    58425841
    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 
    58705842.dashboard-comment-wrap {
    58715843        overflow: hidden;
    58725844        word-wrap: break-word;
  • wp-admin/css/ie-rtl.dev.css

     
    103103        margin-right: 335px !important;
    104104}
    105105
    106 #dashboard_plugins {
    107         direction: ltr;
    108 }
    109 
    110 #dashboard_plugins h3.hndle {
    111         direction: rtl;
    112 }
    113 
    114106#dashboard_incoming_links ul li,
    115107#dashboard_secondary ul li,
    116108#dashboard_primary ul li,