Changeset 57592 for trunk/src/wp-settings.php
- Timestamp:
- 02/12/2024 12:31:29 PM (11 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-settings.php
r57563 r57592 500 500 501 501 // Load active plugins. 502 $all_plugin_data = get_option( 'plugin_data', array() ); 503 $failed_plugins = array(); 504 $update_plugin_data = false; 502 $all_plugin_data = get_option( 'plugin_data', array() ); 503 $failed_plugins = array(); 505 504 foreach ( wp_get_active_and_valid_plugins() as $plugin ) { 506 $plugin_file = str_replace( trailingslashit( WP_PLUGIN_DIR ), '', $plugin ); 507 if ( ! isset( $all_plugin_data[ $plugin_file ] ) ) { 508 require_once ABSPATH . 'wp-admin/includes/plugin.php'; 509 $all_plugin_data[ $plugin_file ] = get_plugin_data( WP_PLUGIN_DIR . "/$plugin_file" ); 510 511 $update_plugin_data = true; 512 } 513 514 $plugin_headers = $all_plugin_data[ $plugin_file ]; 515 $errors = array(); 516 $requirements = array( 517 'requires' => ! empty( $plugin_headers['RequiresWP'] ) ? $plugin_headers['RequiresWP'] : '', 518 'requires_php' => ! empty( $plugin_headers['RequiresPHP'] ) ? $plugin_headers['RequiresPHP'] : '', 519 'requires_plugins' => ! empty( $plugin_headers['RequiresPlugins'] ) ? $plugin_headers['RequiresPlugins'] : '', 505 $plugin_file = str_replace( trailingslashit( WP_PLUGIN_DIR ), '', $plugin ); 506 $plugin_headers = $all_plugin_data[ $plugin_file ]; 507 $errors = array(); 508 $requirements = array( 509 'requires' => ! empty( $plugin_headers['RequiresWP'] ) ? $plugin_headers['RequiresWP'] : '', 510 'requires_php' => ! empty( $plugin_headers['RequiresPHP'] ) ? $plugin_headers['RequiresPHP'] : '', 520 511 ); 521 $compatible_wp = is_wp_version_compatible( $requirements['requires'] ); 522 $compatible_php = is_php_version_compatible( $requirements['requires_php'] ); 523 $dependencies_met = ! WP_Plugin_Dependencies::has_unmet_dependencies( $plugin_file ); 512 $compatible_wp = is_wp_version_compatible( $requirements['requires'] ); 513 $compatible_php = is_php_version_compatible( $requirements['requires_php'] ); 524 514 525 515 $php_update_message = '</p><p>' . sprintf( … … 533 523 if ( $annotation ) { 534 524 $php_update_message .= '</p><p><em>' . $annotation . '</em>'; 535 }536 537 if ( ! $dependencies_met ) {538 $errors[] = sprintf(539 /* translators: %s: The plugin's name. */540 _x( '%s has unmet dependencies.', 'plugin' ),541 $plugin_headers['Name']542 );543 525 } 544 526 … … 602 584 unset( $plugin, $_wp_plugin_file ); 603 585 604 if ( $update_plugin_data ) {605 update_option( 'plugin_data', $all_plugin_data );606 }607 608 586 if ( ! empty( $failed_plugins ) ) { 609 587 add_action(
Note: See TracChangeset
for help on using the changeset viewer.