Making WordPress.org


Ignore:
Timestamp:
07/03/2020 04:10:55 AM (6 years ago)
Author:
tellyworth
Message:

Block directory: initial UI improvements for block validator.

Props ryelle.
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

    r10000 r10003  
    6868                                __FUNCTION__,
    6969                                'error',
    70                                 sprintf( __( 'Invalid url %s', 'wporg-plugins' ), $url ),
     70                                sprintf( __( 'Invalid url: %s', 'wporg-plugins' ), $url ),
    7171                                $url
    7272                        );
     
    7878                                __FUNCTION__,
    7979                                'error',
    80                                 sprintf( __( 'URL must be GitHub or plugins.svn.wordpress.org %s', 'wporg-plugins' ), $url ),
     80                                sprintf( __( 'URL must be GitHub or plugins.svn.wordpress.org: %s', 'wporg-plugins' ), $url ),
    8181                                $url
    8282                        );
     
    9090                                        __FUNCTION__,
    9191                                        'error',
    92                                         sprintf( __( 'URL must be a plugin repository %s', 'wporg-plugins' ), $url ),
     92                                        sprintf( __( 'URL must be a plugin repository: %s', 'wporg-plugins' ), $url ),
    9393                                        $url
    9494                                );
     
    116116                                        __FUNCTION__,
    117117                                        'error',
    118                                         sprintf( __( 'URL must be a plugin repository %s', 'wporg-plugins' ), $url ),
     118                                        sprintf( __( 'URL must be a plugin repository: %s', 'wporg-plugins' ), $url ),
    119119                                        $url
    120120                                );
     
    213213
    214214        public function find_blocks( $base_dir ) {
     215                $blocks = array();
    215216                $this->block_json_files = Filesystem::list_files( $base_dir, true, '!(?:^|/)block\.json$!i' );
    216217                if ( false && ! empty( $this->block_json_files ) ) {
     
    282283                        $this->record_result( __FUNCTION__,
    283284                                'error',
    284                                 __( 'Missing readme.txt file', 'wporg-plugins' ),
     285                                __( 'Missing readme.txt file.', 'wporg-plugins' ),
    285286                                $this->relative_filename( $this->readme_path )
    286287                        );
     
    333334                                        $this->record_result( __FUNCTION__,
    334335                                                'info',
    335                                                 sprintf( __( 'Block name already exists in plugin %s', 'wporg-plugins' ), $query->posts[0]->post_name ),
     336                                                sprintf( __( 'Block name %s already exists in plugin %s.', 'wporg-plugins' ), $block->name, $query->posts[0]->post_name ),
    336337                                                [ 'block_name' => $block->name, 'slug' => $post->post_name ]
    337338                                        );
     
    354355                        $this->record_result( __FUNCTION__,
    355356                                'info',
    356                                 sprintf( _n( 'Found %d block', 'Found %d blocks', count( $this->blocks ), 'wporg-plugins' ), count( $this->blocks ) ),
     357                                sprintf( _n( 'Found %d block.', 'Found %d blocks.', count( $this->blocks ), 'wporg-plugins' ), count( $this->blocks ) ),
    357358                                array_keys( $this->blocks )
    358359                        );
     
    368369                                $this->record_result( __FUNCTION__,
    369370                                        'info',
    370                                         sprintf( __( 'block.json file exists for block %s', 'wporg-plugins' ), $block_name ),
     371                                        sprintf( __( 'block.json file exists for block %s.', 'wporg-plugins' ), $block_name ),
    371372                                        $this->block_json_files[ $block_name ]
    372373                                );
     
    377378                        $this->record_result( __FUNCTION__,
    378379                                'warning',
    379                                 __( 'No block.json files were found', 'wporg-plugins' )
     380                                __( 'No block.json files were found.', 'wporg-plugins' )
    380381                        );
    381382                }
     
    392393                                $this->record_result( __FUNCTION__,
    393394                                        'info',
    394                                         sprintf( __( 'Scripts found for block %s', 'wporg-plugins' ), $block_name ),
     395                                        sprintf( __( 'Scripts found for block %s.', 'wporg-plugins' ), $block_name ),
    395396                                        $block_scripts[ $block_name ]
    396397                                );
     
    398399                                $this->record_result( __FUNCTION__,
    399400                                        'warning',
    400                                         sprintf( __( 'No scripts found for block %s', 'wporg-plugins' ), $block_name ),
     401                                        sprintf( __( 'No scripts found for block %s.', 'wporg-plugins' ), $block_name ),
    401402                                        $block_name
    402403                                );
     
    414415                                        $this->record_result( __FUNCTION__,
    415416                                                'info',
    416                                                 sprintf( __( 'Script file exists for block %s', 'wporg-plugins' ), $block_name ),
     417                                                sprintf( __( 'Script file exists for block %s.', 'wporg-plugins' ), $block_name ),
    417418                                                $script
    418419                                        );
     
    420421                                        $this->record_result( __FUNCTION__,
    421422                                                'warning',
    422                                                 sprintf( __( 'Missing script file for block %s', 'wporg-plugins' ), $block_name ),
     423                                                sprintf( __( 'Missing script file for block %s.', 'wporg-plugins' ), $block_name ),
    423424                                                $script
    424425                                        );
     
    445446                        $this->record_result( __FUNCTION__,
    446447                                'error',
    447                                 sprintf( __( 'registerBlockType() must be called in a JavaScript file', 'wporg-plugins' ) )
     448                                sprintf( __( '<code>registerBlockType()</code> must be called in a JavaScript file.', 'wporg-plugins' ) )
    448449                        );
    449450                }
Note: See TracChangeset for help on using the changeset viewer.