szepeviktor / wordpress-autoloaded

:keycap_ten:% Faster WordPress :zap: without unconditional class loading + Composer

Home Page:https://core.trac.wordpress.org/ticket/36335

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WordPress Autoloaded

A boilerplate to start a fast WordPress website without unconditional class loading using Composer autoloader.

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

đź’ˇ Please also see szepeviktor/composer-managed-wordpress

Support my work

Please consider sponsoring me monthly if you use my packages in an agency.

Sponsor

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';

About

:keycap_ten:% Faster WordPress :zap: without unconditional class loading + Composer

https://core.trac.wordpress.org/ticket/36335

License:MIT License


Languages

Language:Shell 84.0%Language:PHP 16.0%