diff --git a/checks/readme.php b/checks/readme.php index f9b7a8383..0fd3e2a9c 100644 --- a/checks/readme.php +++ b/checks/readme.php @@ -1,6 +1,7 @@ readme->warnings ) ) { + $warnings = $this->readme->warnings ?? []; + $warning_keys = array_keys( $warnings ); + $ignored_warnings = [ + 'contributor_ignored' + ]; + + /** + * Filter the list of ignored readme parser warnings. + * + * @since 0.2.2 + * + * @param array $ignored_warnings Array of ignored warning keys. + * @param Parser $readme The readme object. + */ + $ignored_warnings = (array) apply_filters( 'plugin_check_readme_warnings_ignored', $ignored_warnings, $this->readme ); + + $warning_keys = array_diff( $warning_keys, $ignored_warnings ); + + if ( ! empty( $warning_keys ) ) { return new Warning( 'readme_parser_warnings', sprintf( /* translators: %1$s: list of warnings */ __( 'The following readme parser warnings were detected: %1$s', 'plugin-check' ), - esc_html( implode( ', ', array_keys( $this->readme->warnings ) ) ) + esc_html( implode( ', ', $warning_keys ) ) ) ); } diff --git a/readme.txt b/readme.txt index f782bc73e..6d9d439bd 100644 --- a/readme.txt +++ b/readme.txt @@ -44,7 +44,8 @@ This plugin checker is not perfect, and never will be. It is only a tool to help = [0.2.2] 2023-11-XX = -* Fix - Remove extra period on the end of the sentence for Phar warning. Props @bordoni, @pixolin. [#275](https://github.com/10up/plugin-check/pull/265) +* Fix - Prevent problems with Readme parser warning related to `contributor_ignored` for when running the check outside of WP.org. Props @bordoni, @dev4press. [#276](https://github.com/10up/plugin-check/pull/276) +* Fix - Remove extra period on the end of the sentence for Phar warning. Props @bordoni, @pixolin. [#275](https://github.com/10up/plugin-check/pull/275) = [0.2.1] 2023-09-22 =