Download the PHP package leymannx/wordpress-project without Composer
On this page you can find all versions of the php package leymannx/wordpress-project. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download leymannx/wordpress-project
More information about leymannx/wordpress-project
Files in leymannx/wordpress-project
Package wordpress-project
Short Description Composer template for WordPress projects.
License GPL-2.0+
Informations about the package wordpress-project
Composer Template for WordPress Projects
Replace some-dir
with whatever directory name you wish.
Usage
- Run above command.
- Point your vhost to
some-dir/web
. - Open site in browser and start WordPress installation as usual.
Optionally:
- After successful installation move
some-dir/web/wp-config.php
intosome-dir/wp-config/wp-config.php
and runcomposer install
once again. - Install
leymannx/wp-cli-launcher
to let thewp
command use this project'ssome-dir/bin/wp
from any location inside the project.
Custom plugins and themes
Custom stuff all goes inside some-dir/wp-custom
. There are subfolders for themes and plugins. They will get symlinked automatically into the right location on every composer install
run.
wordpress.org plugins and themes
Plugins are added to your project by running composer require wpackagist-plugin/plugin-name
and themes by composer require wpackagist-theme/theme-name
. You then can enable them normally via WP-CLI or from the backend as usual.
Update WordPress, plugins and themes
Managing your WordPress site with Composer means you also update it with Composer. And maybe use a plugin like WP Update Settings to disable backend notifications.
Recommendations
I strongly recommend to use WP-CFM to synchronize your WordPress configuration across all environments. After you activated the plugin you may want to have the config exported to/imported from some-dir/wp-config/cfm
. So place the following code into a custom mu-plugin under some-dir/wp-custom/mu-plugins/some-file.php
and run composer install
once to have it symlinked into the right location.
After you've set up your initial config in the backend you can export changes into some .json
file(s) anytime either from the backend by running wp config push some-config
. From now on it's as easy as putting the following commands into your deployment routine to have these changes synced across all environments.
Why?
Why another Composer template for WordPress? Well, at the time of writing this I found all other templates out there either too bloated or too minimalistic. I wanted to have a template that devides custom code and contrib code into dedicated locations (like in Drupal) and then have everything tied together into an absolutely normal WordPress.
And I wanted to be able to simply delete the whole some-dir/web
folder and then just run composer install
to have everything up and running again. Try it out yourself. That's a good feeling. With this template you shouldn't need to ever actually put a foot into the some-dir/web
folder.
I achieved that by using symlinks that get created/removed automatically as post-install-cmd
and post-update-cmd
commands from Composer. It's a pitty that WordPress doesn't come with its own composer.json
.
Why Composer at all? Because it sucks to have the whole monolithic codebase of WordPress pushed into a repo when all you really need are some few custom files whereas everything else should be just another dependency to pull.
Credits
All versions of wordpress-project with dependencies
leymannx/wordpress-finder Version ^0.0.14
oomphinc/composer-installers-extender Version ^1.1
vlucas/phpdotenv Version ^3.3
wp-cli/wp-cli-bundle Version ^2.0