diff --git a/checks/class-file-check.php b/checks/class-file-check.php index e74af897..f22509be 100644 --- a/checks/class-file-check.php +++ b/checks/class-file-check.php @@ -67,6 +67,7 @@ public function check( $php_files, $css_files, $other_files ) { ); $musthave = array( 'index.php', 'style.css', 'readme.txt' ); + $readme = null; $fse_find = array_filter( array_keys( $other_files ), @@ -123,6 +124,24 @@ function( $file_name ) { ); $ret = false; } + + if ( 'readme.txt' === $file ) { + foreach ( $other_files as $other_path => $other_content ) { + if ( 'readme.txt' === strtolower( basename( $other_path ) ) ) { + $readme = $other_content; + break; + } + } + } + } + + if ( null !== $readme && '' === trim( $readme ) ) { + $this->error[] = sprintf( + '%s: %s', + __( 'REQUIRED', 'theme-check' ), + __( 'The readme.txt file is empty.', 'theme-check' ) + ); + $ret = false; } return $ret;