You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of the latest refactor, all core classes have been migrated to the `Soderlind\\RedisQueueDemo` namespace and autoloaded via Composer PSR-4. Legacy global class names (`Redis_Queue_Demo`, `Redis_Queue_Manager`, `Job_Processor`, `Sync_Worker`, `REST_Controller`, `Admin_Interface`, job classes, etc.) are still available through `class_alias` so existing integrations that referenced the old globals continue to work without modification.
325
+
326
+
Removed legacy duplicate files:
327
+
```
328
+
admin/class-admin-interface.php
329
+
api/class-rest-controller.php
330
+
workers/class-sync-worker.php
331
+
```
332
+
Their logic now lives in:
333
+
```
334
+
src/Admin/Admin_Interface.php
335
+
src/API/REST_Controller.php
336
+
src/Workers/Sync_Worker.php
337
+
```
338
+
339
+
Helper functions (`redis_queue_demo()`, `redis_queue_enqueue_job()`, `redis_queue_process_jobs()`) remain unchanged for ergonomics.
340
+
341
+
If you previously required or included specific legacy files manually, you should remove those `require` statements—Composer autoload now handles class loading.
342
+
343
+
### Migrating Custom Integrations
344
+
345
+
If you instantiated legacy classes directly, both of the following are now equivalent:
346
+
```php
347
+
$manager = new Redis_Queue_Manager(); // legacy global (still works)
348
+
$manager = new \Soderlind\RedisQueueDemo\Core\Redis_Queue_Manager(); // namespaced
349
+
```
350
+
351
+
Custom job classes should adopt the namespace pattern and be placed under `src/YourNamespace/` with an appropriate `composer.json` autoload mapping, or hooked via the `redis_queue_demo_create_job` filter returning a namespaced job instance.
352
+
353
+
### Why This Change?
354
+
355
+
1. Autoload performance & structure clarity.
356
+
2. Avoiding global symbol collisions.
357
+
3. Easier extension via modern PHP tooling.
358
+
4. Future unit test isolation.
359
+
360
+
If you encounter any missing class errors after upgrading, clear WordPress object/opcode caches and run:
361
+
```bash
362
+
composer dump-autoload -o
363
+
```
364
+
365
+
Please report any backward compatibility regressions in the issue tracker.
366
+
367
+
### Admin Interface Inlining (UI Unchanged)
368
+
369
+
The legacy `admin/class-admin-interface.php` file was fully inlined into the namespaced `src/Admin/Admin_Interface.php` to remove manual `require` calls. To preserve the exact markup/CSS hooks, the original page layouts were ported as partial templates under:
370
+
```
371
+
src/Admin/partials/
372
+
dashboard-inline.php
373
+
jobs-inline.php
374
+
test-inline.php
375
+
settings-inline.php
376
+
```
377
+
These are loaded internally by the namespaced class; you should not include them directly. If you previously overrode or filtered admin output, existing selectors and element structures remain stable.
Copy file name to clipboardExpand all lines: docs/extending-jobs.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@ This guide explains how to create custom background jobs by extending the base a
4
4
5
5
## Core Concepts
6
6
7
+
Important: The plugin now exclusively uses namespaced classes and only canonical job type identifiers you define (e.g. `email`, `image_processing`, `api_sync`, or your custom strings). Legacy/global class name variants (like `Email_Job`, `email_job`) are not auto-mapped.
8
+
7
9
A job represents a unit of work executed asynchronously by a worker. Each job class encapsulates:
0 commit comments