Ticket #20944: 20944.patch
File 20944.patch, 1.7 KB (added by , 13 years ago) |
---|
-
wp-admin/includes/plugin.php
778 778 779 779 // invalid plugins get deactivated 780 780 foreach ( $plugins as $plugin ) { 781 782 // see if the plugin file name was changed 783 if ( ! file_exists( WP_PLUGIN_DIR . '/' . $plugin ) ) { 784 $plugin_dir = dirname( $plugin ); 785 if ( ! empty( $plugin_dir ) ) { 786 $renamed_plugin_data = get_plugins( '/' . $plugin_dir ); 787 if ( ! empty( $renamed_plugin_data ) ) { 788 $plugin_files = array_keys( $renamed_plugin_data ); 789 $renamed_plugin = $plugin_dir . '/' . $plugin_files[0]; 790 if ( ! is_wp_error( validate_plugin( $renamed_plugin ) ) ) { 791 deactivate_plugins( $plugin, true ); 792 activate_plugin( $renamed_plugin, '', false, true ); 793 continue; 794 } 795 } 796 } 797 } 798 781 799 $result = validate_plugin( $plugin ); 782 800 if ( is_wp_error( $result ) ) { 783 801 $invalid[$plugin] = $result; -
wp-admin/plugins.php
316 316 } 317 317 } 318 318 319 $invalid = validate_active_plugins(); 319 320 $wp_list_table->prepare_items(); 320 321 321 322 wp_enqueue_script('plugin-install'); … … 349 350 350 351 require_once(ABSPATH . 'wp-admin/admin-header.php'); 351 352 352 $invalid = validate_active_plugins();353 353 if ( !empty($invalid) ) 354 354 foreach ( $invalid as $plugin_file => $error ) 355 355 echo '<div id="message" class="error"><p>' . sprintf(__('The plugin <code>%s</code> has been <strong>deactivated</strong> due to an error: %s'), esc_html($plugin_file), $error->get_error_message()) . '</p></div>';