Make WordPress Core

Ticket #38918: 38918-forced-test.diff

File 38918-forced-test.diff, 1.1 KB (added by eddhurst, 9 years ago)

Forced output of plugin delete failure message (even when successfully deleted) for easier testing. Not for production.

  • wp-admin/includes/plugin.php

     
    869869                        continue;
    870870                }
    871871
     872                $fake_errors = array();
     873
     874                if( $deleted ) {
     875                        $fake_errors[] = $plugin_file;
     876                }
     877
    872878                // Remove language files, silently.
    873879                $plugin_slug = dirname( $plugin_file );
    874880                if ( '.' !== $plugin_slug && ! empty( $plugin_translations[ $plugin_slug ] ) ) {
     
    893899                set_site_transient( 'update_plugins', $current );
    894900        }
    895901
    896         if ( ! empty($errors) )
    897                 return new WP_Error('could_not_remove_plugin', sprintf(__('Could not fully remove the plugin(s) %s.'), implode(', ', $errors)) );
     902        if ( ! empty( $errors ) )
     903                return new WP_Error('could_not_remove_plugin', sprintf( __( 'Could not fully remove the plugin: %s.' ), implode( ', ', $errors ) ) );
    898904
     905        if( ! empty( $fake_errors ) )
     906                return new WP_Error('could_not_remove_plugin', sprintf( __( 'Could not fully remove the plugin: %s.' ), implode( ', ', $fake_errors ) ) );
     907
    899908        return true;
    900909}
    901910