PHPackages                             micropackage/filesystem - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. micropackage/filesystem

ActiveLibrary[File &amp; Storage](/categories/file-storage)

micropackage/filesystem
=======================

Wrapper for WordPress' Filesystem for easier file manipulations.

1.1.5(3y ago)1962.9k↑12.5%5[1 issues](https://github.com/micropackage/filesystem/issues)3GPL-3.0-or-laterPHPPHP &gt;=5.6CI failing

Since Jan 28Pushed 3y ago3 watchersCompare

[ Source](https://github.com/micropackage/filesystem)[ Packagist](https://packagist.org/packages/micropackage/filesystem)[ RSS](/packages/micropackage-filesystem/feed)WikiDiscussions develop Synced yesterday

READMEChangelog (3)Dependencies (4)Versions (9)Used By (3)

Filesystem
==========

[](#filesystem)

[![BracketSpace Micropackage](https://camo.githubusercontent.com/7a9f5ff780f859fdebce60d4e11572de05f86c42ef96b77967c24d7ea7d1e04b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f427261636b657453706163652d4d6963726f7061636b6167652d627269676874677265656e)](https://bracketspace.com)[![Latest Stable Version](https://camo.githubusercontent.com/57c9b32b9bfec1dbc7101c663d0bb5da44122442e0cccf56e54bbac4274f14e4/68747470733a2f2f706f7365722e707567782e6f72672f6d6963726f7061636b6167652f66696c6573797374656d2f762f737461626c65)](https://packagist.org/packages/micropackage/filesystem)[![PHP from Packagist](https://camo.githubusercontent.com/ca8ab64f386a94fe0185e11a6f90ce60e0fd1a0ad389af86d40e302d7118d7ef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6d6963726f7061636b6167652f66696c6573797374656d2e737667)](https://packagist.org/packages/micropackage/filesystem)[![Total Downloads](https://camo.githubusercontent.com/cef18294900d2b88978d9885f0ae554282f9452e067cb8aec0ac88cfe3d8d0c1/68747470733a2f2f706f7365722e707567782e6f72672f6d6963726f7061636b6167652f66696c6573797374656d2f646f776e6c6f616473)](https://packagist.org/packages/micropackage/filesystem)[![License](https://camo.githubusercontent.com/db7d41296e349538bfbee09c6f897753bc66dec02bd03ac82b284f561d1d7805/68747470733a2f2f706f7365722e707567782e6f72672f6d6963726f7061636b6167652f66696c6573797374656d2f6c6963656e7365)](https://packagist.org/packages/micropackage/filesystem)

 [![Micropackage logo](https://camo.githubusercontent.com/9b9fc4f221b3683db4f9cc63e1ed92220004bbda118206d0a26d5ce6377d4d46/68747470733a2f2f627261636b657473706163652e636f6d2f6578747261732f6d6963726f7061636b6167652f6d6963726f7061636b6167652d736d616c6c2e706e67)](https://camo.githubusercontent.com/9b9fc4f221b3683db4f9cc63e1ed92220004bbda118206d0a26d5ce6377d4d46/68747470733a2f2f627261636b657473706163652e636f6d2f6578747261732f6d6963726f7061636b6167652f6d6963726f7061636b6167652d736d616c6c2e706e67)

🧬 About Filesystem
------------------

[](#-about-filesystem)

This micropackage is a wrapper for WordPress filesystem intended to be used within the `wp-content` directory.

Supports:

- plugins
- must-use plugins
- themes
- custom upload directories
- custom wp-content directories

This package will prefix all the relative paths to full paths giving a convinient way to manipulate files.

💾 Installation
--------------

[](#-installation)

```
composer require micropackage/filesystem
```

🕹 Usage
-------

[](#-usage)

Initializing the Filesystem class from the main plugin/theme file. It just needs a base directory.

```
use Micropackage\Filesystem\Filesystem;

$filesystem = new Filesystem( __DIR__ );
```

Using the micropackage to obtain full paths (plugin example).

```
echo $filesystem->path();
// /var/www/html/wp-content/plugins/my-plugin/

echo $filesystem->path( 'src/templates/full-width.php' );
// /var/www/html/wp-content/plugins/my-plugin/src/templates/full-width.php
```

Using the micropackage to obtain full URL (plugin example).

```
echo $filesystem->url();
// https://my.plugin/wp-content/plugins/my-plugin/

echo $filesystem->url( 'assets/images/logo.svg' );
// https://my.plugin/wp-content/plugins/my-plugin/assets/images/logo.svg
```

Convert image file to base64 URL.

```
printf( '', $filesystem->image_to_base64( 'assets/images/logo.svg' ) );
//
```

On top of that, you can use any method provided by WP\_Filesystem class, which includes:

- `get_contents()`
- `exists()`
- `is_file()`, `is_dir()`
- `mkdir()`
- `delete()`
- ...

[See all available methods](https://developer.wordpress.org/reference/classes/wp_filesystem_base/#methods)

📦 About the Micropackage project
--------------------------------

[](#-about-the-micropackage-project)

Micropackages - as the name suggests - are micro packages with a tiny bit of reusable code, helpful particularly in WordPress development.

The aim is to have multiple packages which can be put together to create something bigger by defining only the structure.

Micropackages are maintained by [BracketSpace](https://bracketspace.com).

📖 Changelog
-----------

[](#-changelog)

[See the changelog file](./CHANGELOG.md).

📃 License
---------

[](#-license)

This software is released under MIT license. See the [LICENSE](./LICENSE) file for more information.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 79.2% 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 ~207 days

Recently: every ~308 days

Total

7

Last Release

1106d ago

### Community

Maintainers

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

---

Top Contributors

[![jakubmikita](https://avatars.githubusercontent.com/u/18362490?v=4)](https://github.com/jakubmikita "jakubmikita (38 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (6 commits)")[![szaleq](https://avatars.githubusercontent.com/u/25011639?v=4)](https://github.com/szaleq "szaleq (4 commits)")

---

Tags

bracketspacecomposer-libraryfilesystemmicropackagewordpress

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/micropackage-filesystem/health.svg)

```
[![Health](https://phpackages.com/badges/micropackage-filesystem/health.svg)](https://phpackages.com/packages/micropackage-filesystem)
```

PHPackages © 2026

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