Making WordPress.org


Ignore:
Timestamp:
07/31/2020 08:27:48 PM (4 years ago)
Author:
ryelle
Message:

Plugin Directory: Skip composer framework files when checking size of block plugins

See #5303

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-block-plugin-checker.php

    r10104 r10109  
    792792        $total_size = 0;
    793793        foreach ( $php_files as $file ) {
    794             $total_size += filesize( $file );
     794            // Skip files from composer framework, which are any top-level php files
     795            // in `vendor/`, or any files in `vendor/composer/`.
     796            if ( ! preg_match( '/vendor\/(?:composer\/.+|[\w.-]+\.php)$/', $file ) ) {
     797                $total_size += filesize( $file );
     798            }
    795799        }
    796800        if ( $total_size > 50 * KB_IN_BYTES ) {
Note: See TracChangeset for help on using the changeset viewer.