diff --git wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-parser.php wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-parser.php
index cc3dc4188..3698b73f1 100644
--- wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-parser.php
+++ wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-parser.php
@@ -94,6 +94,13 @@ class Parser {
*/
public $warnings = array();
+ /**
+ * Any readme.txt file larger than this will receive a warning
+ *
+ * @var integer
+ */
+ private $README_WARNING_KB_SIZE = 8;
+
/**
* These are the readme sections that we expect.
*
@@ -329,6 +336,11 @@ class Parser {
$current .= $line . "\n";
}
+ // Check the file size
+ if( $this->show_filesize_warning( $file ) ) {
+ $this->warnings['filesize_warning'] = true;
+ }
+
if ( ! empty( $section_name ) ) {
$this->sections[ $section_name ] .= trim( $current );
}
@@ -772,4 +784,15 @@ class Parser {
return true;
}
+
+ /**
+ * @access protected
+ *
+ * @param string $file
+ * @return string
+ */
+ protected function show_filesize_warning( $file ) {
+ return ( strlen( $file ) / 1024 ) > $this->README_WARNING_KB_SIZE;
+ }
+
}
diff --git wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-validator.php wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-validator.php
index 7e984c648..46a6088cb 100644
--- wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-validator.php
+++ wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-validator.php
@@ -139,6 +139,10 @@ class Validator {
);
}
+ if ( isset( $readme->warnings['filesize_warning'] ) ) {
+ $warnings[] = __( 'Your readme file is large. Try to reduce content to keep it more concise.', 'wporg-plugins' );
+ }
+
// Notes.
if ( empty( $readme->requires ) ) {
$notes[] = sprintf(