PHPackages                             typisttech/imposter-plugin - 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. typisttech/imposter-plugin

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

typisttech/imposter-plugin
==========================

Composer plugin that wraps all composer vendor packages inside your own namespace. Intended for WordPress plugins.

0.6.2(5y ago)158251.0k↓37%12[5 PRs](https://github.com/typisttech/imposter-plugin/pulls)2MITPHPPHP ^7.3 || ^8.0CI failing

Since Mar 21Pushed 2y ago9 watchersCompare

[ Source](https://github.com/typisttech/imposter-plugin)[ Packagist](https://packagist.org/packages/typisttech/imposter-plugin)[ Docs](https://github.com/TypistTech/imposter-plugin)[ Fund](https://typist.tech/donation/)[ Fund](https://www.paypal.me/iAmTangRufus/30usd)[ RSS](/packages/typisttech-imposter-plugin/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (9)Versions (21)Used By (2)

Imposter Plugin
===============

[](#imposter-plugin)

[![Packagist](https://camo.githubusercontent.com/d2c84d93630e2ee3200ec6cbd51c802b765ebed1d0d4b85f6a179ae8dd9857fb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f747970697374746563682f696d706f737465722d706c7567696e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/typisttech/imposter-plugin)[![Packagist](https://camo.githubusercontent.com/1b8db173cf4aadb5cdde59a7f619d6556748db2dbea0dbcd5ff54726dcd14732/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f747970697374746563682f696d706f737465722d706c7567696e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/typisttech/imposter-plugin)[![PHP from Packagist](https://camo.githubusercontent.com/a35438bea159b9207d0d9ae9ea450e09e157e4feee81fdb01362a745f04f7f9b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f547970697374546563682f696d706f737465722d706c7567696e3f7374796c653d666c61742d737175617265)](https://packagist.org/packages/typisttech/imposter-plugin)[![CircleCI](https://camo.githubusercontent.com/6b211bd984c6cca7077dcde1c833e170a00a2b71a5a07dfcb63e0fba7ca416c5/68747470733a2f2f696d672e736869656c64732e696f2f636972636c6563692f6275696c642f67682f547970697374546563682f696d706f737465722d706c7567696e3f7374796c653d666c61742d737175617265)](https://circleci.com/gh/TypistTech/imposter-plugin)[![license](https://camo.githubusercontent.com/6594d6b069e45f671665521198faba292be14d86831e7ac3998b52f51270d664/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f547970697374546563682f696d706f737465722d706c7567696e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/TypistTech/imposter-plugin/blob/master/LICENSE)[![Twitter Follow @TangRufus](https://camo.githubusercontent.com/a4aa54a559719fc76a4677ca1d7ec33443d14423085acb58d268fe77f09c61ce/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f54616e6752756675733f7374796c653d666c61742d73717561726526636f6c6f723d316461316632266c6f676f3d74776974746572)](https://twitter.com/tangrufus)[![Hire Typist Tech](https://camo.githubusercontent.com/8dd68fe769812bdfb1c34fd397ff5e022170342b1d3a47c53055c566ffe8489d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f486972652d547970697374253230546563682d6666363962342e7376673f7374796c653d666c61742d737175617265)](https://www.typist.tech/contact/)

 **Composer plugin that wraps all composer vendor packages inside your own namespace. Intended for WordPress plugins.**

 Built with ♥ by [Typist Tech](https://www.typist.tech/)

---

**Imposter Plugin** is an open source project and completely free to use.

However, the amount of effort needed to maintain and develop new features is not sustainable without proper financial backing. If you have the capability, please consider donating using the links below:

[![GitHub via Sponsor](https://camo.githubusercontent.com/9c923c0024fc20fbd1ea153035ab2b5bb25cf1423c5aa07c35fd3e16b227a307/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53706f6e736f722d4769744875622d6561346161613f7374796c653d666c61742d737175617265266c6f676f3d676974687562)](https://github.com/sponsors/TangRufus)[![Sponsor via PayPal](https://camo.githubusercontent.com/117a21252fdae389ecc103138cd11218cd7587caf3901b042dfe9dbe3690294e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53706f6e736f722d50617950616c2d626c75652e7376673f7374796c653d666c61742d737175617265266c6f676f3d70617970616c)](https://typist.tech/go/paypal-donate/)[![More Sponsorship Information](https://camo.githubusercontent.com/15df9b6725c174bae83d974b5cd09cc984d66ee62b3570785648de09de168736/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53706f6e736f722d4d6f726525323044657461696c732d6666363962343f7374796c653d666c61742d737175617265)](https://typist.tech/donate/imposter-plugin/)

---

Wrapping all composer vendor packages inside your own namespace. Intended for WordPress plugins. Imposter Plugin is a composer plugin wrapper for [Imposter](https://github.com/TypistTech/imposter/).

Why?
----

[](#why)

Because of the lack of dependency management in WordPress, if two plugins bundled conflicting versions of the same package, hard-to-reproduce bugs arise. Monkey patching composer vendor packages, wrapping them inside your own namespace is a less-than-ideal solution to avoid such conflicts.

See:

- [A Narrative of Using Composer in a WordPress Plugin](https://wptavern.com/a-narrative-of-using-composer-in-a-wordpress-plugin)
- [A Warning About Using Composer With WordPress](https://wppusher.com/blog/a-warning-about-using-composer-with-wordpress/)
- [Plugin Dependencies (Yet Another Plugin Dependencies Ticket)](https://core.trac.wordpress.org/ticket/22316)

Install
-------

[](#install)

Installation should be done via composer, details of how to install composer can be found at .

First, add Imposter configuration in your `composer.json`

```
"extra": {
    "imposter": {
        "namespace": "My\\App\\Vendor",
        "excludes": [
            "dummy/dummy-excluded"
        ]
    }
}
```

Then, install via composer cli

```
composer require typisttech/imposter-plugin
```

See: [Imposter readme](https://github.com/Typisttech/imposter#config) for details.

---

 **Typist Tech is ready to build your next awesome WordPress site. [Hire us!](https://typist.tech/contact/)**

---

Usage
-----

[](#usage)

### Sit Back and Relax

[](#sit-back-and-relax)

Once installed, this plugin hooks into `composer install`, `composer update` and `composer dump-autoload`, automatically run [imposter](https://github.com/TypistTech/imposter/) for you. Besides, imposter plugin autoloads all modified files as [classmap](https://getcomposer.org/doc/04-schema.md#classmap).

When those events triggered, this plugin:

1. looks for `/path/to/project/root/composer.json`
2. finds out [vendor-dir](https://getcomposer.org/doc/06-config.md#vendor-dir)
3. finds out all [required packages](https://getcomposer.org/doc/04-schema.md#require), including those required by dependencies
4. finds out all [autoload paths](https://getcomposer.org/doc/04-schema.md#autoload) for all required packages
5. prefixes all namespaces with the imposter-plugin namespace defined in your `composer.json`

Learn more on [imposter's readme](https://github.com/TypistTech/imposter#usage).

Known Issues
------------

[](#known-issues)

Help wanted. Pull requests are welcomed.

1. Imposter run twice when `composer install` and `composer update`
2. Traits are not transformed
3. Virtual packages are not supported

Frequently Asked Questions
--------------------------

[](#frequently-asked-questions)

### What can I find more information?

[](#what-can-i-find-more-information)

Learn more on [imposter's readme](https://github.com/TypistTech/imposter/) for more details.

### How about not hooking into composer commands?

[](#how-about-not-hooking-into-composer-commands)

Use [imposter](https://github.com/TypistTech/imposter/) directly.

### How to distrube impostified plugins?

[](#how-to-distrube-impostified-plugins)

1. Switch to the lowest PHP version you support
2. Install dependencies
    - `$ composer install --no-dev --classmap-authoritative --prefer-dist`
3. Clean up the source code, e.g: remove test files
4. Zip the source code. Tips: Use [`$ composer archive`](https://getcomposer.org/doc/03-cli.md#archive)
5. Send the zip to others / Commit to wp.org SVN. Tips:
    - [How to Deploy a WordPress Plugin From TravisCI to WordPress.org](https://code.tutsplus.com/tutorials/how-to-deploy-wordpress-plugin-from-travisci-to-wordpressorg--cms-28831)
    - [WordPress.org Plugin Deploy (GitHub action by 10up)](https://github.com/10up/action-wordpress-plugin-deploy)

### How to install impostified plugins via composer?

[](#how-to-install-impostified-plugins-via-composer)

Impostified plugins are meant to be commited to wp.org svn.

Using imposter means you forgo the ability to install the plugins with composer directly via [packagist.org](https://packagist.org/) or VCS (even with `type: wordpress-plugin` in `composer.json`).

To `composer require` impostified plugins, use [wpackagist.org](https://wpackagist.org).

### The whole imposter situation is horrible. What can we do about it?

[](#the-whole-imposter-situation-is-horrible-what-can-we-do-about-it)

Until WordPress core comes up with a [solution on dependency managment](https://core.trac.wordpress.org/ticket/22316), keep clam and carry on.

In the meantime, checkout these tools to make WordPress suck less modernizing WordPress development:

- [bring OOP into WordPress](https://github.com/search?q=topic%3Awordpress-development+org%3ATypistTech&type=Repositories)
- [leveraging development practices from other languages and ecosystems, and applying them to WordPress](https://roots.io)

### Do you have real life examples that use this composer plugin?

[](#do-you-have-real-life-examples-that-use-this-composer-plugin)

Here you go:

- [Spatie Ray](https://github.com/spatie/wordpress-ray)
- [Notification](https://github.com/BracketSpace/Notification)

*Add your own [here](https://github.com/TypistTech/imposter-plugin/edit/master/README.md)*

### Which composer versions are supported?

[](#which-composer-versions-are-supported)

Both v1 and v2.

### Will you add support for older PHP versions?

[](#will-you-add-support-for-older-php-versions)

Never! This plugin will only work on [actively supported PHP versions](https://secure.php.net/supported-versions.php).

Don't use it on **end of life** or **security fixes only** PHP versions.

### It looks awesome. Where can I find some more goodies like this

[](#it-looks-awesome-where-can-i-find-some-more-goodies-like-this)

- Articles on [Typist Tech's blog](https://typist.tech)
- [Tang Rufus' WordPress plugins](https://profiles.wordpress.org/tangrufus#content-plugins) on wp.org
- More projects on [Typist Tech's GitHub profile](https://github.com/TypistTech)
- Stay tuned on [Typist Tech's newsletter](https://typist.tech/go/newsletter)
- Follow [Tang Rufus' Twitter account](https://twitter.com/TangRufus)
- **Hire [Tang Rufus](https://typist.tech/contact) to build your next awesome site**

### Where can I give 5-star reviews?

[](#where-can-i-give-5-star-reviews)

Thanks! Glad you like it. It's important to let me knows somebody is using this project. Please consider:

- [tweet](https://twitter.com/intent/tweet?url=https%3A%2F%2Fgithub.com%2FTypistTech%2Fimposter-plugin&via=tangrufus&text=Imposter%20Plugin%20-%20Composer%20plugin%20that%20wraps%20all%20%23composer%20vendor%20packages%20inside%20your%20own%20namespace.%20Intended%20for%20%23WordPress%20plugins) something good with mentioning [@TangRufus](https://twitter.com/tangrufus)
- ★ star [the Github repo](https://github.com/TypistTech/imposter-plugin)
- [👀 watch](https://github.com/TypistTech/imposter-plugin/subscription) the Github repo
- write tutorials and blog posts
- **[hire](https://www.typist.tech/contact/) Typist Tech**

Testing
-------

[](#testing)

```
composer test
composer style:check
```

Alternatives
------------

[](#alternatives)

Here is a list of alternatives that I found. However, none of these satisfied my requirements.

*If you know other similar projects, feel free to edit this section!*

- [Mozart](https://github.com/coenjacobs/mozart) by Coen Jacobs

    - Works with PSR0 and PSR4
    - Dependency packages store in a different directory
- [PHP Scoper](https://github.com/humbug/php-scoper)

    - Prefixes all PHP namespaces in a file/directory to isolate the code bundled in PHARs

Feedback
--------

[](#feedback)

**Please provide feedback!** We want to make this project as useful as possible. Please [submit an issue](https://github.com/TypistTech/imposter-plugin/issues/new) and point out what you do and don't like, or fork the project and [send pull requests](https://github.com/TypistTech/imposter-plugin/pulls/). **No issue is too small.**

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you discover a security vulnerability within this project, please email us at . All security vulnerabilities will be promptly addressed.

Credits
-------

[](#credits)

[Imposter Plugin](https://github.com/TypistTech/imposter-plugin) is a [Typist Tech](https://typist.tech) project and maintained by [Tang Rufus](https://twitter.com/TangRufus), freelance developer for [hire](https://www.typist.tech/contact/).

Full list of contributors can be found [here](https://github.com/TypistTech/imposter-plugin/graphs/contributors).

License
-------

[](#license)

[Imposter Plugin](https://github.com/TypistTech/imposter-plugin) is released under the [MIT License](https://opensource.org/licenses/MIT).

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

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

###  Release Activity

Cadence

Every ~97 days

Recently: every ~82 days

Total

15

Last Release

1989d ago

PHP version history (5 changes)0.1.0PHP ^7.0

0.3.1PHP ^7.1

0.4.0PHP ^7.2

0.6.1PHP ^7.3

0.6.2PHP ^7.3 || ^8.0

### Community

Maintainers

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

---

Top Contributors

[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (661 commits)")[![tangrufus](https://avatars.githubusercontent.com/u/2259834?v=4)](https://github.com/tangrufus "tangrufus (158 commits)")

---

Tags

composer-plugindependencydevtoolsmonkey-patchingnamespacephpwordpresswordpress-developmentcomposerwordpressdependencyMonkey Patchingnamespacecomposer-plugin

###  Code Quality

TestsCodeception

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/typisttech-imposter-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/typisttech-imposter-plugin/health.svg)](https://phpackages.com/packages/typisttech-imposter-plugin)
```

###  Alternatives

[typisttech/imposter

Wrapping all composer vendor packages inside your own namespace. Intended for WordPress plugins.

111286.6k1](/packages/typisttech-imposter)[bamarni/composer-bin-plugin

No conflicts for your bin dependencies

52722.0M859](/packages/bamarni-composer-bin-plugin)[mnsami/composer-custom-directory-installer

A composer plugin, to help install packages of different types in custom paths.

1395.0M52](/packages/mnsami-composer-custom-directory-installer)[szepeviktor/composer-envato

Composer plugin for Envato

3715.2k1](/packages/szepeviktor-composer-envato)[arokettu/composer-license-manager

License management plugin for Composer

61207.9k](/packages/arokettu-composer-license-manager)[webimpress/composer-extra-dependency

Composer plugin to require extra dependencies

11701.7k1](/packages/webimpress-composer-extra-dependency)

PHPackages © 2026

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