Shared WordPress and WPGraphQL utilities for AxeWP plugins.
axepress/axewp-common is a PHP library providing reusable base classes, interfaces, and traits used the AxePress suite of WordPress plugins.
- PHP 8.2+
composer require axepress/axewp-common| Class / Trait | Description |
|---|---|
Config |
Hook prefix configuration for plugin integration |
AbstractEncryptor |
Base class for encryption utilities |
AssetLoaderTrait |
CSS/JS asset loading helpers |
AutoloaderTrait |
Custom class autoloading |
Abstracts for registering WPGraphQL types with a consistent API:
Abstracts (src/GraphQL/Abstracts/)
| Abstract | GraphQL Type |
|---|---|
Type |
Base type with registration hooks |
ObjectType |
Object types with fields |
MutationType |
Mutation types |
InputType |
Input types |
EnumType |
Enum types |
UnionType |
Union types |
InterfaceType |
Interface types |
ConnectionType |
Connection types |
FieldsType |
Types with fields |
Interfaces (src/GraphQL/Interfaces/)
GraphQLType, TypeWithFields, TypeWithInputFields, TypeWithInterfaces, TypeWithConnections
Traits (src/GraphQL/Traits/)
TypeNameTrait, TypeResolverTrait
| Interface / Trait | Description |
|---|---|
Registrable |
Interface for classes that register hooks |
Singleton |
Trait implementing the singleton pattern |
# Install the NPM dependencies (using NVM)
nvm use
npm ci
# Install the PHP dependencies (using Composer)
composer install
# Lints
## Prettier
npm run format
## PHPCS
npm run lint:php
npm run lint:php:fix
## PHPStan
npm run lint:php:stan
## TypeScript
npm run lint:js:types# Start the wp-env test environment with Xdebug code coverage enabled
npm run wp-env:test start -- --xdebug=coverage
# Run the PHPUnit tests
npm run test:php