Changeset 57770
- Timestamp:
- 03/05/2024 06:46:34 AM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/plugin.php
r57658 r57770 1203 1203 1204 1204 if ( WP_Plugin_Dependencies::has_unmet_dependencies( $plugin ) ) { 1205 $dependencies = WP_Plugin_Dependencies::get_dependencies( $plugin ); 1206 $unmet_dependencies = array(); 1207 1208 foreach ( $dependencies as $dependency ) { 1205 $dependency_names = WP_Plugin_Dependencies::get_dependency_names( $plugin ); 1206 $unmet_dependencies = array(); 1207 $unmet_dependency_names = array(); 1208 1209 foreach ( $dependency_names as $dependency => $dependency_name ) { 1209 1210 $dependency_file = WP_Plugin_Dependencies::get_dependency_filepath( $dependency ); 1210 1211 1211 1212 if ( false === $dependency_file ) { 1212 $unmet_dependencies['not_installed'][] = $dependency; 1213 $unmet_dependencies['not_installed'][ $dependency ] = $dependency_name; 1214 $unmet_dependency_names[] = $dependency_name; 1213 1215 } elseif ( is_plugin_inactive( $dependency_file ) ) { 1214 $unmet_dependencies['inactive'][] = $dependency; 1216 $unmet_dependencies['inactive'][ $dependency ] = $dependency_name; 1217 $unmet_dependency_names[] = $dependency_name; 1215 1218 } 1219 } 1220 1221 $error_message = sprintf( 1222 /* translators: 1: Plugin name, 2: Number of plugins, 3: A comma-separated list of plugin names. */ 1223 _n( 1224 '<strong>Error:</strong> %1$s requires %2$d plugin to be installed and activated: %3$s.', 1225 '<strong>Error:</strong> %1$s requires %2$d plugins to be installed and activated: %3$s.', 1226 count( $unmet_dependency_names ) 1227 ), 1228 $plugin_headers['Name'], 1229 count( $unmet_dependency_names ), 1230 implode( wp_get_list_item_separator(), $unmet_dependency_names ) 1231 ); 1232 1233 if ( is_multisite() ) { 1234 if ( current_user_can( 'manage_network_plugins' ) ) { 1235 $error_message .= ' ' . sprintf( 1236 /* translators: %s: Link to the plugins page. */ 1237 __( '<a href="%s">Manage plugins</a>.' ), 1238 esc_url( network_admin_url( 'plugins.php' ) ) 1239 ); 1240 } else { 1241 $error_message .= ' ' . __( 'Please contact your network administrator.' ); 1242 } 1243 } else { 1244 $error_message .= ' ' . sprintf( 1245 /* translators: %s: Link to the plugins page. */ 1246 __( '<a href="%s">Manage plugins</a>.' ), 1247 esc_url( admin_url( 'plugins.php' ) ) 1248 ); 1216 1249 } 1217 1250 1218 1251 return new WP_Error( 1219 1252 'plugin_missing_dependencies', 1220 '<p>' . sprintf( 1221 /* translators: %s: Plugin name. */ 1222 _x( '<strong>Error:</strong> %s requires plugins that are not installed or activated.', 'plugin' ), 1223 $plugin_headers['Name'] 1224 ) . '</p>', 1253 "<p>{$error_message}</p>", 1225 1254 $unmet_dependencies 1226 1255 );
Note: See TracChangeset
for help on using the changeset viewer.