Installation
Check the requirements first.
Install with the boilerplate (recommended)
composer create-project clementdecou/simply my-project
The boilerplate installs WordPress, the framework and simply-maker with Composer, and brings:
- the configuration of WordPress in a
.envfile (see configuration); - WordPress, plugins and themes managed with Composer;
bin/console, to generate code (plugins, themes, hooks...) and clear the cache;- a Docker development environment.
Then:
- edit
.env:WP_HOME, the database settings, and the salts (generate them at https://roots.io/salts.html; the Docker setup script does it for you); - point your web server to the
web/directory, or start the Docker environment; - install WordPress from the browser or with WP-CLI (
wp core install).
Project structure
my-project
├── bin/console Simply commands
├── config
│ ├── application.php WordPress configuration, read from .env
│ └── extensions.php Simply extensions to load
├── docker/ compose.yaml Docker development environment
├── vendor/
├── web document root
│ ├── wp/ WordPress core (installed by Composer, not versioned)
│ ├── content
│ │ ├── mu-plugins
│ │ │ ├── load.php loads the framework and the extensions
│ │ │ ├── simply-framework/
│ │ │ └── simply-maker/
│ │ ├── plugins/
│ │ ├── themes/
│ │ └── uploads/
│ ├── index.php
│ └── wp-config.php
├── .env .env.example
├── composer.json composer.lock
└── wp-cli.yml
config/application.phpturns the.envvariables into WordPress constants. You should not need to modify it.config/extensions.phplists the Simply extensions to load, as paths relative toweb/content/mu-plugins/(for example/simply-maker/entrypoint.php).web/content/mu-plugins/load.phploads the framework, then every extension listed inconfig/extensions.php.
Install in an existing WordPress
Without the boilerplate, you get the framework only: no .env configuration, no bin/console nor code generators.
- Download the latest release of the framework.
- Unzip it into your
mu-pluginsdirectory and rename the directory tosimply-framework. - Run
composer install --no-devin thesimply-frameworkdirectory: the framework loads its ownvendor/when it exists. - Create a PHP file at the root of the
mu-pluginsdirectory to load it:
wp-content/mu-plugins/load.php
<?php
/*
* Plugin Name: Load Simply framework
*/
require __DIR__ . '/simply-framework/simply-framework.php';
mu-plugins
├── simply-framework/
└── load.php
There is no project composer.json in this setup: give each plugin or theme its own Composer autoloader (a composer.json with an autoload.psr-4 entry for src/, then composer dump-autoload), and require its vendor/autoload.php before calling Simply::registerPlugin().