PHPackages                             pollora/ajax - 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. [API Development](/categories/api)
4. /
5. pollora/ajax

ActiveLibrary[API Development](/categories/api)

pollora/ajax
============

A modern PHP package for WordPress AJAX action management with fluent API

v1.0.0(today)012↑2900%GPL-2.0-or-laterPHPPHP ^8.2CI passing

Since Jun 22Pushed todayCompare

[ Source](https://github.com/Pollora/ajax)[ Packagist](https://packagist.org/packages/pollora/ajax)[ RSS](/packages/pollora-ajax/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (4)Versions (2)Used By (0)

Pollora Ajax
============

[](#pollora-ajax)

A modern PHP package for WordPress AJAX action management with a fluent API and secure defaults.

Installation
------------

[](#installation)

```
composer require pollora/ajax
```

Quick Start
-----------

[](#quick-start)

```
use Pollora\Ajax\Ajax;

// Logged-in users only (default — secure by design)
Ajax::listen('my_action', function () {
    wp_send_json_success(['message' => 'It works!']);
});

// All users (explicit opt-in required)
Ajax::listen('public_action', function () {
    // ...
})->forAllUsers();

// Guest users only
Ajax::listen('guest_action', function () {
    // ...
})->forGuestUsers();
```

### With the Pollora Framework

[](#with-the-pollora-framework)

When used inside Pollora, you can also use the `#[Ajax]` PHP attribute for declarative registration:

```
use Pollora\Attributes\Ajax;
use Pollora\Ajax\AjaxAccess;

class NewsletterHandler
{
    #[Ajax('subscribe')]
    public function subscribe(): void
    {
        wp_send_json_success(['message' => 'Subscribed!']);
    }

    #[Ajax('load_more', access: AjaxAccess::ALL)]
    public function loadMore(): void
    {
        wp_send_json_success([/* ... */]);
    }
}
```

Documentation
-------------

[](#documentation)

See [docs/ajax.md](docs/ajax.md) for full documentation.

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

GPL-2.0-or-later

###  Health Score

42

—

FairBetter than 89% of packages

Maintenance100

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

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

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8b45e81c070e2ec0baf59b2a73a216632d76cdfb36c0ab168fd6d043b2c8fbc2?d=identicon)[pollora](/maintainers/pollora)

---

Top Contributors

[![ogorzalka](https://avatars.githubusercontent.com/u/149651?v=4)](https://github.com/ogorzalka "ogorzalka (9 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/pollora-ajax/health.svg)

```
[![Health](https://phpackages.com/badges/pollora-ajax/health.svg)](https://phpackages.com/packages/pollora-ajax)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[botman/driver-telegram

Telegram driver for BotMan

93452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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