# phpro/mage2-module-scheduler

> Cron Scheduler for Magento 2

`composer require phpro/mage2-module-scheduler`

Canonical URL: https://packagento.com/phpro/mage2-module-scheduler

## At a glance

- **Vendor**: phpro (https://packagento.com/phpro.md)
- **Latest version**: 8.0.2 — released 2023-06-29
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/phpro/mage2-module-scheduler and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require phpro/mage2-module-scheduler:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Cron Scheduler for Magento 2

## README

![](https://github.com/phpro/phpro-mage2-module-scheduler/workflows/.github/workflows/grumphp.yml/badge.svg)

## Cron Scheduler for Magento 2

This module allows merchants and developers to easily view and manage Magento cron jobs in the backend of Magento 2.

### Installation

    composer require phpro/mage2-module-scheduler
    
### How to use
#### Timeline
<img src="https://github.com/phpro/phpro-mage2-module-scheduler/wiki/images/timeline.png" alt="timeline" width="50%" />

A timeline of the Magento jobs can be found under `System / Cron Schedule / Schedule Timeline`.
On this timeline we can easily:

- see when a job executed
- see when a job is successful, these are marked green
- see when a job has failed, these are marked red
- see at what time a job should be executed, these are marked gray

#### Schedule list
<img src="https://github.com/phpro/phpro-mage2-module-scheduler/wiki/images/list.png" alt="list" width="50%" />

The timeline view is very similar to the list view, which we can find under `System / Cron Schedule / Schedule list`. With the schedule list you can easily:

- schedule new jobs (by clicking on the 'Schedule job' button)
- delete jobs (by selecting them and selecting 'Delete' from the actions dropdown)
- filter jobs (ex. filter by cron status)

#### Job Configuration
<img src="https://github.com/phpro/phpro-mage2-module-scheduler/wiki/images/disable.png" alt="list" width="50%" />

We can easily disable cron jobs by using the `System / Cron Schedule / Job Configuration` view from which we can easily select and disable a cron job. Disabling a cron will prevent it from being scheduled.

### Features
- Visualisation of the cron jobs by list and timeline view
- Add / remove jobs to the schedule
- Control which jobs can be scheduled by Magento
- Remove stalled jobs in 'running' status after a configured amount of time
- Clean up ran or failed cron jobs

### Configuration
<img src="https://github.com/phpro/phpro-mage2-module-scheduler/wiki/images/configuration.png" alt="list" width="50%" />

The configuration for this module can be found under `Stores / Configuration / Advanced / System / Cron`

**Running Job Lifetime:**
The value for this field is in minutes. With it, you can determine when a job will be removed when its status is running.

**Limit Entries In Timeline View:**
With this we limit which cron jobs are visible in the timeline view. By default, we can select the following values:
- Show All
- Show past 24 hours
- Show past 12 hours
- Show past 6 hours

## Changelog

### [8.0.2]
#### Added
- db_schema_whitelist.json has been added
#### Fixed
- Fixed configuration not being loaded by default due to incompatibilities with Adobe Commerce. Cron Groups config by default is overriding the 'cron' path for system config.
- Fixed the module loading the full cron collection to grab the last. This has been changed to a query that returns 1 result. This can improve performance in the backend of large shops.
- We added an index on the 'created_at' field of cron_schedule to speed up loading the recent cron job message.

### [8.0.1]
#### Added
- Possibility to disable 'Cron Not Running' admin notification. Disabling it increases general performance of the backend.

### [8.0.0]
#### Added
- Support PHP 8.x
- Drop Support Magento versions < 2.4.4

### [6.0.0]
#### Added
- Made it possible to limit the number of successful jobs on the timeline
- Magento 2.4 compatibility
- Dropped support magento versions < 2.3.x

#### Fixes
- Empty timeline when there are no jobs in the system yet

### [5.0.0] - 2020-07-31
#### Added

- Notify the admin when the Magento cron is not running
- Jobs can be removed in the Schedule List view
- Jobs are sorted alphabetically
- Made it possible to disable cron jobs
- Number of jobs  in the Timeline View can be limited to prevent out of memory errors
- Timeline view of the cron schedule in the admin panel
- Configuration view of the jobs in the admin panel
- Visualisation of the cron schedule list in the admin panel
- Made it possible to add jobs to the schedule

## Recent Versions

| Version | Released |
|---|---|
| 8.0.2 | 2023-06-29 |
| 8.0.1 | 2023-05-05 |
| 8.0.0 | 2022-06-27 |
| 7.0.1 | 2020-11-24 |
| 7.0.0 | 2020-10-30 |
| 6.0.0 | 2020-08-28 |
| 5.0.0 | 2020-07-31 |

## Dependencies

### Require

| Package | Constraint |
|---|---|
| magento/framework | ^103.0 |
| magento/module-backend | ^101.0\|^102.0 |
| magento/module-cron | ^100.3 |
| magento/module-ui | ^101.1 |
| php | ^8.1 |

### Require (dev)

| Package | Constraint |
|---|---|
| magento/magento-coding-standard | * |
| phpro/grumphp-shim | ^1.0 |
| phpunit/phpunit | ~9.5.0 |

## Quality

Latest release (8.0.2) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Fail | 88 | 36 errors, 52 warnings (ruleset: Magento2) — 38 auto-fixable with phpcbf |
| PHPMD | Warning | 13 | 13 rule violations (MissingImport:9, UnusedFormalParameter:3, UnusedLocalVariable:1) |
| Cpd | Pass | 0 |  |
| Composer validate | Pass | 0 |  |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 6 | 6 | – | – |
| 2.4.8 | – | 6 | 6 | – |
| 2.4.9 | – | – | 6 | 6 |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Error | Error | – | – |
| 2.4.8 | – | Error | Error | – |
| 2.4.9 | – | – | Error | not tested |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | N/A | 0 | no resolvable dependency tree to audit — Your requirements could not be resolved to an installable set of packages. Problem 1 |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["phpro/mage2-module-scheduler"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

phpro is a Magento 2 vendor on Packagento. See https://packagento.com/phpro.md for their full catalogue.

