Making WordPress.org

Changeset 14512


Ignore:
Timestamp:
08/12/2025 07:18:03 AM (6 weeks ago)
Author:
dd32
Message:

Theme Directory: Include the Theme Check output in the failure email when a theme author commits directly to SVN with an invalid theme.

BCC that email to the Themes Team helpscout instance for easier management of this case.

See https://core.trac.wordpress.org/ticket/63792

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-upload.php

    r14462 r14512  
    703703        // Pass it through Theme Check and see how great this theme really is.
    704704        if ( $args['run_themecheck'] ) {
     705            ob_start();
    705706            $result = $this->check_theme();
     707            $theme_check_output = ob_get_clean();
     708
     709            // Output the Theme Check results. This is the only HTML that this function outputs.
     710            echo $theme_check_output;
    706711
    707712            if ( ! $result && $args['block_on_themecheck'] ) {
     
    716721                        '//wordpress.org/plugins/theme-check/',
    717722                        '<a href="https://make.wordpress.org/themes">https://make.wordpress.org/themes</a>'
    718                     )
     723                    ),
     724                    $theme_check_output
    719725                );
    720726            }
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/jobs/class-svn-import.php

    r12912 r14512  
    133133            }
    134134
     135            $error_message = $return->get_error_message();
     136
     137            // For theme check failures, include the HTML output by the TC functions.
     138            if ( 'failed_theme_check' === $return->get_error_code() ) {
     139                $error_message .= '<br><br>' . $return->get_error_data( 'failed_theme_check' );
     140            }
     141
    135142            /*
    136143             * Otherwise email the author about this problem.
     
    157164                    esc_html( $uploader->author->display_name ?: $uploader->author->user_login ),
    158165                    $uploader->theme->display('Name') . ' ' . $uploader->theme->display('Version'),
    159                     '<div style="margin-left: 30px">' . $return->get_error_message() . '</div>',
     166                    '<div style="margin-left: 30px">' . $error_message . '</div>',
    160167                    'https://make.wordpress.org/themes/handbook/review/required/'
    161168                ),
    162169                [
    163170                    'From: "WordPress Theme Directory" <themes@wordpress.org>',
    164                     'Content-Type: text/html; charset=UTF-8'
     171                    'Content-Type: text/html; charset=UTF-8',
     172                    'BCC: themes@wordpress.org'
    165173                ]
    166174            );
Note: See TracChangeset for help on using the changeset viewer.