Changeset 13133 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-parser.php
- Timestamp:
- 01/22/2024 01:13:35 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-parser.php
r12582 r13133 145 145 * @var array 146 146 */ 147 p rivate$ignore_tags = array(147 public $ignore_tags = array( 148 148 'plugin', 149 149 'wordpress', … … 226 226 // Handle readme's which do `=== Plugin Name ===\nMy SuperAwesomePlugin Name\n...` 227 227 if ( 'plugin name' == strtolower( $this->name ) ) { 228 $this->warnings['invalid_plugin_name_header'] = true; 229 228 230 $this->name = $line = $this->get_first_nonwhitespace( $contents ); 229 231 … … 274 276 $this->tags = array_map( 'trim', $this->tags ); 275 277 $this->tags = array_filter( $this->tags ); 276 $this->tags = array_diff( $this->tags, $this->ignore_tags ); 277 $this->tags = array_slice( $this->tags, 0, 5 ); 278 if ( array_intersect( $this->tags, $this->ignore_tags ) ) { 279 $this->tags = array_diff( $this->tags, $this->ignore_tags ); 280 $this->warnings['ignored_tags'] = true; 281 } 282 if ( count( $this->tags ) > 5 ) { 283 $this->tags = array_slice( $this->tags, 0, 5 ); 284 $this->warnings['too_many_tags'] = true; 285 } 278 286 } 279 287 if ( ! empty( $headers['requires'] ) ) { … … 409 417 if ( ! $this->short_description && ! empty( $this->sections['description'] ) ) { 410 418 $this->short_description = array_filter( explode( "\n", $this->sections['description'] ) )[0]; 419 $this->warnings['no_short_description_present'] = true; 411 420 } 412 421 … … 415 424 $this->short_description = $this->parse_markdown( $this->short_description ); 416 425 $this->short_description = wp_strip_all_tags( $this->short_description ); 417 $this->short_description = $this->trim_length( $this->short_description, 150 ); 426 $short_description = $this->trim_length( $this->short_description, 150 ); 427 if ( $short_description !== $this->short_description ) { 428 if ( empty( $this->warnings['no_short_description_present'] ) ) { 429 $this->warnings['trimmed_short_description'] = true; 430 } 431 $this->short_description = $short_description; 432 } 418 433 419 434 if ( isset( $this->sections['screenshots'] ) ) {
Note: See TracChangeset
for help on using the changeset viewer.