{"id":13810349,"url":"https://github.com/reaktivstudios/locomotive","last_synced_at":"2026-01-27T06:47:07.628Z","repository":{"id":45449255,"uuid":"42610312","full_name":"reaktivstudios/locomotive","owner":"reaktivstudios","description":"Allow developers to easily register batch processes through code, and run them through the admin UI","archived":false,"fork":false,"pushed_at":"2020-12-07T18:46:19.000Z","size":842,"stargazers_count":191,"open_issues_count":21,"forks_count":11,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-11-19T03:42:36.158Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reaktivstudios.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-16T20:01:02.000Z","updated_at":"2024-10-08T14:33:54.000Z","dependencies_parsed_at":"2022-07-14T01:10:38.453Z","dependency_job_id":null,"html_url":"https://github.com/reaktivstudios/locomotive","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reaktivstudios%2Flocomotive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reaktivstudios%2Flocomotive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reaktivstudios%2Flocomotive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reaktivstudios%2Flocomotive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reaktivstudios","download_url":"https://codeload.github.com/reaktivstudios/locomotive/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254121111,"owners_count":22018104,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T02:00:50.872Z","updated_at":"2026-01-27T06:47:07.594Z","avatar_url":"https://github.com/reaktivstudios.png","language":"PHP","funding_links":[],"categories":["WordPress Plugins"],"sub_categories":[],"readme":"Locomotive\n==========\n\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/reaktivstudios/locomotive/badges/quality-score.png?b=master\u0026s=86399ae1ed8459dbcaa0c4a5d5e34947d7454cf8)](https://scrutinizer-ci.com/g/reaktivstudios/locomotive/?branch=master) [![Code Coverage](https://scrutinizer-ci.com/g/reaktivstudios/locomotive/badges/coverage.png?b=master\u0026s=656ebaea7636b3882b1834f7226c53327e826bb2)](https://scrutinizer-ci.com/g/reaktivstudios/locomotive/?branch=master)\n\n## About\n![Locomotive Logo](logo.png?raw=true \"Locomotive Logo\")\n\nCreating batch processes in WordPress has never been so easy. If you've ever wanted to query a large dataset and perform simple and repeatable actions, then Locomotive is for you.\n\nLocomotive allows developers to write a single function (or set of functions) to process actions across a large data set. These registered batch processes can be run with the click of a button from the WP admin as needed. Locomotive handles the complexity of batch processing by automatically chunking up data, checking for records that have already been processed and logging errors as they come in.\n\n## Links\n* [Documentation](https://github.com/reaktivstudios/locomotive/wiki)\n* [Examples](https://github.com/reaktivstudios/locomotive/wiki/Examples)\n\n## Quick Start Example\n\n#### Register a standard post query\n``` php\nfunction my_post_query_batch_process() {\n\n\tregister_batch_process( array(\n\t\t'name'     =\u003e 'Just another batch',\n\t\t'type'     =\u003e 'post',\n\t\t'callback' =\u003e 'my_callback_function',\n\t\t'args'     =\u003e array(\n\t\t\t'posts_per_page' =\u003e 1,\n\t\t\t'post_type'      =\u003e 'post',\n\t\t),\n\t) );\n}\nadd_action( 'locomotive_init', 'my_post_query_batch_process' );\n```\n\n#### Hook In Callback Function\n``` php\n/**\n * This is what we want to do with each individual result during a batch routine.\n *\n * @param  array $result Individual result from batch query.\n */\nfunction my_callback_function( $result ) {\n\terror_log( print_r( $result-\u003epost_title, true ) );\n}\n```\n\n#### Start Batch Process\n![Locomotive Menu](screenshot.gif?raw=true \"Locomotive Menu\")\n\nNavigate to Tools-\u003eBatches in the admin, select your batch, and click _Run_.\n\n## Contributors\n* [Josh Eaton](https://github.com/jjeaton)\n* [Zach Wills](https://github.com/zachwills)\n* [Andrew Norcross](https://github.com/norcross)\n* [Jay Hoffmann](https://github.com/JasonHoffmann)\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md).\n\n\n#### [Pull requests](https://github.com/reaktivstudios/locomotive/pulls) are very much welcome and encouraged.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freaktivstudios%2Flocomotive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freaktivstudios%2Flocomotive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freaktivstudios%2Flocomotive/lists"}