Skip to content

Commit bdd11e0

Browse files
authored
Merge pull request #752 from WordPress/update-contributors-check
2 parents 954fd30 + 37f7981 commit bdd11e0

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

includes/Checker/Checks/Plugin_Repo/Plugin_Readme_Check.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ private function check_for_warnings( Check_Result $result, string $readme_file,
632632
* @param string $readme_file Readme file.
633633
*/
634634
private function check_for_contributors( Check_Result $result, string $readme_file ) {
635-
$regex = '/Contributors\s?:(.*?)\R/';
635+
$regex = '/Contributors\s?:(?:\*\*|\s)?(.*?)\R/';
636636

637637
$matches = array();
638638

tests/behat/features/plugin-check.feature

+39
Original file line numberDiff line numberDiff line change
@@ -680,3 +680,42 @@ Feature: Test that the WP-CLI command works.
680680
"""
681681
mismatched_plugin_name
682682
"""
683+
684+
Scenario: Check Contributors value in readme in markdown format
685+
Given a WP install with the Plugin Check plugin
686+
And a wp-content/plugins/foo-sample/foo-sample.php file:
687+
"""
688+
<?php
689+
/**
690+
* Plugin Name: Foo Sample
691+
* Plugin URI: https://foo-sample.com
692+
* Description: Custom plugin.
693+
* Version: 0.1.0
694+
* Author: WordPress Performance Team
695+
* Author URI: https://make.wordpress.org/performance/
696+
* License: GPL-2.0+
697+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
698+
*/
699+
700+
"""
701+
And a wp-content/plugins/foo-sample/README.md file:
702+
"""
703+
# Foo Sample #
704+
705+
**Contributors:** johndoe
706+
**Requires at least:** 6.0
707+
**Tested up to:** 6.6
708+
**Requires PHP:** 7.2
709+
**Stable tag:** 0.1.0
710+
**License:** GPL-2.0+
711+
**License URI:** http://www.gnu.org/licenses/gpl-2.0.txt
712+
713+
This is a short description of the plugin.
714+
715+
"""
716+
717+
When I run the WP-CLI command `plugin check foo-sample`
718+
Then STDOUT should not contain:
719+
"""
720+
readme_invalid_contributors
721+
"""

0 commit comments

Comments
 (0)