PHPackages                             afragen/wp-readme-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. afragen/wp-readme-parser

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

afragen/wp-readme-parser
========================

A PHP library for parsing WordPress plugin readme.txt files into structured data.

1.0.3(3w ago)110↓100%2MITPHPPHP &gt;=8.0 &lt;8.6CI passing

Since Apr 16Pushed 3w agoCompare

[ Source](https://github.com/afragen/wp-readme-parser)[ Packagist](https://packagist.org/packages/afragen/wp-readme-parser)[ RSS](/packages/afragen-wp-readme-parser/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (4)Versions (5)Used By (2)

WP Readme Parser
================

[](#wp-readme-parser)

A PHP library for parsing WordPress plugin `readme.txt` files into structured data, with no WordPress dependencies.

[![MIT License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![PHP 8.1–8.5](https://camo.githubusercontent.com/093b4fe6bdbc9b622fad2b08c96efe1b545b87f1938e2bc927cba019674080de/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e312d2d382e352d3838393242462e737667)](https://www.php.net/)

Requirements
------------

[](#requirements)

- PHP 8.0 – 8.5
- Composer

Installation
------------

[](#installation)

```
composer require fragen/wp-readme-parser
```

Usage
-----

[](#usage)

```
use Fragen\WP_Readme_Parser\Parser;

// From a file path
$parser = new Parser('/path/to/readme.txt');

// From a URL
$parser = new Parser('https://plugins.svn.wordpress.org/my-plugin/trunk/readme.txt');

// From a raw string
$parser = new Parser($readmeContents);
```

### Parsed properties

[](#parsed-properties)

The parser exposes the same public properties as the official WordPress.org readme parser, making it a drop-in replacement for subclassing.

PropertyTypeDescription`$name``string|false`Plugin name. `false` if the name header was absent or used the placeholder value.`$tags``array`Up to 5 tags (ignored tags and extras are dropped with warnings).`$requires``string`Minimum WordPress version, e.g. `"6.0"`.`$tested``string`Tested-up-to version.`$requires_php``string`Minimum PHP version.`$contributors``string[]`Contributor slugs (format-validated).`$stable_tag``string`Stable tag / version string.`$donate_link``string`Donation URL (http/https only).`$license``string`License identifier.`$license_uri``string`License URL.`$short_description``string`Plain-text short description, max 150 characters.`$sections``array`Rendered HTML sections keyed by name: `description`, `installation`, `faq`, `changelog`.`$faq``array`FAQ entries keyed by question string, values are rendered HTML.`$screenshots``array`Screenshot captions, 1-based integer keys.`$upgrade_notice``array`Upgrade notices keyed by version string.`$warnings``array`Parsing anomaly flags — see below.`$raw_contents``string`Unmodified input.### Warning keys

[](#warning-keys)

KeyMeaning`invalid_plugin_name_header`Name header was missing or used the `Plugin Name` placeholder.`ignored_tags`Tags removed because they appear in the ignore list (`plugin`, `wordpress`).`too_many_tags`More than 5 tags supplied; extras dropped.`contributor_ignored`One or more contributor slugs had an invalid format and were dropped.`requires_php_header_ignored``Requires PHP` value was not a valid `x.y[.z]` version string.`requires_header_ignored``Requires at least` value could not be parsed as a version.`tested_header_ignored``Tested up to` value could not be parsed as a version.`license_missing`No `License` header was found.`invalid_license`License appears to be incompatible with WordPress directory guidelines.`unknown_license`License could not be identified as compatible or incompatible.`no_short_description_present`Short description was inferred from the description section body.`trimmed_short_description`Short description was truncated to 150 characters.`trimmed_section_*`A section was truncated to its word limit (2 500 general; 5 000 for `changelog` and `faq`).Dependency injection
--------------------

[](#dependency-injection)

The sanitizer and Markdown converter are both injectable:

```
use Fragen\WP_Readme_Parser\Contracts\HtmlSanitizerInterface;
use Fragen\WP_Readme_Parser\Contracts\MarkdownConverterInterface;

$parser = new Parser(
    input: $readmeContents,
    sanitizer: $myCustomSanitizer,   // implements HtmlSanitizerInterface
    markdown:  $myCustomConverter,   // implements MarkdownConverterInterface
);
```

Differences from a WordPress-native environment
-----------------------------------------------

[](#differences-from-a-wordpress-native-environment)

AreaThis libraryWordPress-nativeHTML sanitizationNative `DOMDocument` (`NativeHtmlSanitizerAdapter`)`wp_kses()`Markdown`erusev/parsedown`Internal WP.org Markdown classContributor validationSlug format check onlyLive `get_user_by()` WP DB query`Tested up to` upper boundNot enforcedCapped at `WP_CORE_STABLE_BRANCH + 0.1`WordPress dependencyNoneRequiredRunning tests
-------------

[](#running-tests)

```
composer install
./vendor/bin/phpunit                     # all tests
./vendor/bin/phpunit --testsuite Unit    # unit tests only
./vendor/bin/phpunit --testsuite Integration  # real-adapter tests only
composer stan                            # PHPStan static analysis
composer cs                              # check code style
composer cs:fix                          # fix code style
```

License
-------

[](#license)

[MIT](LICENSE) © Andy Fragen

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance95

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~10 days

Total

4

Last Release

24d ago

PHP version history (2 changes)1.0.0PHP &gt;=8.1 &lt;8.6

1.0.2PHP &gt;=8.0 &lt;8.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/82779a185fccde41e1dd3b914bde84cd6be76c8dcb8f6b983f461c8f5687a87e?d=identicon)[afragen](/maintainers/afragen)

---

Top Contributors

[![afragen](https://avatars.githubusercontent.com/u/1296790?v=4)](https://github.com/afragen "afragen (19 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/afragen-wp-readme-parser/health.svg)

```
[![Health](https://phpackages.com/badges/afragen-wp-readme-parser/health.svg)](https://phpackages.com/packages/afragen-wp-readme-parser)
```

###  Alternatives

[afragen/github-updater

A plugin to automatically update GitHub, Bitbucket, GitLab, or Gitea hosted plugins, themes, and language packs.

3.3k20.4k](/packages/afragen-github-updater)[afragen/git-updater

A plugin to automatically update GitHub, Bitbucket, GitLab, or Gitea hosted plugins, themes, and language packs.

3.3k1.7k](/packages/afragen-git-updater)[wp-hooks/generator

Generates a JSON representation of the WordPress actions and filters in your code

87179.9k5](/packages/wp-hooks-generator)[stepanenko3/nova-cards

A Laravel Nova info cards.

33147.6k](/packages/stepanenko3-nova-cards)[benmanu/silverstripe-styleguide

Generates a styleguide for a SilverStripe theme

108.1k1](/packages/benmanu-silverstripe-styleguide)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
