← Назад до новин

Meet the Traffman PHP SDK – and WordPress plugin 2.0, the first integration built on it

Опубліковано: 12 лист. 2026 р., 15:00

Traffman now has its own PHP SDK – the official traffman/sdk-php package, version 1.0.0, released under the MIT license. Together with it comes version 2.0 of the WordPress plugin, the first integration that talks to the API through the SDK instead of its own code.

What the SDK does

Joining the content traffic exchange network takes more than one request. A client (website) goes through confirmation by webhook, pushes the content it shares and keeps it in sync, fetches targeted content for its visitors, signs every block and every redirect, and handles the errors in between. Until now each integration had to implement all of that itself. The SDK does it once:

  • Client – confirmation, client info and subscription, dashboard, exchange settings.
  • Content – pushing in batches of any size, the pushed IDs, statistics, targeted content.
  • Webhooks – ready handlers for the client confirmation and the connection health check.
  • Content blocks – the signed script URL and the redirect signatures.
  • Errors – a typed exception for every case, from a network timeout to a validation error with its violations.
  • Middleware – retries, caching, logging, extra headers.

Who it is for

The SDK is for developers who connect a PHP site or platform to Traffman: a module for a CMS, a package for a framework such as Laravel or Symfony, an extension for an e-commerce platform, or simply your own website. It needs PHP 8.1 or later with ext-json and nothing else at runtime.

It does not tie you to an HTTP library. Requests go through any PSR-18 client (Guzzle, Symfony HttpClient and others) or the built-in cURL transport, and a transport for your platform's own HTTP layer takes about 20 lines – the repository has a WordPress example built on wp_remote_request(). Credentials, cache, clock and visitor IP are interfaces too, so the SDK adapts to the platform rather than the other way round.

Why it speeds up development

With the protocol handled by the SDK, an integration for a new platform is left with what is really its own: where to keep the API key and secret, which content to share, and how the settings look in its admin area. That is far less code to write, and far fewer places to get request signing or the confirmation flow wrong.

Testing is covered as well: MockTransport returns prepared responses and records the requests, so an integration can be tested without a live API. And every fix or new API feature lands in the SDK once – each integration picks it up with a composer update.

WordPress plugin 2.0

The WordPress plugin is the first to make the switch: version 2.0 replaces its own API client with the SDK. For site owners it works as before, with improvements.

Please note: version 2.0 requires PHP 8.1 or higher. Check the PHP version of your site before updating – WordPress will not install the update on an older one.

Get started

composer require traffman/sdk-php
  • PHP SDK on GitHub – the source code and the full usage guide
  • PHP SDK on Packagist
  • Traffman plugin on WordPress.org

Building an integration for a new platform? Let us know – developers who create plugins, modules or packages for Traffman get exclusive benefits, described on the Developers page.

Головна
ОсобливостіЩо вміє TraffmanЯк це працюєКороткий покроковий гайд з підключенняЦіниБезкоштовно назавжди, без прихованих платежівСкачатиОстанні оновлення та релізиРозробникамІнтеграція та підтримка розробниківСпільнотаДолучайтеся до мережі як амбасадор
ДопомогаНовиниРеєстраціяВхід
  • English
  • Polski
  • Русский
  • Українська
Умови користуванняУмови підпискиПравила допустимого використанняПолітика конфіденційностіКонтактGitHubКарта сайту

© 2026 Traffman