https://github.com/szepeviktor/wordpress-autoloaded
:keycap_ten:% Faster WordPress :zap: without unconditional class loading + Composer
https://github.com/szepeviktor/wordpress-autoloaded
autoloading composer performance wordpress
Last synced: 8 days ago
JSON representation
:keycap_ten:% Faster WordPress :zap: without unconditional class loading + Composer
- Host: GitHub
- URL: https://github.com/szepeviktor/wordpress-autoloaded
- Owner: szepeviktor
- License: mit
- Created: 2019-02-23T13:27:03.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-09T05:37:24.000Z (about 2 years ago)
- Last Synced: 2025-04-23T03:18:52.022Z (8 days ago)
- Topics: autoloading, composer, performance, wordpress
- Language: Shell
- Homepage: https://core.trac.wordpress.org/ticket/36335
- Size: 17.6 KB
- Stars: 30
- Watchers: 5
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WordPress Autoloaded
A boilerplate to start a fast WordPress website
without unconditional class loading using Composer autoloader.Core is downloaded from the [official ZIP](https://wordpress.org/download/releases/)
and unconditional class loading is commented out.:bulb: Please also see [szepeviktor/composer-managed-wordpress](https://github.com/szepeviktor/composer-managed-wordpress)
## Support my work
Please consider sponsoring me monthly if you use my packages in an agency.
[](https://github.com/sponsors/szepeviktor)
## Usage
- Clone [this repository](https://github.com/szepeviktor/wordpress-autoloaded)
- 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```json
"autoload": {
"psr-4": {
"MyNamespace\\": "inc/"
}
},
"config": {
"classmap-authoritative": true
}
```## Configuring WordPress
Add Composer autoloader to `app/wp-config.php`
```php
require_once dirname(__DIR__) . '/vendor/autoload.php';
```