PHPackages                             lambry/batchpress - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. lambry/batchpress

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

lambry/batchpress
=================

WordPress plugin to help process data in batches.

0.4.2(3y ago)59GPL-2.0-or-laterPHPPHP &gt;=7.4

Since Feb 26Pushed 3y ago2 watchersCompare

[ Source](https://github.com/lambry/batchpress)[ Packagist](https://packagist.org/packages/lambry/batchpress)[ Docs](https://github.com/lambry/batchpress)[ RSS](/packages/lambry-batchpress/feed)WikiDiscussions master Synced 1w ago

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

BatchPress
==========

[](#batchpress)

BatchPress is a little plugin to help process data in batches, with BatchPress you can run, monitor and cancel batched jobs.

Install: `composer require lambry/batchpress`

[![screenshot](screenshot.png)](screenshot.png)

Usage
-----

[](#usage)

To use BatchPress create a new class per job and register those classes using the `batchpress/jobs` filter.

Job class outline:

- Required: `label` property to describe the job.
- Required: `process` method which is passed a single item for processing; any info/errors can be returned and will be displayed in the log.
- Optional|Required: `items` method is optional if the upload property is set to true, in this case it can be used to filter the uploaded content before staring the job. If upload if false or not defined the method is then required to return an array of items for processing.
- Optional: `upload` property to tell BatchPress if a CSV upload is required.
- Optional: `batch` property to set the number of items to process per batch.
- Optional: `description` property to provide extra details about the job.

Basic Example
-------------

[](#basic-example)

```
class Update {
  public $batch = 10;
  public $label = 'Update data';

  // Prepare an array of items for processing
  public function items() : array { }

  // Process each item and optionally return log info
  public function process($item) : mixed { }
}
```

Example with CSV upload
-----------------------

[](#example-with-csv-upload)

```
class Import {
  public $batch = 10;
  public $upload = true;
  public $label = 'Import data';

  // Optionally filter and format the uploaded content before processing
  public function items(array $data) : array { }

  // Process each item and optionally return log info
  public function process($item) : mixed { }
}
```

Registering jobs
----------------

[](#registering-jobs)

```
add_filter('batchpress/jobs', fn() => [Update::class, Import::class]);
```

Helpers
-------

[](#helpers)

BatchPress provides some helper methods as well, to use them just include the `Helpers` trait in your job class.

```
use Lambry\BatchPress\Helpers;

class Update {
  use Helpers;

  public function process($item) : mixed {
    // Adding an image to a post
    $id = this->uploadImage($item['url'], $item['id'], $item['title']);
    // Adding a file to a post
    $id = this->uploadFile($item['url'], $item['id'], $item['title']);
  }
}
```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

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

Total

3

Last Release

1221d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1dcafc214bf8026968a6d87387ede6dd60ce57cd8b344f4c276efed4b9eff076?d=identicon)[lambry](/maintainers/lambry)

---

Top Contributors

[![lambry](https://avatars.githubusercontent.com/u/287178?v=4)](https://github.com/lambry "lambry (16 commits)")

---

Tags

pluginwordpresspluginwordpress

### Embed Badge

![Health badge](/badges/lambry-batchpress/health.svg)

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

###  Alternatives

[roots/bedrock

WordPress boilerplate with Composer, easier configuration, and an improved folder structure

6.6k471.6k2](/packages/roots-bedrock)[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.6k10](/packages/helsingborg-stad-municipio)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

20256.6k4](/packages/civicrm-civicrm-drupal-8)

PHPackages © 2026

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