Making WordPress.org

Changeset 10071


Ignore:
Timestamp:
07/15/2020 09:07:43 PM (6 years ago)
Author:
ryelle
Message:

Plugin Directory: Remove *.asset.php check from block checker

This check only applies to a specific build process, and having more than one asset file is not inherently a bad thing.

See #5303

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
Files:
2 edited

Legend:

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

    r10066 r10071  
    691691
    692692        /**
    693          * Does it have an index.asset.php file generate by the create block scripts?
    694          */
    695         function check_asset_php_file() {
    696                 $count = 0;
    697                 foreach ( $this->asset_php_files as $file ) {
    698                         $contents = file_get_contents( $file );
    699                         if ( false !== strpos( $contents, '<?php return array(' ) )
    700                                 ++ $count;
    701                 }
    702 
    703                 if ( 1 === $count ) {
    704                         $this->record_result(
    705                                 __FUNCTION__,
    706                                 'info',
    707                                 // translators: %s is the name of asset file.
    708                                 sprintf(
    709                                         __( 'PHP asset file found: %s.', 'wporg-plugins' ),
    710                                         '<code>' . $this->relative_filename( $file ) . '</code>'
    711                                 ),
    712                                 $this->relative_filename( $file )
    713                         );
    714                 } elseif ( $count > 1 ) {
    715                         $this->record_result(
    716                                 __FUNCTION__,
    717                                 'warning',
    718                                 // translators: %s is the number of asset files.
    719                                 sprintf( __( 'Found %s PHP asset files.', 'wporg-plugins' ), $count ),
    720                                 array_map( null, array( $this->relative_filename( $file ) ), $this->asset_php_files )
    721                         );
    722                 }
    723         }
    724 
    725         /**
    726693         * Does it have a lot of PHP code?
    727694         */
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-block-validator.php

    r10066 r10071  
    267267                        case 'check_block_json_is_valid_json':
    268268                                return __( 'This block.json file is invalid. The Block Directory needs to be able to read this file.', 'wporg-plugins' );
    269                         case 'check_asset_php_file':
    270                                 return __( '', 'wporg-plugins' ); // @todo
    271269                        case 'check_php_size':
    272270                                return __( 'Block plugins should keep the PHP code to a mimmum. If you need a lot of PHP code, your plugin probably belongs in the main Plugin Directory rather than the Block Directory.', 'wporg-plugins' );
Note: See TracChangeset for help on using the changeset viewer.