offsetwp / project-skeleton
A WordPress project on the OffsetWP framework: core and extensions installed by Composer, configuration read from .env, and the kernel booted from a mu-plugin
Package info
github.com/offsetwp/project-skeleton
Type:project
pkg:composer/offsetwp/project-skeleton
Requires
- php: ^8.5
- composer/installers: ^2.3
- offsetwp/framework: ^1.1
- offsetwp/hook-bundle: ^1.0
- roots/wordpress: ^7.1
- symfony/dotenv: ^8.1
- symfony/filesystem: ^8.1
Requires (Dev)
- symfony/var-dumper: ^8.1
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-12-01 11:12:38 UTC
README
OffsetWP Project Skeleton
A WordPress project on the OffsetWP framework, ready to be configured.
- 📦 WordPress installed by Composer
- 🔌 Plugins and themes from the WordPress.org directory, through WP Packages
- 🔐 Configuration read from
.env - 🧩 The OffsetWP kernel booted from a mu-plugin
- 🛠️ WordPress commands with
wp-cli
Requirements
- PHP 8.5+
- Composer 2
Installation
Step 1 : Creating a project
composer create-project offsetwp/project-skeleton my-project cd my-project cp .env.example .env php bin/wp-cli app salts generate --file=.env # a fresh set of keys and salts
Step 2 : Adding a theme
You can add offsetwp/starter-theme:
composer create-project offsetwp/starter-theme public/app/themes/my-theme nvm use && npm install && npm run build # see https://github.com/offsetwp/starter-theme
Or a theme from WordPress.org:
composer require wp-theme/twentytwentyfive
# then, in .env: WP_DEFAULT_THEME='twentytwentyfive'
Step 3 : Setup the server
Use offsetwp/local-environment, or your own server (Docker, MAMP, DDEV…): see Custom local environment.
offsetwp/local-environment
composer require --dev offsetwp/local-environment
vendor/bin/local-environment up
# see https://github.com/offsetwp/local-environment
Step 4 : Installing WordPress
With offsetwp/local-environment:
vendor/bin/local-environment wp core install --url=http://localhost --title="My project" \ --admin_user=admin --admin_password='change-me' --admin_email=admin@example.com
With your own server, --url set to WP_HOME:
php bin/wp-cli core install --url=http://localhost:8888 --title="My project" \ --admin_user=admin --admin_password='change-me' --admin_email=admin@example.com
Custom local environment
Point the web server at public/, and set WP_HOME and DB_* in .env. On Apache, copy public/.htaccess.example to public/.htaccess before wp core install, for pretty permalinks.
MAMP+, with PHP and Apache:
# .env WP_HOME='http://localhost:8888' # or the host MAMP gives the site DB_HOST='localhost:/Applications/MAMP/tmp/mysql/mysql.sock' DB_USERNAME='root' DB_PASSWORD='root'
cp public/.htaccess.example public/.htaccess php bin/wp-cli db create php bin/wp-cli core install --url=http://localhost:8888 --title="My project" \ --admin_user=admin --admin_password='change-me' --admin_email=admin@example.com
DDEV, which brings PHP and Composer. The php project type keeps DDEV from writing its own wp-config.php:
mkdir my-project && cd my-project ddev config --project-type=php --docroot=public --php-version=8.5 ddev composer create-project offsetwp/project-skeleton cp .env.example .env ddev exec php bin/wp-cli app salts generate --file=.env
# .env WP_HOME='https://my-project.ddev.site' DB_HOST='db' DB_DATABASE='db' DB_USERNAME='db' DB_PASSWORD='db'
ddev start ddev exec php bin/wp-cli core install --url=https://my-project.ddev.site --title="My project" \ --admin_user=admin --admin_password='change-me' --admin_email=admin@example.com
Environment configuration
config/wp-config.php reads every value from .env. .env.example holds the defaults, and the values each one accepts:
| Variable | Sets |
|---|---|
WP_HOME |
WP_HOME. WP_SITEURL is WP_HOME/wp, WP_CONTENT_URL is WP_HOME/app |
WP_ENVIRONMENT_TYPE |
WP_ENVIRONMENT_TYPE, which the kernel follows |
WP_DEBUG |
WP_DEBUG, which the kernel follows |
DB_HOST, DB_DATABASE, DB_USERNAME, DB_PASSWORD |
DB_HOST, DB_NAME, DB_USER, DB_PASSWORD |
DB_PREFIX |
$table_prefix |
AUTH_KEY … NONCE_SALT |
the keys and salts of the same names |
WP_CAN_AUTOMATIC_UPDATE |
AUTOMATIC_UPDATER_DISABLED, inverted |
WP_CAN_EDIT_FILE |
DISALLOW_FILE_EDIT, inverted |
WP_CAN_EDIT_MODS |
DISALLOW_FILE_MODS, inverted |
WP_POST_REVISIONS |
WP_POST_REVISIONS: 0 keeps none, -1 keeps them all. Unset, WordPress keeps them all |
WP_CACHE |
WP_CACHE |
WP_DEFAULT_THEME |
WP_DEFAULT_THEME, the theme wp core install activates. Unset, WordPress's own |
The WP_CAN_* default to false: Composer owns the core and the extensions.
Each environment has its own keys and salts: php bin/wp-cli app salts generate --file=.env writes them, or prints them without --file. New keys log every user out.
Install, update and remove plugins and themes
Install plugins and themes from WordPress.org with Composer, through WP Packages, as wp-plugin/<slug> or wp-theme/<slug>:
# https://wordpress.org/plugins/advanced-custom-fields/ composer require wp-plugin/advanced-custom-fields # install composer update wp-plugin/advanced-custom-fields # update composer remove wp-plugin/advanced-custom-fields # remove # https://wordpress.org/themes/twentytwentyfive/ composer require wp-theme/twentytwentyfive
The WordPress core too:
composer update roots/wordpress
A mu-plugin installed by Composer lands in public/app/mu-plugins/<name>/: require its main file from app.php.
Themes
The skeleton ships no theme: the front end stays blank until one is active.
composer require wp-theme/twentytwentyfive php bin/wp-cli theme activate twentytwentyfive
Or set WP_DEFAULT_THEME in .env before wp core install.
Your own theme goes in public/app/themes/, which .gitignore ignores. Un-ignore its folder (the starter theme does it on install):
/public/app/themes/* !/public/app/themes/my-theme/
Cache
The kernel and its bundles keep what they build in var/cache/<environment>.
php bin/wp-cli app cache clear # empties var/cache/<environment>
var/ is never versioned.
Commands with wp-cli
The project adds:
php bin/wp-cli app cache clear # empties var/cache/<environment> php bin/wp-cli app salts generate # see fresh keys and salts php bin/wp-cli app salts generate --file=.env # writes fresh keys and salts to .env
For every other command, see the wp-cli documentation:
php bin/wp-cli plugin list
php bin/wp-cli language core install fr_FR --activate
php bin/wp-cli cli update # updates bin/wp-cli itself
With offsetwp/local-environment, vendor/bin/local-environment wp … runs it in the PHP container; php bin/wp-cli works too.
wp-cli.local.yml sets path: public/wp, and disables the commands Composer owns (core download, plugin install…) and db drop, db clean, db reset.
Adding a command
A command is a service under app/, registered on cli_init: it is only built when wp-cli runs. For example, app/Command/CacheCommand.php:
#[AsHookHandler] final class CacheCommand { public function __construct( #[Autowire( '%kernel.build_dir%' )] private readonly string $build_dir, ) { } #[AsAction( 'cli_init' )] private function register(): void { WP_CLI::add_command( 'app cache', $this ); } /** * Empties the cache of the application. */ public function clear(): void { // … } }
Making your own skeleton
Fork this repository, change name in composer.json, add your plugins, theme and configuration, then publish it on Packagist or a private Composer repository. Your developers start from it:
composer create-project my-company/project-skeleton my-project

