diff -r 34716fd837a4 -r be944660c56a wp/wp-admin/includes/class-wp-plugins-list-table.php --- a/wp/wp-admin/includes/class-wp-plugins-list-table.php Tue Dec 15 15:52:01 2020 +0100 +++ b/wp/wp-admin/includes/class-wp-plugins-list-table.php Wed Sep 21 18:19:35 2022 +0200 @@ -229,11 +229,10 @@ 'requires_php' => '', 'compatibility' => new stdClass(), ); - $filter_payload = (object) array_merge( $filter_payload, array_intersect_key( $plugin_data, $filter_payload ) ); - $type = 'plugin'; - /** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */ - $auto_update_forced = apply_filters( "auto_update_{$type}", null, $filter_payload ); + $filter_payload = (object) wp_parse_args( $plugin_data, $filter_payload ); + + $auto_update_forced = wp_is_auto_update_forced_for_item( 'plugin', null, $filter_payload ); if ( ! is_null( $auto_update_forced ) ) { $plugin_data['auto-update-forced'] = $auto_update_forced; @@ -318,7 +317,7 @@ $js_plugins = array(); foreach ( $plugins as $key => $list ) { - $js_plugins[ $key ] = array_keys( (array) $list ); + $js_plugins[ $key ] = array_keys( $list ); } wp_localize_script( @@ -387,7 +386,7 @@ $a = $plugin_a[ $orderby ]; $b = $plugin_b[ $orderby ]; - if ( $a == $b ) { + if ( $a === $b ) { return 0; } @@ -408,7 +407,7 @@ $s = esc_html( wp_unslash( $_REQUEST['s'] ) ); /* translators: %s: Plugin search term. */ - printf( __( 'No plugins found for “%s”.' ), $s ); + printf( __( 'No plugins found for: %s.' ), '' . $s . '' ); // We assume that somebody who can install plugins in multisite is experienced enough to not need this helper link. if ( ! is_multisite() && current_user_can( 'install_plugins' ) ) { @@ -445,7 +444,7 @@ ?> ' . $plugin_data['Name']; } + if ( true === ( $dropins[ $plugin_file ][1] ) ) { // Doesn't require a constant. $is_active = true; $description = '

' . $dropins[ $plugin_file ][0] . '

'; @@ -764,6 +765,7 @@ 'wp-config.php' ) . '

'; } + if ( $plugin_data['Description'] ) { $description .= '

' . $plugin_data['Description'] . '

'; } @@ -946,7 +948,8 @@ $requires_php = isset( $plugin_data['requires_php'] ) ? $plugin_data['requires_php'] : null; $compatible_php = is_php_version_compatible( $requires_php ); $class = $is_active ? 'active' : 'inactive'; - $checkbox_id = 'checkbox_' . md5( $plugin_data['Name'] ); + $checkbox_id = 'checkbox_' . md5( $plugin_file ); + if ( $restrict_network_active || $restrict_network_only || in_array( $status, array( 'mustuse', 'dropins' ), true ) || ! $compatible_php ) { $checkbox = ''; } else { @@ -959,6 +962,7 @@ esc_attr( $plugin_file ) ); } + if ( 'dropins' !== $context ) { $description = '

' . ( $plugin_data['Description'] ? $plugin_data['Description'] : ' ' ) . '

'; $plugin_name = $plugin_data['Name']; @@ -1124,7 +1128,7 @@ $url = add_query_arg( $query_args, 'plugins.php' ); - if ( 'unavailable' == $action ) { + if ( 'unavailable' === $action ) { $html[] = '' . $text . ''; } else { $html[] = sprintf(