Skip to content

Commit

Permalink
composer update
Browse files Browse the repository at this point in the history
  • Loading branch information
afragen committed Jan 25, 2024
1 parent 8918f4e commit 1ac76f4
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 36 deletions.
24 changes: 12 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 20 additions & 5 deletions vendor/afragen/wordpress-plugin-readme-parser/class-parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class Parser {
*
* @var array
*/
private $ignore_tags = array(
public $ignore_tags = array(
'plugin',
'wordpress',
);
Expand Down Expand Up @@ -225,6 +225,8 @@ protected function parse_readme_contents( $contents ) {

// Handle readme's which do `=== Plugin Name ===\nMy SuperAwesomePlugin Name\n...`
if ( 'plugin name' == strtolower( $this->name ) ) {
$this->warnings['invalid_plugin_name_header'] = true;

$this->name = $line = $this->get_first_nonwhitespace( $contents );

// Ensure that the line read wasn't an actual header or description.
Expand Down Expand Up @@ -273,8 +275,14 @@ protected function parse_readme_contents( $contents ) {
$this->tags = explode( ',', $headers['tags'] );
$this->tags = array_map( 'trim', $this->tags );
$this->tags = array_filter( $this->tags );
$this->tags = array_diff( $this->tags, $this->ignore_tags );
$this->tags = array_slice( $this->tags, 0, 5 );
if ( array_intersect( $this->tags, $this->ignore_tags ) ) {
$this->tags = array_diff( $this->tags, $this->ignore_tags );
$this->warnings['ignored_tags'] = true;
}
if ( count( $this->tags ) > 5 ) {
$this->tags = array_slice( $this->tags, 0, 5 );
$this->warnings['too_many_tags'] = true;
}
}
if ( ! empty( $headers['requires'] ) ) {
$this->requires = $this->sanitize_requires_version( $headers['requires'] );
Expand Down Expand Up @@ -408,13 +416,20 @@ protected function parse_readme_contents( $contents ) {
// Use the first line of the description for the short description if not provided.
if ( ! $this->short_description && ! empty( $this->sections['description'] ) ) {
$this->short_description = array_filter( explode( "\n", $this->sections['description'] ) )[0];
$this->warnings['no_short_description_present'] = true;
}

// Sanitize and trim the short_description to match requirements.
$this->short_description = $this->sanitize_text( $this->short_description );
$this->short_description = $this->parse_markdown( $this->short_description );
$this->short_description = wp_strip_all_tags( $this->short_description );
$this->short_description = $this->trim_length( $this->short_description, 150 );
$short_description = $this->trim_length( $this->short_description, 150 );
if ( $short_description !== $this->short_description ) {
if ( empty( $this->warnings['no_short_description_present'] ) ) {
$this->warnings['trimmed_short_description'] = true;
}
$this->short_description = $short_description;
}

if ( isset( $this->sections['screenshots'] ) ) {
preg_match_all( '#<li>(.*?)</li>#is', $this->sections['screenshots'], $screenshots, PREG_SET_ORDER );
Expand Down Expand Up @@ -464,7 +479,7 @@ protected function get_first_nonwhitespace( &$contents ) {
}
}

return $line;
return $line ?? '';
}

/**
Expand Down
26 changes: 13 additions & 13 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,19 @@
"source": {
"type": "git",
"url": "https://github.com/afragen/wordpress-plugin-readme-parser.git",
"reference": "c21c250a510972ac46658a315133ac8b91d60ba0"
"reference": "2f4fbe89bb7ffaf905eb28b385b7d1def4a83f54"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/afragen/wordpress-plugin-readme-parser/zipball/c21c250a510972ac46658a315133ac8b91d60ba0",
"reference": "c21c250a510972ac46658a315133ac8b91d60ba0",
"url": "https://api.github.com/repos/afragen/wordpress-plugin-readme-parser/zipball/2f4fbe89bb7ffaf905eb28b385b7d1def4a83f54",
"reference": "2f4fbe89bb7ffaf905eb28b385b7d1def4a83f54",
"shasum": ""
},
"require": {
"erusev/parsedown": "^1.7",
"php": ">=5.4"
},
"time": "2023-06-24T18:22:04+00:00",
"time": "2024-01-25T16:41:35+00:00",
"default-branch": true,
"type": "library",
"installation-source": "dist",
Expand Down Expand Up @@ -567,17 +567,17 @@
},
{
"name": "squizlabs/php_codesniffer",
"version": "3.8.0",
"version_normalized": "3.8.0.0",
"version": "3.8.1",
"version_normalized": "3.8.1.0",
"source": {
"type": "git",
"url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
"reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7"
"reference": "14f5fff1e64118595db5408e946f3a22c75807f7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5805f7a4e4958dbb5e944ef1e6edae0a303765e7",
"reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7",
"url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/14f5fff1e64118595db5408e946f3a22c75807f7",
"reference": "14f5fff1e64118595db5408e946f3a22c75807f7",
"shasum": ""
},
"require": {
Expand All @@ -587,12 +587,12 @@
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0"
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4"
},
"time": "2023-12-08T12:32:31+00:00",
"time": "2024-01-11T20:47:48+00:00",
"bin": [
"bin/phpcs",
"bin/phpcbf"
"bin/phpcbf",
"bin/phpcs"
],
"type": "library",
"extra": {
Expand Down
12 changes: 6 additions & 6 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => 'afragen/git-updater',
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'reference' => '2512d9958b0149a92970fda83316b1bc8bc3dd9b',
'reference' => '12a812cee5d960c21e94197781839d5bdeee45d2',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -13,7 +13,7 @@
'afragen/git-updater' => array(
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'reference' => '2512d9958b0149a92970fda83316b1bc8bc3dd9b',
'reference' => '12a812cee5d960c21e94197781839d5bdeee45d2',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -33,7 +33,7 @@
'afragen/wordpress-plugin-readme-parser' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'c21c250a510972ac46658a315133ac8b91d60ba0',
'reference' => '2f4fbe89bb7ffaf905eb28b385b7d1def4a83f54',
'type' => 'library',
'install_path' => __DIR__ . '/../afragen/wordpress-plugin-readme-parser',
'aliases' => array(
Expand Down Expand Up @@ -105,9 +105,9 @@
'dev_requirement' => true,
),
'squizlabs/php_codesniffer' => array(
'pretty_version' => '3.8.0',
'version' => '3.8.0.0',
'reference' => '5805f7a4e4958dbb5e944ef1e6edae0a303765e7',
'pretty_version' => '3.8.1',
'version' => '3.8.1.0',
'reference' => '14f5fff1e64118595db5408e946f3a22c75807f7',
'type' => 'library',
'install_path' => __DIR__ . '/../squizlabs/php_codesniffer',
'aliases' => array(),
Expand Down

0 comments on commit 1ac76f4

Please sign in to comment.