{"id":13760049,"url":"https://github.com/TypistTech/imposter-plugin","last_synced_at":"2025-05-10T10:31:12.159Z","repository":{"id":18779290,"uuid":"85290139","full_name":"typisttech/imposter-plugin","owner":"typisttech","description":"Composer plugin that wraps all composer vendor packages inside your own namespace. Intended for WordPress plugins.","archived":false,"fork":false,"pushed_at":"2023-10-06T16:01:49.000Z","size":933,"stargazers_count":153,"open_issues_count":8,"forks_count":12,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-05-05T22:08:26.886Z","etag":null,"topics":["composer-plugin","dependency","devtools","monkey-patching","namespace","php","wordpress","wordpress-development"],"latest_commit_sha":null,"homepage":"https://www.typist.tech/projects/imposter-plugin","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/typisttech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-17T08:46:34.000Z","updated_at":"2025-04-27T17:49:33.000Z","dependencies_parsed_at":"2024-05-02T15:57:30.499Z","dependency_job_id":"255f81f3-f44c-468d-9312-78c3b94a5a17","html_url":"https://github.com/typisttech/imposter-plugin","commit_stats":{"total_commits":423,"total_committers":3,"mean_commits":141.0,"dds":"0.21749408983451535","last_synced_commit":"11d16a7af76dc08e47b05c3baca93036404b4f93"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typisttech%2Fimposter-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typisttech%2Fimposter-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typisttech%2Fimposter-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typisttech%2Fimposter-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/typisttech","download_url":"https://codeload.github.com/typisttech/imposter-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252584329,"owners_count":21771945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer-plugin","dependency","devtools","monkey-patching","namespace","php","wordpress","wordpress-development"],"created_at":"2024-08-03T13:01:02.648Z","updated_at":"2025-05-10T10:31:11.902Z","avatar_url":"https://github.com/typisttech.png","language":"PHP","readme":"\u003cdiv align=\"center\"\u003e\n\n# Imposter Plugin\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n\n[![Packagist](https://img.shields.io/packagist/v/typisttech/imposter-plugin.svg?style=flat-square)](https://packagist.org/packages/typisttech/imposter-plugin)\n[![Packagist](https://img.shields.io/packagist/dt/typisttech/imposter-plugin.svg?style=flat-square)](https://packagist.org/packages/typisttech/imposter-plugin)\n[![PHP from Packagist](https://img.shields.io/packagist/php-v/TypistTech/imposter-plugin?style=flat-square)](https://packagist.org/packages/typisttech/imposter-plugin)\n[![CircleCI](https://img.shields.io/circleci/build/gh/TypistTech/imposter-plugin?style=flat-square)](https://circleci.com/gh/TypistTech/imposter-plugin)\n[![license](https://img.shields.io/github/license/TypistTech/imposter-plugin.svg?style=flat-square)](https://github.com/TypistTech/imposter-plugin/blob/master/LICENSE)\n[![Twitter Follow @TangRufus](https://img.shields.io/twitter/follow/TangRufus?style=flat-square\u0026color=1da1f2\u0026logo=twitter)](https://twitter.com/tangrufus)\n[![Hire Typist Tech](https://img.shields.io/badge/Hire-Typist%20Tech-ff69b4.svg?style=flat-square)](https://www.typist.tech/contact/)\n\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eComposer plugin that wraps all composer vendor packages inside your own namespace. Intended for WordPress plugins.\u003c/strong\u003e\n  \u003cbr /\u003e\n  \u003cbr /\u003e\n  Built with ♥ by \u003ca href=\"https://www.typist.tech/\"\u003eTypist Tech\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n**Imposter Plugin** is an open source project and completely free to use.\n\nHowever, 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:\n\n\u003cdiv align=\"center\"\u003e\n\n[![GitHub via Sponsor](https://img.shields.io/badge/Sponsor-GitHub-ea4aaa?style=flat-square\u0026logo=github)](https://github.com/sponsors/TangRufus)\n[![Sponsor via PayPal](https://img.shields.io/badge/Sponsor-PayPal-blue.svg?style=flat-square\u0026logo=paypal)](https://typist.tech/go/paypal-donate/)\n[![More Sponsorship Information](https://img.shields.io/badge/Sponsor-More%20Details-ff69b4?style=flat-square)](https://typist.tech/donate/imposter-plugin/)\n\n\u003c/div\u003e\n\n---\n\nWrapping 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/).\n\n## Why?\n\nBecause of the lack of dependency management in WordPress, if two plugins bundled conflicting versions of the same package, hard-to-reproduce bugs arise.\nMonkey patching composer vendor packages, wrapping them inside your own namespace is a less-than-ideal solution to avoid such conflicts.\n\nSee:\n- [A Narrative of Using Composer in a WordPress Plugin](https://wptavern.com/a-narrative-of-using-composer-in-a-wordpress-plugin)\n- [A Warning About Using Composer With WordPress](https://wppusher.com/blog/a-warning-about-using-composer-with-wordpress/)\n- [Plugin Dependencies (Yet Another Plugin Dependencies Ticket)](https://core.trac.wordpress.org/ticket/22316)\n\n## Install\n\nInstallation should be done via composer, details of how to install composer can be found at [https://getcomposer.org/](https://getcomposer.org/).\n\nFirst, add Imposter configuration in your `composer.json`\n\n```json\n\"extra\": {\n    \"imposter\": {\n        \"namespace\": \"My\\\\App\\\\Vendor\",\n        \"excludes\": [\n            \"dummy/dummy-excluded\"\n        ]\n    }\n}\n```\n\nThen, install via composer cli\n\n```bash\ncomposer require typisttech/imposter-plugin\n```\n\nSee: [Imposter readme](https://github.com/Typisttech/imposter#config) for details.\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eTypist Tech is ready to build your next awesome WordPress site. \u003ca href=\"https://typist.tech/contact/\"\u003eHire us!\u003c/a\u003e\u003c/strong\u003e\n\u003c/p\u003e\n\n---\n\n## Usage\n\n### Sit Back and Relax\n\nOnce installed, this plugin hooks into `composer install`, `composer update` and `composer dump-autoload`, automatically run [imposter](https://github.com/TypistTech/imposter/) for you.\nBesides, imposter plugin autoloads all modified files as [classmap](https://getcomposer.org/doc/04-schema.md#classmap).\n\nWhen those events triggered, this plugin:\n1. looks for `/path/to/project/root/composer.json`\n2. finds out [vendor-dir](https://getcomposer.org/doc/06-config.md#vendor-dir)\n3. finds out all [required packages](https://getcomposer.org/doc/04-schema.md#require), including those required by dependencies\n4. finds out all [autoload paths](https://getcomposer.org/doc/04-schema.md#autoload) for all required packages\n5. prefixes all namespaces with the imposter-plugin namespace defined in your `composer.json`\n\nLearn more on [imposter's readme](https://github.com/TypistTech/imposter#usage).\n\n## Known Issues\n\nHelp wanted. Pull requests are welcomed.\n\n1. Imposter run twice when `composer install` and `composer update`\n1. Traits are not transformed\n1. Virtual packages are not supported\n\n## Frequently Asked Questions\n\n### What can I find more information?\n\nLearn more on [imposter's readme](https://github.com/TypistTech/imposter/) for more details.\n\n### How about not hooking into composer commands?\n\nUse [imposter](https://github.com/TypistTech/imposter/) directly.\n\n### How to distrube impostified plugins?\n\n1. Switch to the lowest PHP version you support\n1. Install dependencies\n    * `$ composer install --no-dev --classmap-authoritative --prefer-dist`\n1. Clean up the source code, e.g: remove test files\n1. Zip the source code. Tips: Use [`$ composer archive`](https://getcomposer.org/doc/03-cli.md#archive)\n1. Send the zip to others / Commit to wp.org SVN. Tips:\n    * [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)\n    * [WordPress.org Plugin Deploy (GitHub action by 10up)](https://github.com/10up/action-wordpress-plugin-deploy)\n\n### How to install impostified plugins via composer?\n\nImpostified plugins are meant to be commited to wp.org svn.\n\nUsing 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`).\n\nTo `composer require` impostified plugins, use [wpackagist.org](https://wpackagist.org).\n\n### The whole imposter situation is horrible. What can we do about it?\n\nUntil WordPress core comes up with a [solution on dependency managment](https://core.trac.wordpress.org/ticket/22316), keep clam and carry on.\n\nIn the meantime, checkout these tools ~~to make WordPress suck less~~ modernizing WordPress development:\n\n- [bring OOP into WordPress](https://github.com/search?q=topic%3Awordpress-development+org%3ATypistTech\u0026type=Repositories)\n- [leveraging development practices from other languages and ecosystems, and applying them to WordPress](https://roots.io)\n\n### Do you have real life examples that use this composer plugin?\n\nHere you go:\n\n * [Spatie Ray](https://github.com/spatie/wordpress-ray)\n * [Notification](https://github.com/BracketSpace/Notification)\n\n*Add your own [here](https://github.com/TypistTech/imposter-plugin/edit/master/README.md)*\n\n### Which composer versions are supported?\n\nBoth v1 and v2.\n\n### Will you add support for older PHP versions?\n\nNever! This plugin will only work on [actively supported PHP versions](https://secure.php.net/supported-versions.php).\n\nDon't use it on **end of life** or **security fixes only** PHP versions.\n\n### It looks awesome. Where can I find some more goodies like this\n\n- Articles on [Typist Tech's blog](https://typist.tech)\n- [Tang Rufus' WordPress plugins](https://profiles.wordpress.org/tangrufus#content-plugins) on wp.org\n- More projects on [Typist Tech's GitHub profile](https://github.com/TypistTech)\n- Stay tuned on [Typist Tech's newsletter](https://typist.tech/go/newsletter)\n- Follow [Tang Rufus' Twitter account](https://twitter.com/TangRufus)\n- **Hire [Tang Rufus](https://typist.tech/contact) to build your next awesome site**\n\n### Where can I give 5-star reviews?\n\nThanks! Glad you like it. It's important to let me knows somebody is using this project. Please consider:\n\n- [tweet](https://twitter.com/intent/tweet?url=https%3A%2F%2Fgithub.com%2FTypistTech%2Fimposter-plugin\u0026via=tangrufus\u0026text=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)\n- ★ star [the Github repo](https://github.com/TypistTech/imposter-plugin)\n- [👀 watch](https://github.com/TypistTech/imposter-plugin/subscription) the Github repo\n- write tutorials and blog posts\n- **[hire](https://www.typist.tech/contact/) Typist Tech**\n\n## Testing\n\n```bash\ncomposer test\ncomposer style:check\n```\n\n## Alternatives\n\nHere is a list of alternatives that I found. However, none of these satisfied my requirements.\n\n*If you know other similar projects, feel free to edit this section!*\n\n* [Mozart](https://github.com/coenjacobs/mozart) by Coen Jacobs\n    - Works with PSR0 and PSR4\n    - Dependency packages store in a different directory\n\n* [PHP Scoper](https://github.com/humbug/php-scoper)\n    - Prefixes all PHP namespaces in a file/directory to isolate the code bundled in PHARs\n\n## Feedback\n\n**Please provide feedback!** We want to make this project as useful as possible.\nPlease [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/).\n**No issue is too small.**\n\n## Security Vulnerabilities\n\nIf you discover a security vulnerability within this project, please email us at [imposter-plugin@typist.tech](mailto:imposter-plugin@typist.tech).\nAll security vulnerabilities will be promptly addressed.\n\n## Credits\n\n[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/).\n\nFull list of contributors can be found [here](https://github.com/TypistTech/imposter-plugin/graphs/contributors).\n\n## License\n\n[Imposter Plugin](https://github.com/TypistTech/imposter-plugin) is released under the [MIT License](https://opensource.org/licenses/MIT).\n","funding_links":["https://github.com/sponsors/TangRufus"],"categories":["PHP"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTypistTech%2Fimposter-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTypistTech%2Fimposter-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTypistTech%2Fimposter-plugin/lists"}