Making WordPress.org


Ignore:
Timestamp:
01/06/2026 06:41:33 AM (5 months ago)
Author:
dd32
Message:

Plugin Directory: Submission: Don't count lines of code in vendor folders

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload-handler.php

    r14574 r14624  
    528528
    529529        // Store metadata about the uploaded ZIP.
    530         // Count lines of PHP code, this is not 100% accurate but it's a good indicator.
    531         $lines_of_code = (int) shell_exec( sprintf( "find %s -type f -name '*.php' -exec cat {} + | wc -l", escapeshellarg( $this->plugin_dir ) ) );
     530        // Count lines of PHP code, this is not 100% accurate but it's a good indicator. Excludes 'vendor', 'vendor-prefixed', and 'vendor_prefixed' directories.
     531        $lines_of_code = (int) shell_exec( sprintf( "find %s -type f -name '*.php' -not -path '*/vendor/*' -not -path '*/vendor*prefixed/*' -exec cat {} + | wc -l", escapeshellarg( $this->plugin_dir ) ) );
    532532
    533533        update_post_meta( $plugin_post->ID, '_submitted_zip_size', filesize( get_attached_file( $attachment->ID ) ) );
Note: See TracChangeset for help on using the changeset viewer.