Skip to content

WordPress Plugins Themes

Philipp Heuer edited this page Oct 1, 2017 · 5 revisions

WordPress Plugins

Please be aware that you need to use the custom deploy method, if you want to install plugins/themes.

Method 1: from the Offical WordPress Plugin Directory

Find your plugin in the official wordpress plugin directory. Now select a plugin of your choice, you will be visit a page like "https://wordpress.org/plugins/akismet/". Now you can take the part "akisment" and search in the WPackagist Repository.

Now you need to select the matching plugin and note down the latest version.

Now you need to add one row in the require section of the file composer.json. For more information about composer visit this link.

```json
"require": {
	...
	"wpackagist-plugin/akismet": "3.2"
	...
}

Now you need to designate the resource type. In the composer.json in the section "extra/installer-paths" you can select between three types.

  • web/app/mu-plugins/{$name}/ - must use plugins that can't be disabled.
  • web/app/plugins/{$name}/ - regular plugins that need to be enabled in the admin interface.
  • web/app/themes/{$name}/ - themes of your wordpress instance.

There you would add akismet as a regular plugin, which could look like this:

"web/app/plugins/{$name}/": [
	"type:wordpress-plugin",
	"wpackagist-plugin/akismet"
],

Please never delete the first line "type:..." within those sections.

To update your local dependencies and push your changes to heroku you need to run the following commands:

composer update
git add composer.json
git commit -m "Added a custom plugin"
git push heroku master

If you only want to test it locally, you only need to run composer update.

Method 2: your custom plugins

If you have any private/custom plugins, you may not want to push them to a public repository to add them.

To install a plugin copy it to the /web/app/plugins directory in your local repository.

Now you only need to commit the changes and push them to heroku to update your application. Run the following commands in your project directory:

composer update
git add --force web/app/plugins/YOUR_PLUGIN_DIRECTORY
git commit -m "Added a custom plugin"
git push heroku master

WordPress Themes

Method 1: from the Offical WordPress Theme Directory

Find your plugin in the official wordpress theme directory. Now select a theme of your choice, you will be visit a page like "https://wordpress.org/themes/nucleare/". Now you can take the part "nucleare" and search in the WPackagist Repository.

Now you need to select the matching plugin and note down the latest version.

Now you need to add one row in the require section of the file composer.json. You need to run "composer update" after changing the composer.json. For more information about composer visit this link.

"require": {
	...
	"wpackagist-theme/nucleare": "1.4.7"
	...
}

Now you need to designate the resource type. In the composer.json in the section "extra/installer-paths" you can select between three types.

In this case you need to add your theme in the "web/app/themes/{$name}/" section. This would look like this:

"web/app/themes/{$name}/": [
	"type:wordpress-theme",
	"wpackagist-theme/nucleare"
],

Please never delete the first line "type:..." within those sections.

Method 2: Your custom themes

If you have any private/custom themes, you may not want to push them to a public repository to add them.

To install a theme copy it to the /web/app/themes directory in your local repository.

Now you only need to commit the changes and push them to heroku to update your application. Run the following commands in your project directory:

composer update
git add --force web/app/themes/YOUR_THEME_DIRECTORY
git commit -m "Added a custom theme"
git push heroku master