Changeset 10071
- Timestamp:
- 07/15/2020 09:07:43 PM (5 years ago)
- 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 691 691 692 692 /** 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 /**726 693 * Does it have a lot of PHP code? 727 694 */ -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-block-validator.php
r10066 r10071 267 267 case 'check_block_json_is_valid_json': 268 268 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' ); // @todo271 269 case 'check_php_size': 272 270 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.