Changeset 57592
- Timestamp:
- 02/12/2024 12:31:29 PM (7 months ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/plugin.php
r57545 r57592 361 361 $cache_plugins[ $plugin_folder ] = $wp_plugins; 362 362 wp_cache_set( 'plugins', $cache_plugins, 'plugins' ); 363 update_option( 'plugin_data', $new_plugin_data ); 363 364 if ( ! wp_installing() ) { 365 update_option( 'plugin_data', $new_plugin_data ); 366 } 364 367 365 368 return $wp_plugins; -
trunk/src/wp-includes/load.php
r57545 r57592 987 987 $network_plugins = is_multisite() ? wp_get_active_network_plugins() : false; 988 988 989 $invalid_plugins = array();990 989 foreach ( $active_plugins as $plugin ) { 991 990 if ( ! validate_file( $plugin ) // $plugin must validate as file. … … 996 995 ) { 997 996 $plugins[] = WP_PLUGIN_DIR . '/' . $plugin; 998 } else {999 $invalid_plugins[] = $plugin;1000 }1001 }1002 1003 if ( ! empty( $invalid_plugins ) ) {1004 $all_plugin_data = get_option( 'plugin_data', array() );1005 1006 if ( ! empty( $all_plugin_data ) ) {1007 foreach ( $invalid_plugins as $invalid_plugin ) {1008 unset( $all_plugin_data[ $invalid_plugin ] );1009 }1010 1011 update_option( 'plugin_data', $all_plugin_data );1012 997 } 1013 998 } -
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.