Making WordPress.org


Ignore:
Timestamp:
07/10/2020 09:28:14 PM (5 years ago)
Author:
ryelle
Message:

Plugin Directory: Update block.json file checks in block checker

Remove the json file check, since the same items are checked for in check_block_json_is_valid. Improve messages in check_for_block_script_files.

See #5303

File:
1 edited

Legend:

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

    r10057 r10058  
    240240                return false;
    241241            case 'check_block_tag':
    242                 return __( 'The readme.txt file must contain the tag "block" for this to be added to the block directory.', 'wporg-plugins' );
     242                return __( 'The readme.txt file must contain the tag "block" (singular) for this to be added to the block directory.', 'wporg-plugins' );
    243243            case 'check_for_duplicate_block_name':
    244244                return [
     
    254254            case 'check_for_block_json':
    255255                return __( 'Your plugin should contain at least one <code>block.json</code> file. This file contains metadata describing the block and its JavaScript and CSS assets. Make sure you include at least one <code>script</code> or <code>editorScript</code> item.', 'wporg-plugins' );
    256             case 'check_for_block_scripts':
    257                 return 'TODO';
    258256            case 'check_for_block_script_files':
    259                 return 'TODO';
     257                return [
     258                    __( 'The value of <code>script</code>, <code>style</code>, <code>editorScript</code>, <code>editorStyle</code> must be a valid file path. This value was detected, but there is no file at this location in your plugin.', 'wporg-plugins' ),
     259                    __( 'Unlike regular blocks, plugins in the block directory cannot use a script handle for these values.', 'wporg-plugins' ),
     260                ];
    260261            case 'check_for_register_block_type':
    261262                return __( 'At least one of your JavaScript files must explicitly call registerBlockType(). Without that call, your block will not work in the editor.', 'wporg-plugins' );
     
    263264                return __( 'This block.json file is invalid. The Block Directory needs to be able to read this file.', 'wporg-plugins' );
    264265            case 'check_asset_php_file':
    265                 return 'TODO'; // Is this really an issue?
     266                return __( '', 'wporg-plugins' ); // @todo
    266267            case 'check_php_size':
    267268                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.