Making WordPress.org


Ignore:
Timestamp:
11/01/2022 05:41:04 AM (3 years ago)
Author:
dd32
Message:

Plugin Directory: Don't delete submitted ZIP files immediately upon approval/rejection, and instead delete them x days afterwards.

This provides some room for re-reviewing recently-rejected or recently-approved plugins when required.

Closes https://github.com/WordPress/wordpress.org/pull/106.
Fixes #5636.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-review-tools.php

    r12166 r12175  
    113113        ] );
    114114
    115         if ( in_array( $post->post_status, [ 'draft', 'pending', 'new' ], true ) ) {
    116 
    117             $zip_files = array();
    118             foreach ( get_attached_media( 'application/zip', $post ) as $zip_file ) {
    119                 $zip_files[ $zip_file->post_date ] = array( wp_get_attachment_url( $zip_file->ID ), $zip_file );
    120             }
     115        $zip_files = array();
     116        foreach ( get_attached_media( 'application/zip', $post ) as $zip_file ) {
     117            $zip_files[ $zip_file->post_date ] = array( wp_get_attachment_url( $zip_file->ID ), $zip_file );
     118        }
     119
     120        if ( $zip_files ) {
    121121            uksort( $zip_files, function ( $a, $b ) {
    122122                return strtotime( $a ) < strtotime( $b );
    123123            } );
    124 
    125             $zip_url = get_post_meta( $post->ID, '_submitted_zip', true );
    126             if ( $zip_url ) {
    127                 // Back-compat only.
    128                 $zip_files['User provided URL'] = array( $zip_url, null );
    129             }
    130124
    131125            echo '<p><strong>Zip files:</strong></p>';
     
    133127            foreach ( $zip_files as $zip_date => $zip ) {
    134128                list( $zip_url, $zip_file ) = $zip;
    135                 $zip_size                   = is_object( $zip_file ) ? size_format( filesize( get_attached_file( $zip_file->ID ) ), 1 ) : 'unknown size';
    136 
    137                 printf( '<li>%s <a href="%s">%s</a> (%s)</li>', esc_html( $zip_date ), esc_url( $zip_url ), esc_html( $zip_url ), esc_html( $zip_size ) );
     129                $zip_size                   = size_format( filesize( get_attached_file( $zip_file->ID ) ), 1 );
     130
     131                printf(
     132                    '<li>%1$s <a href="%2$s">%3$s</a> (%4$s)</li>',
     133                    esc_html( $zip_date ),
     134                    esc_url( $zip_url ),
     135                    esc_html( basename( $zip_url ) ),
     136                    esc_html( $zip_size )
     137                );
    138138            }
    139139            echo '</ul>';
    140 
     140        }
     141
     142        if ( in_array( $post->post_status, [ 'draft', 'pending', 'new' ], true ) ) {
    141143            $slug_restricted = [];
    142144            $slug_reserved   = [];
Note: See TracChangeset for help on using the changeset viewer.