Skip to content
🔟% Faster WordPress ⚡️ without unconditional class loading + Composer
Shell PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
bin
examples/johnpbloch-wordpress
.gitignore
.travis.yml
LICENSE
README.md
composer.json

README.md

WordPress Autoloaded

This is a boilerplate to start a fast WordPress website without unconditional class loading using Composer.

Core is downloaded from the official ZIP and unconditional class loading is commented out.

Usage

  • Clone this repository
  • Optionally use johnpbloch/wordpress package instead of the included official ZIP, see composer.json in examples/johnpbloch-wordpress/ directory
  • Add plugins e.g. composer require wpackagist-plugin/wordpress-seo
  • Add your theme
  • Prefer class autoloading in theme and plugins, simply add the following to composer.json
    "autoload": {
        "psr-4": {
            "MyNamespace\\": "inc/"
        }
    },
    "config": {
        "classmap-authoritative": true
    }

Configuring WordPress

Add Composer autoloader to app/wp-config.php

require_once dirname( __DIR__ ) . '/vendor/autoload.php';
You can’t perform that action at this time.