PHPackages                             saggre/wordpress-org-repository-php-wrapper - 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. [API Development](/categories/api)
4. /
5. saggre/wordpress-org-repository-php-wrapper

ActiveLibrary[API Development](/categories/api)

saggre/wordpress-org-repository-php-wrapper
===========================================

A Wordpress.org Repository API wrapper for PHP

011PHPCI passing

Since Aug 1Pushed 7mo agoCompare

[ Source](https://github.com/Saggre/wordpress-org-repository-php-wrapper)[ Packagist](https://packagist.org/packages/saggre/wordpress-org-repository-php-wrapper)[ RSS](/packages/saggre-wordpress-org-repository-php-wrapper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

A WordPress.org Repository API wrapper for PHP
==============================================

[](#a-wordpressorg-repository-api-wrapper-for-php)

Use cases: Plugin and theme directory data, update checks, analysis.

[![codecov](https://camo.githubusercontent.com/f325849bc0bc5bda328ae24d95d4e51efb43d60e0dc3ccc67dd101f38d487654/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f5361676772652f776f726470726573732d6f72672d7265706f7369746f72792d7068702d77726170706572)](https://codecov.io/gh/Saggre/wordpress-org-repository-php-wrapper)[![FOSSA Status](https://camo.githubusercontent.com/ba4810395142e3b42ba13f6cc69f3de5514871f7532f4a5cc3a9ead72a15c244/68747470733a2f2f6170702e666f7373612e636f6d2f6170692f70726f6a656374732f6769742532426769746875622e636f6d253246536167677265253246776f726470726573732d6f72672d7265706f7369746f72792d7068702d777261707065722e7376673f747970653d736869656c64)](https://app.fossa.com/projects/git%2Bgithub.com%2FSaggre%2Fwordpress-org-repository-php-wrapper?ref=badge_shield)

This library provides a simple way to access the WordPress.org [plugins](https://wordpress.org/plugins/)and [themes](https://wordpress.org/themes/) repositories. It allows you to retrieve raw plugin and theme files and list directories.

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

[](#installation)

#### Installation via Composer

[](#installation-via-composer)

```
composer require --dev saggre/wordpress-org-repository-php-wrapper
```

Usage examples
--------------

[](#usage-examples)

### Configuring the client

[](#configuring-the-client)

#### Plugin client

[](#plugin-client)

```
// Client for the latest version (trunk) of the WooCommerce plugin
$config = new PluginClientConfig('woocommerce', 'trunk');
$client = new PluginClient($config);
```

#### Theme client

[](#theme-client)

```
// Client for version 1.2 of the Twenty Twenty-Five theme
$config = new ThemeClientConfig('twentytwentyfive', '1.2');
$client = new ThemeClient($config);
```

### Client methods

[](#client-methods)

#### Get plugin or theme file contents

[](#get-plugin-or-theme-file-contents)

```
$content = $client->getFile('readme.txt');

/*
 * === WooCommerce ===
 * Contributors: automattic, woocommerce
 * Tags: online store, ecommerce, shop, shopping cart, sell online
 * ...
 */
```

#### Get plugin or theme file contents as a stream

[](#get-plugin-or-theme-file-contents-as-a-stream)

```
$file = $client->getFileStream('readme.txt');
$content = stream_get_contents($file);

/*
 * === WooCommerce ===
 * Contributors: automattic, woocommerce
 * Tags: online store, ecommerce, shop, shopping cart, sell online
 * ...
 */
```

#### List plugin or theme directory contents

[](#list-plugin-or-theme-directory-contents)

```
use League\Flysystem\StorageAttributes;

$directory = $client->getDirectory();

$directory = array_map(
    fn(StorageAttributes $item) => $item->jsonSerialize(),
    $directory->toArray()
)

/*
 * array(
 *     ...
 *     array(
 *         'type' => 'file',
 *         'path' => 'woocommerce/trunk/woocommerce.php',
 *         'file_size' => 1851,
 *         'visibility' => null,
 *         'last_modified' => 1753778097,
 *         'mime_type' => 'text/xml; charset="utf-8"',
 *         'extra_metadata' => array(),
 *     ),
 *     ...
 * );
 */
```

Running tests
-------------

[](#running-tests)

```
# Clone the repository
git clone git@github.com:Saggre/wordpress-org-repository-php-wrapper.git

# Go to the cloned repository
cd wordpress-org-repository-php-wrapper

# Install dependencies
composer install

# Run PHPUnit in project root directory
./vendor/bin/phpunit
```

Documentation
-------------

[](#documentation)

Code documentation is available in the [docs](./docs/Home.md) directory.

License
-------

[](#license)

[![FOSSA Status](https://camo.githubusercontent.com/5da712465ce3376ff41b61ec32eb536aeae10fc7d3a3205fc883fcf7c24655ef/68747470733a2f2f6170702e666f7373612e636f6d2f6170692f70726f6a656374732f6769742532426769746875622e636f6d253246536167677265253246776f726470726573732d6f72672d7265706f7369746f72792d7068702d777261707065722e7376673f747970653d6c61726765)](https://app.fossa.com/projects/git%2Bgithub.com%2FSaggre%2Fwordpress-org-repository-php-wrapper?ref=badge_large)

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance45

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 Bus Factor1

Top contributor holds 96.7% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/a49ea1269e3be37bd6acdc514e7aecd5c512430f4c22d3d2474fdbe6cd6a1df5?d=identicon)[Saggre](/maintainers/Saggre)

---

Top Contributors

[![Saggre](https://avatars.githubusercontent.com/u/13721842?v=4)](https://github.com/Saggre "Saggre (29 commits)")[![fossabot](https://avatars.githubusercontent.com/u/29791463?v=4)](https://github.com/fossabot "fossabot (1 commits)")

---

Tags

apirepositorywordpresswordpress-apiwordpress-developmentwordpress-pluginwordpress-themewrapper

### Embed Badge

![Health badge](/badges/saggre-wordpress-org-repository-php-wrapper/health.svg)

```
[![Health](https://phpackages.com/badges/saggre-wordpress-org-repository-php-wrapper/health.svg)](https://phpackages.com/packages/saggre-wordpress-org-repository-php-wrapper)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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