PHPackages                             schlessera/composer-wp-autoload - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. schlessera/composer-wp-autoload

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

schlessera/composer-wp-autoload
===============================

WordPress Core Autoloader for Composer.

v1.0.0(9y ago)11291[2 issues](https://github.com/schlessera/composer-wp-autoload/issues)MITPHP

Since Aug 30Pushed 9y ago3 watchersCompare

[ Source](https://github.com/schlessera/composer-wp-autoload)[ Packagist](https://packagist.org/packages/schlessera/composer-wp-autoload)[ RSS](/packages/schlessera-composer-wp-autoload/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

WordPress Core Autoloader for Composer
======================================

[](#wordpress-core-autoloader-for-composer)

This is a custom autoloader generator and class map loader Composer plugin for WordPress Core.

It diverges from the default Composer autoloader setup in the following ways:

- The generated autoloader is compatible with PHP 5.2. Classes containing PHP 5.3+ code will be skipped and throw warnings.
- The paths to the classes are relative to a set constant. The default constant being used is `ABSPATH`.
- The class maps can optionally be configured to be case-insensitive.

Usage
-----

[](#usage)

In your project's `composer.json`, add the following lines:

```
{
    "require": {
        "schlessera/composer-wp-autoload": "^1"
    },
    "scripts": {
        "post-install-cmd": [
            "WordPress\\ComposerAutoload\\Generator::dump"
        ],
        "post-update-cmd": [
            "WordPress\\ComposerAutoload\\Generator::dump"
        ],
        "post-autoload-dump": [
            "WordPress\\ComposerAutoload\\Generator::dump"
        ]
    },
    "extra": {
        "wordpress-autoloader": {
            "class-root": "ABSPATH",
            "case-sensitive": true
        },
    }
}
```

After the next update/install, you will have a `vendor/autoload_wordpress.php` file, that you can simply include and use to autoload classes within WordPress Core.

Valid "extra" Keys
------------------

[](#valid-extra-keys)

You can configure the autoloader by providing `"extra"` keys under the `"wordpress-autoloader"` root key.

- **`"class-root"`** :

    String value that is used to replace the `dirname($vendorDir)` string. The default is `"ABSPATH"`, to make the autoloader use the `ABSPATH` constant.
- **`"case-sensitive"`**:

    Boolean value to configure whether the classmap loader should be case-sensitive or not. The default value is `true`.

Contributing
------------

[](#contributing)

All feedback / bug reports / pull requests are welcome.

License
-------

[](#license)

This code is released under the MIT license.

For the full copyright and license information, please view the [`LICENSE`](LICENSE) file distributed with this source code.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3590d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6dde7f578e5530884238e7173f768ae3a890b6d66eb99262a82f2c494a1b67d4?d=identicon)[schlessera](/maintainers/schlessera)

---

Top Contributors

[![schlessera](https://avatars.githubusercontent.com/u/83631?v=4)](https://github.com/schlessera "schlessera (3 commits)")

---

Tags

hacktoberfest

### Embed Badge

![Health badge](/badges/schlessera-composer-wp-autoload/health.svg)

```
[![Health](https://phpackages.com/badges/schlessera-composer-wp-autoload/health.svg)](https://phpackages.com/packages/schlessera-composer-wp-autoload)
```

###  Alternatives

[tanmuhittin/nova-scroll-top

On route change scrolls to the top

22219.3k](/packages/tanmuhittin-nova-scroll-top)[myparcelnl/magento

A Magento 2 module that creates MyParcel labels

1859.0k](/packages/myparcelnl-magento)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
