Making WordPress.org

Changeset 11038


Ignore:
Timestamp:
06/18/2021 04:26:50 AM (4 years ago)
Author:
dd32
Message:

Theme Directory: When logging theme upload failures to slack, use a more visible :x: icon for the message.

Also uses a nicer class name for when a check class is namespaced.

See #5702.

File:
1 edited

Legend:

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

    r11037 r11038  
    14131413                $error = $check->getError();
    14141414
    1415                 $class = get_class( $check );
     1415                // Account for namespaces by getting the short name.
     1416                $class = (new \ReflectionClass( $check ))->getShortName();
    14161417
    14171418                // Humanize the class name.
     
    15431544        $send = new \Dotorg\Slack\Send( THEME_DIRECTORY_SLACK_WEBHOOK );
    15441545        $send->add_attachment( [ 'blocks' => $blocks ] );
    1545         $send->set_username( 'allowed' === $status ? 'Theme Upload' : 'Theme Check Blocked' );
    1546         $send->set_icon( ':themes:' );
     1546
     1547        if ( 'allowed' === $status ) {
     1548            $send->set_username( 'Theme Upload' );
     1549            $send->set_icon( ':themes:' );
     1550        } else {
     1551            $send->set_username( 'Theme Check Blocked Upload' );
     1552            $send->set_icon( ':x:' );
     1553        }
     1554
    15471555        $send->send( '#themereview-firehose' );
    15481556    }
Note: See TracChangeset for help on using the changeset viewer.