Download the PHP package stellarwp/licensing-api-client-wordpress without Composer
On this page you can find all versions of the php package stellarwp/licensing-api-client-wordpress. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download stellarwp/licensing-api-client-wordpress
More information about stellarwp/licensing-api-client-wordpress
Files in stellarwp/licensing-api-client-wordpress
Package licensing-api-client-wordpress
Short Description WordPress transport and factory integration for the Liquid Web Licensing API client.
License GPL-2.0-or-later
Informations about the package licensing-api-client-wordpress
Licensing API Client WordPress
⚠️ This is a read-only repository! For pull requests or issues, see stellarwp/licensing-api-client-monorepo.
WordPress transport and factory integration for the StellarWP Licensing API client.
Installation
Install with composer:
Examples
For end-to-end API cookbook examples, see:
Usage
For a DI52 Provider:
That gives you a base client as a singleton, but resolves the public LicensingClientInterface as a fresh clone with one stable TraceParent applied for the current PHP request.
That is usually what you want for tracing: if one request in your application makes multiple licensing calls, those calls should normally share the same TraceParent so they can be tied together in Axiom as part of the same trace.
[!WARNING] That only works end to end if your own application is also exporting spans to Axiom or another tracing backend. If your application is not instrumented, the licensing request can still carry the propagated
traceparent, but Axiom will not be able to look up the true parent span because it never received it.If an upstream service already gives you a W3C
traceparentheader, parse that into aTraceParentand useTraceContextwhen you also need to preserve inboundtracestate. If you only have a generic correlation ID, do not try to stuff that into aTraceParent; keep it as separate application metadata and generate a newTraceParentlocally for distributed tracing.
DI52 does not provide a built-in request scope, but in a normal short-lived PHP request this singleton is still effectively request-local.
One simple implementation looks like this:
If you are continuing inbound trace headers instead, build a TraceContext from them and apply that to the cloned client:
The important detail is that AuthState is built from Config::configuredToken, so your configured token only lives in one place:
API errors are thrown as exceptions, so catch the specific cases you care about and fall back to ApiErrorExceptionInterface for the rest:
For a public or unauthenticated client without a Container:
For a trusted source with a configured token:
Status
This package is being developed in the monorepo and published as a read-only split repository.