Changeset 13237
- Timestamp:
- 02/22/2024 06:44:16 AM (2 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme
- Files:
-
- 2 edited
-
class-parser.php (modified) (1 diff)
-
class-validator.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-parser.php
r13236 r13237 307 307 $this->warnings['ignored_tags'] = true; 308 308 } 309 310 // Check if the tags are low-quality (ie. little used) 311 if ( $this->tags && taxonomy_exists( 'plugin_tags' ) ) { 312 $tags = get_terms( array( 313 'taxonomy' => 'plugin_tags', 314 'name' => $this->tags, 315 ) ); 316 317 $low_usage_tags = array_filter( 318 $tags, 319 function( $term ) { 320 return $term->count < 5; 321 } 322 ); 323 324 $this->warnings['low_usage_tags'] = wp_list_pluck( $low_usage_tags, 'name' ); 325 } 326 309 327 if ( count( $this->tags ) > 5 ) { 310 328 $this->tags = array_slice( $this->tags, 0, 5 ); -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-validator.php
r13235 r13237 81 81 } 82 82 83 // Warnings .83 // Warnings & Notes. 84 84 if ( isset( $readme->warnings['requires_header_ignored'] ) ) { 85 85 $latest_wordpress_version = defined( 'WP_CORE_STABLE_BRANCH' ) ? WP_CORE_STABLE_BRANCH : '5.0'; … … 138 138 ); 139 139 } elseif ( ! count( $readme->contributors ) ) { 140 $ warnings[] = sprintf(140 $notes[] = sprintf( 141 141 /* translators: %s: plugin header tag */ 142 142 __( 'The %s field is missing.', 'wporg-plugins' ), … … 157 157 } 158 158 159 // Notes. 159 if ( isset( $readme->warnings['low_usage_tags'] ) ) { 160 $notes[] = sprintf( 161 /* translators: %s: list of tags with low usage. */ 162 __( 'The following tags are not widely used: %s', 'wporg-plugins' ), 163 '<code>' . implode( '</code>, <code>', array_map( 'esc_html', $readme->warnings['low_usage_tags'] ) ) . '</code>' 164 ); 165 } 166 160 167 if ( empty( $readme->requires ) ) { 161 168 $notes[] = sprintf(
Note: See TracChangeset
for help on using the changeset viewer.