Skip to content

AxeWP/axewp-common

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

AxeWP Common

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.

Requirements

  • PHP 8.2+

Installation

composer require axepress/axewp-common

What's Included

Core (src/Core/)

Class / Trait Description
Config Hook prefix configuration for plugin integration
AbstractEncryptor Base class for encryption utilities
AssetLoaderTrait Script, style, and script-module registration
AutoloaderTrait Custom class autoloading
VIPHelpers Wrappers for VIP-only functions, with fallbacks

GraphQL (src/GraphQL/)

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

Contracts (src/Contracts/)

Interface / Trait Description
Registrable Interface for classes that register hooks
Singleton Trait implementing the singleton pattern

Development

See DEVELOPMENT.md for the full setup, standards, and testing guide, and CONTRIBUTING.md before opening a PR.

Quick Start

# 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

Testing

# 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

License

GPL-3.0-or-later

About

Shared PHP classes and functionality for building enterprise-grade plugins for Headless WordPress

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages