PHPackages                             rwsite/wp-queue - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. rwsite/wp-queue

ActiveWordpress-plugin[Queues &amp; Workers](/categories/queues)

rwsite/wp-queue
===============

Background job processing and WP-Cron management for WordPress

1.1.0(5mo ago)301GPL-2.0-or-laterPHPPHP &gt;=8.3CI passing

Since Dec 3Pushed 5mo agoCompare

[ Source](https://github.com/tikhomirov/wp-queue)[ Packagist](https://packagist.org/packages/rwsite/wp-queue)[ Docs](https://github.com/rwsite/wp-queue)[ RSS](/packages/rwsite-wp-queue/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

 [![WP Queue Logo](assets/images/logo.svg)](assets/images/logo.svg)

WP Queue
========

[](#wp-queue)

 **Laravel Horizon-like queue manager for WordPress**
 Simple, powerful, and modern background job processing.

 [![Latest Version](https://camo.githubusercontent.com/9d8bd1587ed3ae4fe50db9e162fcef0cb122da1d83c6b85cf71b4e1ff594f80f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7277736974652f77702d71756575652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rwsite/wp-queue) [![PHP Version](https://camo.githubusercontent.com/4d196b1eb3bfb2e0e2d5d6662f60f286ab1f352a057a09056fd1bdee495a9aae/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7277736974652f77702d71756575652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rwsite/wp-queue) [![Build Status](https://camo.githubusercontent.com/3676160451cf42375139faa912f107f16122737d31660be74ec5dc540c0623f8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7277736974652f77702d71756575652f74657374732e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265)](https://github.com/rwsite/wp-queue/actions) [![Code Coverage](https://camo.githubusercontent.com/93adfed115c665dcf24724ff019316d9dbffc784b6aa39dce038897489b2ac69/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f7277736974652f77702d71756575653f7374796c653d666c61742d737175617265)](https://codecov.io/gh/rwsite/wp-queue) [![License](https://camo.githubusercontent.com/66b4b0c87d7aa0841ad531439e11f69b4ce2bb23c8a7f3f456721c26a4e8c803/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d47504c2d2d322e302d2d6f722d2d6c617465722d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE)

 [Features](#features) • [Installation](#installation) • [Quick Start](#quick-start) • [Admin UI](#admin-ui) • [REST API](#rest-api) • [Testing](#testing) • [RU version](README.ru.md)

---

Features
--------

[](#features)

- 🚀 **Laravel-style API** — Clean, fluent job dispatching with PHP 8 attributes
- 📦 **Multiple Drivers** — Database, Redis, Memcached, Sync (auto-detection)
- 🔄 **Auto Retries** — Exponential backoff for failed jobs
- ⏰ **Scheduling** — Cron-like job scheduling
- 👁️ **WP-Cron Monitor** — View, run, pause, resume, edit cron events
- 📊 **Dashboard** — Beautiful admin UI with statistics
- 🔌 **REST API** — Full API for integrations
- 💻 **WP-CLI** — Complete command-line interface
- 🌍 **i18n Ready** — Translations included (Russian)

Requirements
------------

[](#requirements)

- PHP 8.3+
- WordPress 6.0+

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

[](#installation)

1. Clone or download to `wp-content/plugins/wp-queue`
2. Run `composer install`
3. Activate the plugin

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

[](#quick-start)

### Create a Job

[](#create-a-job)

```
use WPQueue\Jobs\Job;
use WPQueue\Attributes\{Schedule, Queue, Timeout, Retries};

#[Schedule('hourly')]
#[Queue('imports')]
#[Timeout(120)]
#[Retries(5)]
class ImportProductsJob extends Job
{
    public function __construct(
        private array $productIds
    ) {
        parent::__construct();
    }

    public function handle(): void
    {
        foreach ($this->productIds as $id) {
            // Import logic here
        }
    }

    public function failed(\Throwable $e): void
    {
        // Handle failure
        error_log('Import failed: ' . $e->getMessage());
    }
}
```

### Dispatch Jobs

[](#dispatch-jobs)

```
use WPQueue\WPQueue;

// Dispatch to queue
WPQueue::dispatch(new ImportProductsJob([1, 2, 3]));

// With delay (seconds)
WPQueue::dispatch(new ImportProductsJob($ids))->delay(60);

// To specific queue
WPQueue::dispatch(new ImportProductsJob($ids))->onQueue('high-priority');

// Synchronous (bypass queue)
WPQueue::dispatchSync(new ImportProductsJob($ids));

// Chain jobs
WPQueue::chain([
    new FetchProductsJob(),
    new ImportProductsJob($ids),
    new NotifyAdminJob(),
])->dispatch();

// Batch jobs
WPQueue::batch([
    new ImportProductJob($id1),
    new ImportProductJob($id2),
    new ImportProductJob($id3),
])->dispatch();
```

### Schedule Jobs

[](#schedule-jobs)

```
// In your plugin
add_action('wp_queue_schedule', function ($scheduler) {
    // Using attributes (automatic)
    $scheduler->job(ImportProductsJob::class);

    // Manual scheduling
    $scheduler->job(CleanupJob::class)->daily();

    // Custom interval
    $scheduler->job(CheckStopListJob::class)->everyMinutes(15);

    // Conditional
    $scheduler->job(SyncJob::class)
        ->hourly()
        ->when(fn() => get_option('sync_enabled'));

    // From settings
    $scheduler->job(BackupJob::class)
        ->interval(get_option('backup_interval', 'daily'));

    // One-time execution (at specific timestamp)
    $scheduler->job(OneTimeJob::class)->at(time() + 3600);
});
```

PHP 8 Attributes
----------------

[](#php-8-attributes)

### `#[Schedule]`

[](#schedule)

```
#[Schedule('hourly')]                    // Fixed interval
#[Schedule('daily', setting: 'my_opt')]  // From wp_options
```

Available intervals: `min`, `5min`, `10min`, `15min`, `30min`, `hourly`, `2hourly`, `3hourly`, `6hourly`, `8hourly`, `12hourly`, `daily`, `twicedaily`, `weekly`

### `#[Queue]`

[](#queue)

```
#[Queue('default')]    // Queue name
#[Queue('high')]       // Priority queue
```

### `#[Timeout]`

[](#timeout)

```
#[Timeout(60)]   // 60 seconds
#[Timeout(300)]  // 5 minutes
```

### `#[Retries]`

[](#retries)

```
#[Retries(3)]   // Max 3 attempts
#[Retries(5)]   // Max 5 attempts
```

### `#[UniqueJob]`

[](#uniquejob)

```
#[UniqueJob]           // Prevent duplicate jobs
#[UniqueJob(key: 'custom_key')]
```

Events (Hooks)
--------------

[](#events-hooks)

```
// Before job execution
add_action('wp_queue_job_processing', function($event) {
    // $event->job, $event->queue
});

// After successful execution
add_action('wp_queue_job_processed', function($event) {
    // $event->job, $event->queue
});

// On failure
add_action('wp_queue_job_failed', function($event) {
    // $event->job, $event->queue, $event->exception
});

// On retry
add_action('wp_queue_job_retrying', function($event) {
    // $event->job, $event->queue, $event->attempt, $event->exception
});
```

Queue Management
----------------

[](#queue-management)

```
use WPQueue\WPQueue;

// Check status
WPQueue::isProcessing('default');   // bool
WPQueue::isPaused('default');       // bool
WPQueue::queueSize('default');      // int

// Control
WPQueue::pause('default');
WPQueue::resume('default');
WPQueue::cancel('default');   // Clear + pause
WPQueue::clear('default');    // Remove all jobs

// Logs
WPQueue::logs()->recent(100);
WPQueue::logs()->failed();
WPQueue::logs()->forJob(ImportProductsJob::class);
WPQueue::logs()->metrics();
WPQueue::logs()->clearOld(7);  // Clear logs older than 7 days
```

Admin UI
--------

[](#admin-ui)

Access via **WP Admin → WP Queue**

### Tabs

[](#tabs)

TabDescription**Dashboard**Stats (pending, running, completed, failed), queue management**Scheduled Jobs**WP Queue jobs with "Run Now" button**Logs**Execution history with filtering**WP-Cron**All WordPress cron events monitoring**System**Environment status and health check### WP-Cron Monitor

[](#wp-cron-monitor)

View and manage all WordPress cron events:

- Filter by source (WordPress, WooCommerce, Plugins, WP Queue)
- See overdue events
- Run events manually
- Delete scheduled events
- View registered schedules

### System Status

[](#system-status)

Health check and environment info:

- PHP/WordPress versions
- Memory limit and usage
- WP-Cron status (disabled/alternate)
- Loopback request check
- Action Scheduler stats (if installed)
- Timezone and time info

REST API
--------

[](#rest-api)

```
GET    /wp-json/wp-queue/v1/queues
POST   /wp-json/wp-queue/v1/queues/{queue}/pause
POST   /wp-json/wp-queue/v1/queues/{queue}/resume
POST   /wp-json/wp-queue/v1/queues/{queue}/clear
POST   /wp-json/wp-queue/v1/jobs/{job}/run
GET    /wp-json/wp-queue/v1/logs
POST   /wp-json/wp-queue/v1/logs/clear
GET    /wp-json/wp-queue/v1/metrics

# Cron & System
GET    /wp-json/wp-queue/v1/cron
POST   /wp-json/wp-queue/v1/cron/run
POST   /wp-json/wp-queue/v1/cron/delete
GET    /wp-json/wp-queue/v1/system
```

Queue Drivers
-------------

[](#queue-drivers)

WP Queue supports multiple storage backends:

DriverDescriptionRequirements`database`Uses wp\_options table (default)None`redis`Redis serverphpredis extension`memcached`Memcached servermemcached extension`sync`Synchronous executionNone`auto`Auto-detect best availableNone### Configuration

[](#configuration)

Add to `wp-config.php`:

```
// Select queue driver
define('WP_QUEUE_DRIVER', 'redis'); // or 'memcached', 'database', 'sync', 'auto'

// Redis settings (compatible with redis-cache plugin)
define('WP_REDIS_HOST', 'redis');      // or '127.0.0.1'
define('WP_REDIS_PORT', '6379');
define('WP_REDIS_PREFIX', 'mysite_');  // optional
define('WP_REDIS_PASSWORD', 'secret'); // optional
define('WP_REDIS_DATABASE', 0);        // optional, 0-15

// Memcached settings
define('WP_MEMCACHED_HOST', '127.0.0.1');
define('WP_MEMCACHED_PORT', 11211);
```

### Programmatic Configuration

[](#programmatic-configuration)

```
use WPQueue\WPQueue;
use WPQueue\Contracts\QueueInterface;

// Set driver programmatically
WPQueue::manager()->setDefaultDriver('redis');

// Check available drivers
$drivers = WPQueue::manager()->getAvailableDrivers();
// ['database' => ['available' => true, 'info' => '...'], ...]

// Check if specific driver is available
if (WPQueue::manager()->isDriverAvailable('redis')) {
    WPQueue::manager()->setDefaultDriver('redis');
}

// Register custom driver
WPQueue::manager()->extend('sqs', function() {
    return new SqsQueue(['region' => 'us-east-1']);
});
```

### Redis with redis-cache Plugin

[](#redis-with-redis-cache-plugin)

If you use [Redis Object Cache](https://github.com/rhubarbgroup/redis-cache) plugin, WP Queue will automatically use the same Redis connection settings. No additional configuration needed!

```
// These constants from redis-cache are automatically used:
// WP_REDIS_HOST, WP_REDIS_PORT, WP_REDIS_PASSWORD, WP_REDIS_DATABASE
// WP_REDIS_PREFIX, WP_REDIS_SCHEME, WP_REDIS_PATH, WP_REDIS_TIMEOUT
```

Migration from Action Scheduler
-------------------------------

[](#migration-from-action-scheduler)

### Before (Action Scheduler)

[](#before-action-scheduler)

```
as_schedule_recurring_action(time(), HOUR_IN_SECONDS, 'my_hourly_task');

add_action('my_hourly_task', function() {
    // task code
});
```

### After (WP Queue)

[](#after-wp-queue)

```
#[Schedule('hourly')]
class MyHourlyTask extends Job
{
    public function handle(): void
    {
        // task code
    }
}

// Register
add_action('wp_queue_schedule', fn($s) => $s->job(MyHourlyTask::class));
```

Comparison with Action Scheduler
--------------------------------

[](#comparison-with-action-scheduler)

FeatureAction SchedulerWP QueueDatabase2 custom tableswp\_optionsAPI20+ functions1 facadePHP version7.4+8.3+RegistrationManualAttributesRetry logicComplex`#[Retries(3)]`UIBuilt-inBuilt-inFile count50+~15Testing
-------

[](#testing)

WP Queue uses a CI-first testing approach with comprehensive test coverage.

### Unit Tests (Local)

[](#unit-tests-local)

Fast isolated tests without WordPress environment:

```
composer test:unit
```

**Results:** 69 tests, 130 assertions ✅

### E2E Tests (GitHub Actions)

[](#e2e-tests-github-actions)

Integration tests with real WordPress run automatically in CI:

- ✅ WordPress latest (6.7+) + PHP 8.3
- ✅ WordPress 6.7 + PHP 8.3

E2E tests run on every push to `main`/`develop` branches and in pull requests.

### Code Quality

[](#code-quality)

```
# Code style check
composer lint

# Run all tests
composer test
```

**Note:** Code coverage requires PCOV or Xdebug extension. In Docker environments, use:

```
docker exec wp_site-php composer lint
docker exec wp_site-php composer test:unit
```

See: [tests/README.md](tests/README.md)

Example Plugin
--------------

[](#example-plugin)

See a complete working example: **[wp-queue-example-plugin](https://github.com/rwsite/wp-queue-example-plugin)**

The example plugin demonstrates:

- ✅ Creating custom jobs with PHP 8 attributes
- ✅ Job scheduling with different intervals
- ✅ Error handling and retries
- ✅ Chain and batch processing
- ✅ Queue management and monitoring
- ✅ REST API integration
- ✅ WP-CLI commands

Perfect for learning how to integrate WP Queue into your WordPress plugins!

License
-------

[](#license)

GPL-2.0-or-later

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance71

Regular maintenance activity

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

Every ~2 days

Total

2

Last Release

163d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3be160e119825aea7f9813b3863745ecf64c15f2e9aa0e1efedbf423a2dccbf2?d=identicon)[tikhomirov](/maintainers/tikhomirov)

---

Top Contributors

[![tikhomirov](https://avatars.githubusercontent.com/u/19173833?v=4)](https://github.com/tikhomirov "tikhomirov (17 commits)")

---

Tags

plugins-wordpresswordpressschedulerwordpressqueuecronjobswp-cronbackground processing

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/rwsite-wp-queue/health.svg)

```
[![Health](https://phpackages.com/badges/rwsite-wp-queue/health.svg)](https://phpackages.com/packages/rwsite-wp-queue)
```

###  Alternatives

[jms/job-queue-bundle

Allows to run and schedule Symfony console commands as background jobs.

3462.3M5](/packages/jms-job-queue-bundle)[orisai/scheduler

Cron job scheduler - with locks, parallelism and more

4037.1k4](/packages/orisai-scheduler)[aboutcoders/job-bundle

A symfony bundle for asynchronous job processing.

2618.0k1](/packages/aboutcoders-job-bundle)[chh/kue

A simple interface to multiple job queue implemenations

194.4k](/packages/chh-kue)[deliciousbrains/wp-image-processing-queue

Resize WordPress images in the background

2061.4k](/packages/deliciousbrains-wp-image-processing-queue)[bvdputte/kirby-queue

A simple queue utility plugin for Kirby 3. It enables workers in Kirby that can do tasks (in the background) at scheduled intervals (cron) by working through queues of jobs.

314.6k](/packages/bvdputte-kirby-queue)

PHPackages © 2026

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