Making WordPress.org

Changeset 9116


Ignore:
Timestamp:
08/27/2019 05:38:33 AM (7 years ago)
Author:
SergeyBiryukov
Message:

Plugin Directory Theme: Make plugin closure messages more user-friendly; make it clear when the closure is temporary.

Props Ipstenu, jb510, SergeyBiryukov.
Fixes #4694.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/inc/template-tags.php

    r8115 r9116  
    210210
    211211                case 'disabled':
    212                         $message = current_user_can( 'plugin_approve' )
    213                                 ? __( 'This plugin is disabled (closed, but actively serving updates).', 'wporg-plugins' )
    214                                 : __( 'This plugin has been closed for new installations.', 'wporg-plugins' );
    215 
    216                         $message = sprintf( $error_notice, $message );
    217                         break;
    218 
    219212                case 'closed':
    220                         $closed_date = get_post_meta( get_the_ID(), 'plugin_closed_date', true );
     213                        $closed_date  = get_post_meta( get_the_ID(), 'plugin_closed_date', true );
     214                        $close_reason = Template::get_close_reason( $post );
    221215
    222216                        if ( $closed_date ) {
    223                                 /* translators: %s: plugin closing date */
    224                                 $message = sprintf( __( 'This plugin was closed on %s and is no longer available for download.', 'wporg-plugins' ), mysql2date( get_option( 'date_format' ), $closed_date ) );
     217                                if ( 'disabled' === $post_status && current_user_can( 'plugin_approve' ) ) {
     218                                        /* translators: %s: plugin closing date */
     219                                        $message = sprintf( __( 'This plugin has been disabled as of %s -- this means it is closed, but actively serving updates.', 'wporg-plugins' ), mysql2date( get_option( 'date_format' ), $closed_date ) );
     220                                } else {
     221                                        /* translators: %s: plugin closing date */
     222                                        $message = sprintf( __( 'This plugin has been closed as of %s and is not available for download.', 'wporg-plugins' ), mysql2date( get_option( 'date_format' ), $closed_date ) );
     223                                }
     224
     225                                // Determine permanence of closure.
     226                                $contributors = get_the_terms( $post, 'plugin_contributors' );
     227                                $permanent    = ( 'author-request' === $close_reason || ! $contributors || is_wp_error( $contributors ) );
    225228
    226229                                $days_passed = (int) ( ( current_time( 'timestamp' ) - mysql2date( 'U', $closed_date ) ) / DAY_IN_SECONDS );
    227230
    228                                 // Display close reason if more than 60 days have passed.
    229                                 if ( $days_passed > 60 ) {
     231                                if ( $permanent ) {
     232                                        $message .= ' ' . __( 'This closure is permanent.', 'wporg-plugins' );
     233                                } elseif ( $days_passed < 60 ) {
     234                                        $message .= ' ' . __( 'This closure is temporary, pending a full review.', 'wporg-plugins' );
     235                                } else {
     236                                        // Display close reason if more than 60 days have passed.
    230237                                        /* translators: %s: plugin close/disable reason */
    231                                         $message .= ' ' . sprintf( __( 'Reason: %s.', 'wporg-plugins' ), Template::get_close_reason( $post ) );
     238                                        $message .= ' ' . sprintf( __( 'Reason: %s.', 'wporg-plugins' ), $close_reason );
    232239                                }
    233240                        } else {
Note: See TracChangeset for help on using the changeset viewer.