WordPress.org

Make WordPress Core

Ticket #39309: 39309.disable-no-warnings-notice.diff

File 39309.disable-no-warnings-notice.diff, 1.5 KB (added by dd32, 5 months ago)

Disable the 'No Signatures found' error unless in Debug mode, at 5.2's launch we're unlikely to have plugin/theme/translation signatures and displaying this isn't going to be helpful to end-users

  • src/wp-admin/includes/class-wp-upgrader.php

    diff --git a/src/wp-admin/includes/class-wp-upgrader.php b/src/wp-admin/includes/class-wp-upgrader.php
    index 7fbecbae0d..f16c3bd66e 100644
    a b public function run( $options ) { 
    735735                // Allow for signature soft-fail.
    736736                // WARNING: This may be removed in the future.
    737737                if ( is_wp_error( $download ) && $download->get_error_data( 'softfail-filename' ) ) {
    738                         // Outout the failure error as a normal feedback, and not as an error:
    739                         $this->skin->feedback( $download->get_error_message() );
    740 
    741                         // Report this failure back to WordPress.org for debugging purposes.
    742                         wp_version_check(
    743                                 array(
    744                                         'signature_failure_code' => $download->get_error_code(),
    745                                         'signature_failure_data' => $download->get_error_data(),
    746                                 )
    747                         );
     738
     739                        // Don't output the 'no signature could be found' failure message for now.
     740                        if ( 'signature_verification_no_signature' != $download->get_error_code() || WP_DEBUG ) {
     741                                // Outout the failure error as a normal feedback, and not as an error:
     742                                $this->skin->feedback( $download->get_error_message() );
     743
     744                                // Report this failure back to WordPress.org for debugging purposes.
     745                                wp_version_check(
     746                                        array(
     747                                                'signature_failure_code' => $download->get_error_code(),
     748                                                'signature_failure_data' => $download->get_error_data(),
     749                                        )
     750                                );
     751                        }
    748752
    749753                        // Pretend this error didn't happen.
    750754                        $download = $download->get_error_data( 'softfail-filename' );