xyu / heroku-wp

WordPress on Heroku
MIT License
869 stars 280 forks source link

Doc Needed: Add must-use plugin using Composer #96

Open Tailzip opened 7 years ago

Tailzip commented 7 years ago

Hi,

How can I add a must-use plugin using Composer?

Thanks!

xyu commented 7 years ago

Take a look at one of the MU plugins that comes with this repo already, secure-db-connection. You will first need to install the plugin via Composer's require:

https://github.com/xyu/heroku-wp/blob/cfe7105/composer.json#L22

Then add that plugin to the MU plugin custom installer path:

https://github.com/xyu/heroku-wp/blob/cfe7105/composer.json#L66

Tailzip commented 7 years ago

I finally manage to add one (S3 Uploads). After you add the plugin to the MU plugin custom installer path in your composer.json file, you also need to create a symlink in public/wp-content/mu-plugins that points to plugin's main file.

In my case, I ran this command inside public/wp-content/mu-plugins: ln -s s3-uploads/s3-uploads.php s3-uploads.php.

It would be nice to add a small paragraph in the README :)

xyu commented 7 years ago

@Tailzip good point I forgot about the symlink part of that process going to reopen this issue to get that fixed. 🙂