{"repo":"SebKay/wp-queued-jobs","free":true,"listed":false,"github":"https://github.com/SebKay/wp-queued-jobs","clone":"git clone https://github.com/SebKay/wp-queued-jobs.git","description":"A Laravel-like queue system for WordPress.","language":"PHP","stars":39,"topics":["background-jobs","queue","queues","wordpress","wordpress-api","wordpress-php-library","wp","wordpress-background-jobs","wordpress-queue"],"license":"MIT","category":"dashboards-admin","readme_excerpt":"WP Queued Jobs A Laravel-like queue system for WordPress. Easily create background jobs for things like sending emails or importing large amounts of data. All with a fluent API. I highly recommend using a plugin like WP Crontrol so you can easily see, and manually run, cron jobs from the WordPress dashboard. Requires PHP 7.4+ Install The recommended way to install this package is via Composer. Usage 1. Create job To create a job, you need to extend the WpQueuedJobs\\Jobs\\Job class: 2. Add job to queue and dispatch Anything passed as the second parameter to addJob() will be available in the handle() method of the job (and the rest of the class) as $this- data . The data can be anything you want. A string , array , integer , class etc... The \"queue worker\" will look for new jobs every 1 minute and run them (if there are any). The system runs on a \"first-in first-out\" basis. So whatever gets dispatched first will be run first. Important As the lowest cron time in WordPress defaults to 1 minute, jobs scheduled to run at 6am might not actually run until 6:01am. This isn't an issue in the majority of cases, but it's worth knowing. The point of background jobs is that they run in the background, not immediately, so they should never be used for time-sensitive tasks. Example #1 (Send Email) 1. Load the \"successful registration\" page template. 2. Add the \"send welcome email\" job and dispatch it to the queue. Example #2 (Import Posts from API) 1. Create a custom cron event. 2. Add two j","default_branch":null,"files":null,"tree":[],"storefront":"/r/SebKay","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/SebKay/wp-queued-jobs/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}