Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 55 additions & 11 deletions src/wp-admin/includes/class-wp-plugins-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -1567,18 +1567,62 @@
return;
}

$links = array();
foreach ( $dependency_names as $slug => $name ) {
$links[] = $this->get_dependency_view_details_link( $name, $slug );
}
$requires = null;

Check failure on line 1571 in src/wp-admin/includes/class-wp-plugins-list-table.php

View workflow job for this annotation

GitHub Actions / Coding standards / PHP checks

Whitespace found at end of line
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

if ( ! empty( $dependency_names ) ) {

$is_active = is_multisite() ? is_plugin_active_for_network( $dependent ) : is_plugin_active( $dependent );
$comma = wp_get_list_item_separator();
$requires = sprintf(
/* translators: %s: List of dependency names. */
__( '<strong>Requires:</strong> %s' ),
implode( $comma, $links )
);
$links = array();

foreach ( $dependency_names as $slug => $name ) {
$link = $this->get_dependency_view_details_link( $name, $slug );

Check failure on line 1578 in src/wp-admin/includes/class-wp-plugins-list-table.php

View workflow job for this annotation

GitHub Actions / Coding standards / PHP checks

Whitespace found at end of line
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

$dependency_file = WP_Plugin_Dependencies::get_dependency_filepath( $slug );

$is_installed = false;
$is_active = false;

if ( $dependency_file ) {
$is_installed = true;
$is_active = is_multisite()
? is_plugin_active_for_network( $dependency_file ) || is_plugin_active( $dependency_file )
: is_plugin_active( $dependency_file );
}

if ( ! $is_installed ) {
$link .= sprintf(
' <span class="dependency-state dependency-state--missing">%s</span>
<span class="screen-reader-text">%s</span>',
__( '(not installed)' ),
__( 'Not installed' )
);
} elseif ( $is_active ) {
$link .= sprintf(
' <span class="dependency-state dependency-state--active">%s</span>
<span class="dashicons dashicons-yes-alt dependency-icon dependency-icon--active" aria-hidden="true"></span>
<span class="screen-reader-text">%s</span>',
__( '(installed, active)' ),
__( 'Installed and active' )
);
} else {
$link .= sprintf(
' <span class="dependency-state dependency-state--installed">%s</span>
<span class="dashicons dashicons-yes-alt dependency-icon dependency-icon--installed" aria-hidden="true"></span>
<span class="screen-reader-text">%s</span>',
__( '(installed, inactive)' ),
__( 'Installed but inactive' )
);
}

$links[] = $link;
}

$comma = wp_get_list_item_separator();
$requires = sprintf(
/* translators: %s: List of dependency names. */
__( '<strong>Requires:</strong> %s' ),
implode( $comma, $links )
);
}

$notice = '';
$error_message = '';
Expand Down
Loading