PHPackages                             tekod/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. tekod/wp-queue

ActiveLibrary[Queues &amp; Workers](/categories/queues)

tekod/wp-queue
==============

Robust WordPress library for managing queued jobs.

0.1.3(3y ago)03.1k↓33.3%MITPHPPHP &gt;=7.1.0

Since Dec 22Pushed 3y ago1 watchersCompare

[ Source](https://github.com/tekod/WpQueue)[ Packagist](https://packagist.org/packages/tekod/wp-queue)[ Docs](https://gitlab.com/tekod/WpQueue)[ RSS](/packages/tekod-wp-queue/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (4)DependenciesVersions (6)Used By (0)

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![Issues](https://camo.githubusercontent.com/112176f6338baa4a71e2c5b2db5af0e0afc34943f31f59c2cf20b32d7b58ce1e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f74656b6f642f577051756575652e737667)](https://github.com/tekod/WpCacheController/issues)

WpQueue
=======

[](#wpqueue)

By using queue developer can defer the processing of a time-consuming task for later time, and thus drastically speeding up the web requests of your application.

This library is WordPress implementation of AccentPHP's Queue library.

Usage
-----

[](#usage)

For beginning, you must initialize and configure your first queue manager. In this example we will create queue that will dispatch emails. We can give arbitrary name to our queues, let we use "mailer" for this one. Global function "WpQueue" will return instance of queue by its name and create is if it does not exist.
After that we should call "init" method to configure our queue. In this example we will store queued jobs in database using WordPress "wpdb" connection, in table "wp\_wpqueue\_mailer\_jobs". There are many other configuration options, but you can explore them later.

```
$queue = WpQueue('mailer');
$queue->init([
    'Storage' => new \Tekod\WpQueue\Storage\Wpdb($wpdb, 'wpqueue_mailer_jobs'),
]);
```

Now we can add new job into queue, you have to pass name of job and job data. In this example we want to send an email:

```
$queue->add('SendEmail', ['To'=>'me@site.com', 'Body'=>'Hi.']);
```

To register job handler you have to connect job name with callback (callable), just like WordPress hooks. In this example we will register static method for "SendEmail" job:

```
$queue->registerJobHandler('SendEmail', [MyClass::class, 'handle']);
```

Job handler method will receive job-object as parameter. You must execute Job-&gt;setHandled() at the end of your handler to mark job as handled or Job-&gt;setReleased() to mark it as failed. Handled jobs will be removed from queue while failed jobs will be postponed. Example of job handler:

```
public static function handle(Job $job) {
    $data = $job->getData();
    wp_mail($data['To'], 'Subject', $data['Body']);
    $job->setHandled();
}
```

To run your queue you should execute WpQueue::run() and specify what jobs you want to execute and few config options. If you specify parameter only jobs of that name will be executed, otherwise queue will execute all type of jobs.

```
$queue->run();
```

Queue will execute all currently available jobs in loop, but each job can push more jobs into queue, with high or low priority, so execution can be very dynamic.

Note that multiple handlers can be registered on single job name, queue manager will pass job to first handler and if it does not mark it as handled job will be offered to next registered handler. Using this feature you can intercept and take over normal job execution in certain cases, or just monitor and log jobs if you omit to set handled status.

If a job remains unhandled queue will dispatch "orphaned job" wp-action and offer hook listeners to handle it in "catch-all" manner.

If a job remains unhandled after that queue will dispatch "unhandled job" action and delete job if nobody respond.

---

---

Security issues
===============

[](#security-issues)

If you have found a security issue, please contact the author directly at .

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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 ~0 days

Total

4

Last Release

1243d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/602ff9e427232acb63fd7cd90f1051fe590d87d1c53dbc0e70acc25c811cc7b9?d=identicon)[tekod](/maintainers/tekod)

---

Top Contributors

[![fws-miroslav](https://avatars.githubusercontent.com/u/73218473?v=4)](https://github.com/fws-miroslav "fws-miroslav (6 commits)")

---

Tags

wordpressqueuecronwpjobs

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/tekod-wp-queue/health.svg)](https://phpackages.com/packages/tekod-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)[eyewitness/eye

Eyewitness.io client for Laravel 5 applications

116151.8k](/packages/eyewitness-eye)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

3786.5k](/packages/harris21-laravel-fuse)[orisai/scheduler

Cron job scheduler - with locks, parallelism and more

4037.1k4](/packages/orisai-scheduler)[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)
