> For the complete documentation index, see [llms.txt](https://framework.deep-web-solutions.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://framework.deep-web-solutions.com/your-first-plugin/multiple-plugins-using-the-dws-framework-on-the-same-wordpress-site.md).

# Multiple plugins using the framework on the same site

The keen observer might have noticed already that the `composer.json` file of the example plugin is somewhat different from that of the framework modules.

An advanced user might've already looked over the framework files and thought about issues like namespace collisions across different versions of the framework when multiple plugins are using it on the same WordPress site.

We explained this problem (and our solution) in our [dependency scoping introduction](/key-concepts-and-dev-tools/dependencies-scoping-php-scoper.md). In a nutshell, this is how what you need to do for this to *not* be a problem:

* The plugin dependencies go in the `require-dev` block instead of the `require` block.
* The package `deep-web-solutions/wordpress-configs` is required too.
* The `autoload` block must also contain the autoload configuration of all dependencies **but** prefixed with your plugin's unique scoping prefix. In the example plugin, that's `DWS_Deps`. The autoload configuration of a package can be found in its own `composer.json` file.
* Include a `prefix-dependencies` entry in your *scripts* block. This entry should contain calls to the [PHP-Scoper](https://github.com/humbug/php-scoper) binary file. The example plugin [contains examples](https://github.com/deep-web-solutions/wordpress-plugins-utility/blob/master/composer.json) for the DWS Framework, PHP-DI, and Monolog.
* Include `DeepWebSolutions\\Config\\Composer\\PrefixDependencies::postAutoloadDump` in the `post-autoload-dump` scripts command event. You can read more about Composer Scripts [here](https://getcomposer.org/doc/articles/scripts.md).

Basically, this will automagically do the following stuff every time you regenerate the Composer autoloader (usually on *install* and *update* commands):

* The static `PrefixDependencies::postAutoloadDump` method will be called from the `deep-web-solutions/wordpress-configs` package.
* That method will first make sure that Composer is running in dev mode, and if so, tries to ensure that things will run smoothly and calls the `prefix-dependencies` script.
* Using the pre-built configurations files for PHP-Scoper found in the `deep-web-solutions/wordpress-configs` package (or your custom config files), it will regenerate prefixed versions of your dependency files. Currently there are config files readily available for the [DWS Framework](https://packagist.org/packages/deep-web-solutions/), for [PHP-DI](https://packagist.org/packages/php-di/php-di), and for [Monolog](https://packagist.org/packages/monolog/monolog).

There is a bit more to it (specifically for compatibility with scoping a *WordPress* framework), but that's the gist of it. If you're interested in the whole nitty-gritty, check the files in the [wordpress-configs](https://github.com/deep-web-solutions/wordpress-configs) package.

{% hint style="info" %}
Run `composer install --no-dev` to remove all the development dependencies from the `vendor` folder and your plugin is basically ready to be installed on a WordPress site.
{% endhint %}

{% hint style="info" %}
If you're using some server upload deployment strategy (like automatic upload on save, provided by PhpStorm), simply exclude the `vendor` folder from upload and run the aforementioned Composer command on your server to generate the autoloader.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://framework.deep-web-solutions.com/your-first-plugin/multiple-plugins-using-the-dws-framework-on-the-same-wordpress-site.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
