PHPackages                             publishpress/version-loader-generator - 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. publishpress/version-loader-generator

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

publishpress/version-loader-generator
=====================================

Composer script to generate the version loader files for libraries on PubilshPress

1.2.3(10mo ago)0418[1 PRs](https://github.com/publishpress/library-version-loader-generator/pulls)4GPL-2.0-or-laterPHPCI passing

Since Apr 20Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/publishpress/library-version-loader-generator)[ Packagist](https://packagist.org/packages/publishpress/version-loader-generator)[ RSS](/packages/publishpress-version-loader-generator/feed)WikiDiscussions development Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (17)Used By (4)

library-version-loader-generator
================================

[](#library-version-loader-generator)

Script to auto generate scripts and test for libraries on PublishPress.

The script will generate three files in the library:

- `lib/Versions.php`
- `lib/include.php`
- `tests/wpunit/VersionsCest.php`

How to use
----------

[](#how-to-use)

This library should be included in the target library as dev requirement:

```
composer require --dev publishpress/version-loader-generator
```

Once installed it will be available in the `vendor/bin` folder.

Its requires a few settings in the `composer.json` file to correctly generate the files:

```
{
  "extra": {
    "generator": {
      "lib-class-test": "interface_exists('PublishPress\\Psr\\Container\\ContainerInterface')",
      "action-initialize-priority": "-190",
      "action-register-priority": "-200"
    }
  }
}
```

- `lib-class-test`: this is a fragment of PHP code that will check if the target library is loaded or not.
- `action-register-priority`: a negative integer that will be used as the priority of the `plugins_loaded` action for registering the library. The registration should always be done before the initialization.
- `action-intialize-priority`: a negative integer that will be used as the priority of the `plugins_loaded` action for initializing the library. The initialization should always be done before the plugin using the library is initialized.

We advise the plugins using the prefixed libraries to use the `plugins_loaded` action with a priority of `-20` or higher to initialize the plugin instead of initializing it on run time.

Add a composer script to run the generator on every update/install. On the following example we are using Strauss also, to prefix the respective library:

```
{
  "scripts": {
    "strauss": [
      "vendor/bin/strauss"
    ],
    "generate-files": "vendor/bin/version-loader-generator",
    "post-install-cmd": [
      "@strauss",
      "@generate-files"
    ],
    "post-update-cmd": [
      "@strauss",
      "@generate-files"
    ]
  }
}
```

How to test this script
-----------------------

[](#how-to-test-this-script)

```
vendor/bin/codecept run unit
```

How to test target libraries
----------------------------

[](#how-to-test-target-libraries)

Make sure Codeception is properly configured in the target library, for running WPUnit tests.

Add the following composer script to the `composer.json` file:

```
{
  "scripts": {
    "test": "vendor/bin/codecept run wpunit"
  }
}
```

Then you can just run:

```
composer test
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance69

Regular maintenance activity

Popularity16

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.1% 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

Every ~63 days

Recently: every ~205 days

Total

14

Last Release

300d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/407131?v=4)[Anderson Grüdtner Martins](/maintainers/andergmartins)[@andergmartins](https://github.com/andergmartins)

---

Top Contributors

[![andergmartins](https://avatars.githubusercontent.com/u/407131?v=4)](https://github.com/andergmartins "andergmartins (34 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

### Embed Badge

![Health badge](/badges/publishpress-version-loader-generator/health.svg)

```
[![Health](https://phpackages.com/badges/publishpress-version-loader-generator/health.svg)](https://phpackages.com/packages/publishpress-version-loader-generator)
```

###  Alternatives

[snapshotpl/zf-snap-geoip

MaxMind GeoIP Module for Zend Framework 2

1512.9k](/packages/snapshotpl-zf-snap-geoip)

PHPackages © 2026

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