Index: src/wp-admin/css/list-tables.css
===================================================================
--- src/wp-admin/css/list-tables.css (revision 29023)
+++ src/wp-admin/css/list-tables.css (working copy)
@@ -1215,6 +1215,61 @@
margin: 2.5em 0 8px;
}
+/* Plugin card table view */
+.plugin-card {
+ width: 45%;
+ float: left;
+ margin: 0 2em 2em 0;
+ background-color: #fff;
+ border: 1px solid #dedede;
+}
+@media screen and ( max-width: 782px ) {
+ .plugin-card {
+ width: 100%;
+ }
+}
+.plugin-card:nth-child(odd) {
+ clear: both;
+}
+.plugin-card-top {
+ padding: 0 1em;
+}
+.plugin-card .banner img {
+ margin-top: 1em;
+ max-width: 100%;
+}
+.plugin-card-bottom {
+ background-color: #fafafa;
+ border-top: 1px solid #dedede;
+ padding: 1em;
+ overflow: hidden; /* Makes the container full height. I have no idea why this works. */
+}
+.plugin-card-bottom .star-rating {
+ display: inline;
+}
+.plugin-card h4 {
+ float: left;
+ font-size: 16px;
+ margin-top: 1em;
+}
+.plugin-card .desc {
+ clear: left;
+}
+.plugin-card .column-rating, .plugin-card .column-downloaded {
+ float: left;
+ clear: left;
+}
+.plugin-card .column-updated, .plugin-card .column-compatibility {
+ float: right;
+ clear: right;
+}
+.plugin-action-buttons {
+ float: right;
+ text-align: right;
+ margin-left: 2em;
+}
+
+
/* ms */
/* Background Color for Site Status */
.wp-list-table .site-deleted {
Index: src/wp-admin/includes/class-wp-plugin-install-list-table.php
===================================================================
--- src/wp-admin/includes/class-wp-plugin-install-list-table.php (revision 29023)
+++ src/wp-admin/includes/class-wp-plugin-install-list-table.php (working copy)
@@ -63,7 +63,7 @@
if ( empty( $tab ) || ( !isset( $tabs[ $tab ] ) && !in_array( $tab, (array) $nonmenu_tabs ) ) )
$tab = key( $tabs );
- $args = array( 'page' => $paged, 'per_page' => $per_page );
+ $args = array( 'page' => $paged, 'per_page' => $per_page, 'fields' => array( 'last_updated' => true, 'downloaded' => true, 'banners' => true ) );
switch ( $tab ) {
case 'search':
@@ -153,7 +153,30 @@
return $display_tabs;
}
+
+ /**
+ * Override the parent display() so we can provide a different container.
+ */
+ public function display() {
+ $singular = $this->_args['singular'];
+ $this->display_tablenav( 'top' );
+
+?>
+
@@ -211,8 +234,10 @@
$plugin = (array) $plugin;
$title = wp_kses( $plugin['name'], $plugins_allowedtags );
- //Limit description to 400char, and remove any HTML.
+ //Limit description to 40 words, and remove any HTML.
$description = strip_tags( $plugin['description'] );
+ $description = wp_trim_words( $description, 40 );
+ // Just in case it's still too long, trim it to 400 characters.
if ( strlen( $description ) > 400 )
$description = mb_substr( $description, 0, 400 ) . '…';
//remove any trailing entities
@@ -221,7 +246,7 @@
$description = trim( $description );
$description = preg_replace( "|(\r?\n)+|", "\n", $description );
//\n =>
- $description = nl2br( $description );
+ #$description = nl2br( $description );
$version = wp_kses( $plugin['version'], $plugins_allowedtags );
$name = strip_tags( $title . ' ' . $version );
@@ -228,14 +253,11 @@
$author = $plugin['author'];
if ( ! empty( $plugin['author'] ) )
- $author = '
' . sprintf( __( 'By %s' ), $author ) . '.';
+ $author = '
' . sprintf( __( 'By %s' ), $author ) . '';
$author = wp_kses( $author, $plugins_allowedtags );
$action_links = array();
- $action_links[] = '
' . __( 'Details' ) . '';
if ( current_user_can( 'install_plugins' ) || current_user_can( 'update_plugins' ) ) {
$status = install_plugin_install_status( $plugin );
@@ -243,19 +265,23 @@
switch ( $status['status'] ) {
case 'install':
if ( $status['url'] )
- $action_links[] = '
' . __( 'Install Now' ) . '';
+ $action_links[] = '
' . __( 'Install Now' ) . '';
break;
case 'update_available':
if ( $status['url'] )
- $action_links[] = '
' . __( 'Update Now' ) . '';
+ $action_links[] = '
' . __( 'Update Now' ) . '';
break;
case 'latest_installed':
case 'newer_installed':
- $action_links[] = '
' . _x( 'Installed', 'plugin' ) . '';
+ $action_links[] = '
' . _x( 'Installed', 'plugin' ) . '';
break;
}
}
+ $action_links[] = '
' . __( 'More Details' ) . '';
+
/**
* Filter the install action links for a plugin.
*
@@ -266,16 +292,45 @@
*/
$action_links = apply_filters( 'plugin_install_action_links', $action_links, $plugin );
?>
-
- >
-
- |
- > |
- >
- $plugin['rating'], 'type' => 'percent', 'number' => $plugin['num_ratings'] ) ); ?>
- |
- > |
-
+
+
+
+
+
+
+
+
>
+
' . implode( '', $action_links ) . ''; ?>
+
+
>
+
+
+
+ 1 ) echo sprintf( __( '+ %d more' ), count( $plugin['contributors'] ) -1 ); ?>.
+
+
+
+
+
+
>
+ $plugin['rating'], 'type' => 'percent', 'number' => $plugin['num_ratings'] ) ); ?>
+ ()
+
+
Last updated:') . ' '. sprintf( '%s ago', human_time_diff( strtotime($plugin['last_updated']) ) ); ?>
+
+
+ ' ) )
+ echo __('Untested with your install');
+
+ else if ( ! empty( $plugin['requires'] ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $plugin['requires'] ) ), $plugin['requires'], '<' ) )
+ echo __('Incompatible with your install');
+ else
+ echo __('Compatible with your install');
+ ?>
+
+
+