{"id":17821874,"url":"https://github.com/wp-cli/cron-command","last_synced_at":"2025-05-16T11:03:22.918Z","repository":{"id":17943648,"uuid":"83048365","full_name":"wp-cli/cron-command","owner":"wp-cli","description":"Tests, runs, and deletes WP-Cron events; manages WP-Cron schedules.","archived":false,"fork":false,"pushed_at":"2025-05-12T18:24:51.000Z","size":8500,"stargazers_count":32,"open_issues_count":4,"forks_count":27,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-05-12T19:41:44.764Z","etag":null,"topics":["cli","cron","hacktoberfest","wordpress","wp-cli","wp-cli-package"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wp-cli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-02-24T14:17:05.000Z","updated_at":"2025-05-12T18:24:54.000Z","dependencies_parsed_at":"2024-02-13T23:23:18.452Z","dependency_job_id":"d86e2d73-c2c3-44b7-bab5-5e6c511f0e24","html_url":"https://github.com/wp-cli/cron-command","commit_stats":{"total_commits":484,"total_committers":49,"mean_commits":9.877551020408163,"dds":0.743801652892562,"last_synced_commit":"2108295a2f30de77d3ee70b1a60d1b542c2dfd79"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Fcron-command","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Fcron-command/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Fcron-command/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Fcron-command/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wp-cli","download_url":"https://codeload.github.com/wp-cli/cron-command/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254518383,"owners_count":22084374,"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":["cli","cron","hacktoberfest","wordpress","wp-cli","wp-cli-package"],"created_at":"2024-10-27T17:27:04.045Z","updated_at":"2025-05-16T11:03:22.861Z","avatar_url":"https://github.com/wp-cli.png","language":"PHP","readme":"wp-cli/cron-command\n===================\n\nTests, runs, and deletes WP-Cron events; manages WP-Cron schedules.\n\n[![Testing](https://github.com/wp-cli/cron-command/actions/workflows/testing.yml/badge.svg)](https://github.com/wp-cli/cron-command/actions/workflows/testing.yml)\n\nQuick links: [Using](#using) | [Installing](#installing) | [Contributing](#contributing) | [Support](#support)\n\n## Using\n\nThis package implements the following commands:\n\n### wp cron\n\nTests, runs, and deletes WP-Cron events; manages WP-Cron schedules.\n\n~~~\nwp cron\n~~~\n\n**EXAMPLES**\n\n    # Test WP Cron spawning system\n    $ wp cron test\n    Success: WP-Cron spawning is working as expected.\n\n\n\n### wp cron test\n\nTests the WP Cron spawning system and reports back its status.\n\n~~~\nwp cron test \n~~~\n\nThis command tests the spawning system by performing the following steps:\n\n* Checks to see if the `DISABLE_WP_CRON` constant is set; errors if true\nbecause WP-Cron is disabled.\n* Checks to see if the `ALTERNATE_WP_CRON` constant is set; warns if true.\n* Attempts to spawn WP-Cron over HTTP; warns if non 200 response code is\nreturned.\n\n**EXAMPLES**\n\n    # Cron test runs successfully.\n    $ wp cron test\n    Success: WP-Cron spawning is working as expected.\n\n\n\n### wp cron event\n\nSchedules, runs, and deletes WP-Cron events.\n\n~~~\nwp cron event\n~~~\n\n**EXAMPLES**\n\n    # Schedule a new cron event\n    $ wp cron event schedule cron_test\n    Success: Scheduled event with hook 'cron_test' for 2016-05-31 10:19:16 GMT.\n\n    # Run all cron events due right now\n    $ wp cron event run --due-now\n    Executed the cron event 'cron_test_1' in 0.01s.\n    Executed the cron event 'cron_test_2' in 0.006s.\n    Success: Executed a total of 2 cron events.\n\n    # Delete all scheduled cron events for the given hook\n    $ wp cron event delete cron_test\n    Success: Deleted a total of 2 cron events.\n\n    # List scheduled cron events in JSON\n    $ wp cron event list --fields=hook,next_run --format=json\n    [{\"hook\":\"wp_version_check\",\"next_run\":\"2016-05-31 10:15:13\"},{\"hook\":\"wp_update_plugins\",\"next_run\":\"2016-05-31 10:15:13\"},{\"hook\":\"wp_update_themes\",\"next_run\":\"2016-05-31 10:15:14\"}]\n\n\n\n\n\n### wp cron event delete\n\nDeletes all scheduled cron events for the given hook.\n\n~~~\nwp cron event delete [\u003chook\u003e...] [--due-now] [--exclude=\u003chooks\u003e] [--all]\n~~~\n\n**OPTIONS**\n\n\t[\u003chook\u003e...]\n\t\tOne or more hooks to delete.\n\n\t[--due-now]\n\t\tDelete all hooks due right now.\n\n\t[--exclude=\u003chooks\u003e]\n\t\tComma-separated list of hooks to exclude.\n\n\t[--all]\n\t\tDelete all hooks.\n\n**EXAMPLES**\n\n    # Delete all scheduled cron events for the given hook\n    $ wp cron event delete cron_test\n    Success: Deleted a total of 2 cron events.\n\n\n\n### wp cron event list\n\nLists scheduled cron events.\n\n~~~\nwp cron event list [--fields=\u003cfields\u003e] [--\u003cfield\u003e=\u003cvalue\u003e] [--field=\u003cfield\u003e] [--format=\u003cformat\u003e]\n~~~\n\n**OPTIONS**\n\n\t[--fields=\u003cfields\u003e]\n\t\tLimit the output to specific object fields.\n\n\t[--\u003cfield\u003e=\u003cvalue\u003e]\n\t\tFilter by one or more fields.\n\n\t[--field=\u003cfield\u003e]\n\t\tPrints the value of a single field for each event.\n\n\t[--format=\u003cformat\u003e]\n\t\tRender output in a particular format.\n\t\t---\n\t\tdefault: table\n\t\toptions:\n\t\t  - table\n\t\t  - csv\n\t\t  - ids\n\t\t  - json\n\t\t  - count\n\t\t  - yaml\n\t\t---\n\n**AVAILABLE FIELDS**\n\nThese fields will be displayed by default for each cron event:\n* hook\n* next_run_gmt\n* next_run_relative\n* recurrence\n\nThese fields are optionally available:\n* time\n* sig\n* args\n* schedule\n* interval\n* next_run\n\n**EXAMPLES**\n\n    # List scheduled cron events\n    $ wp cron event list\n    +-------------------+---------------------+---------------------+------------+\n    | hook              | next_run_gmt        | next_run_relative   | recurrence |\n    +-------------------+---------------------+---------------------+------------+\n    | wp_version_check  | 2016-05-31 22:15:13 | 11 hours 57 minutes | 12 hours   |\n    | wp_update_plugins | 2016-05-31 22:15:13 | 11 hours 57 minutes | 12 hours   |\n    | wp_update_themes  | 2016-05-31 22:15:14 | 11 hours 57 minutes | 12 hours   |\n    +-------------------+---------------------+---------------------+------------+\n\n    # List scheduled cron events in JSON\n    $ wp cron event list --fields=hook,next_run --format=json\n    [{\"hook\":\"wp_version_check\",\"next_run\":\"2016-05-31 10:15:13\"},{\"hook\":\"wp_update_plugins\",\"next_run\":\"2016-05-31 10:15:13\"},{\"hook\":\"wp_update_themes\",\"next_run\":\"2016-05-31 10:15:14\"}]\n\n\n\n### wp cron event run\n\nRuns the next scheduled cron event for the given hook.\n\n~~~\nwp cron event run [\u003chook\u003e...] [--due-now] [--exclude=\u003chooks\u003e] [--all]\n~~~\n\n**OPTIONS**\n\n\t[\u003chook\u003e...]\n\t\tOne or more hooks to run.\n\n\t[--due-now]\n\t\tRun all hooks due right now.\n\n\t[--exclude=\u003chooks\u003e]\n\t\tComma-separated list of hooks to exclude.\n\n\t[--all]\n\t\tRun all hooks.\n\n**EXAMPLES**\n\n    # Run all cron events due right now\n    $ wp cron event run --due-now\n    Executed the cron event 'cron_test_1' in 0.01s.\n    Executed the cron event 'cron_test_2' in 0.006s.\n    Success: Executed a total of 2 cron events.\n\n\n\n### wp cron event schedule\n\nSchedules a new cron event.\n\n~~~\nwp cron event schedule \u003chook\u003e [\u003cnext-run\u003e] [\u003crecurrence\u003e] [--\u003cfield\u003e=\u003cvalue\u003e]\n~~~\n\n**OPTIONS**\n\n\t\u003chook\u003e\n\t\tThe hook name.\n\n\t[\u003cnext-run\u003e]\n\t\tA Unix timestamp or an English textual datetime description compatible with `strtotime()`. Defaults to now.\n\n\t[\u003crecurrence\u003e]\n\t\tHow often the event should recur. See `wp cron schedule list` for available schedule names. Defaults to no recurrence.\n\n\t[--\u003cfield\u003e=\u003cvalue\u003e]\n\t\tArguments to pass to the hook for the event. \u003cfield\u003e should be a numeric key, not a string.\n\n**EXAMPLES**\n\n    # Schedule a new cron event\n    $ wp cron event schedule cron_test\n    Success: Scheduled event with hook 'cron_test' for 2016-05-31 10:19:16 GMT.\n\n    # Schedule new cron event with hourly recurrence\n    $ wp cron event schedule cron_test now hourly\n    Success: Scheduled event with hook 'cron_test' for 2016-05-31 10:20:32 GMT.\n\n    # Schedule new cron event and pass arguments\n    $ wp cron event schedule cron_test '+1 hour' --0=first-argument --1=second-argument\n    Success: Scheduled event with hook 'cron_test' for 2016-05-31 11:21:35 GMT.\n\n\n\n### wp cron schedule\n\nGets WP-Cron schedules.\n\n~~~\nwp cron schedule\n~~~\n\n**EXAMPLES**\n\n    # List available cron schedules\n    $ wp cron schedule list\n    +------------+-------------+----------+\n    | name       | display     | interval |\n    +------------+-------------+----------+\n    | hourly     | Once Hourly | 3600     |\n    | twicedaily | Twice Daily | 43200    |\n    | daily      | Once Daily  | 86400    |\n    +------------+-------------+----------+\n\n\n\n\n\n### wp cron schedule list\n\nList available cron schedules.\n\n~~~\nwp cron schedule list [--fields=\u003cfields\u003e] [--field=\u003cfield\u003e] [--format=\u003cformat\u003e]\n~~~\n\n**OPTIONS**\n\n\t[--fields=\u003cfields\u003e]\n\t\tLimit the output to specific object fields.\n\n\t[--field=\u003cfield\u003e]\n\t\tPrints the value of a single field for each schedule.\n\n\t[--format=\u003cformat\u003e]\n\t\tRender output in a particular format.\n\t\t---\n\t\tdefault: table\n\t\toptions:\n\t\t  - table\n\t\t  - csv\n\t\t  - ids\n\t\t  - json\n\t\t  - yaml\n\t\t---\n\n**AVAILABLE FIELDS**\n\nThese fields will be displayed by default for each cron schedule:\n\n* name\n* display\n* interval\n\nThere are no additional fields.\n\n**EXAMPLES**\n\n    # List available cron schedules\n    $ wp cron schedule list\n    +------------+-------------+----------+\n    | name       | display     | interval |\n    +------------+-------------+----------+\n    | hourly     | Once Hourly | 3600     |\n    | twicedaily | Twice Daily | 43200    |\n    | daily      | Once Daily  | 86400    |\n    +------------+-------------+----------+\n\n    # List id of available cron schedule\n    $ wp cron schedule list --fields=name --format=ids\n    hourly twicedaily daily\n\n\n\n### wp cron event unschedule\n\nUnschedules all cron events for a given hook.\n\n~~~\nwp cron event unschedule \u003chook\u003e\n~~~\n\n**OPTIONS**\n\n\t\u003chook\u003e\n\t\tName of the hook for which all events should be unscheduled.\n\n**EXAMPLES**\n\n    # Unschedule a cron event on given hook.\n    $ wp cron event unschedule cron_test\n    Success: Unscheduled 2 events for hook 'cron_test'.\n\n## Installing\n\nThis package is included with WP-CLI itself, no additional installation necessary.\n\nTo install the latest version of this package over what's included in WP-CLI, run:\n\n    wp package install git@github.com:wp-cli/cron-command.git\n\n## Contributing\n\nWe appreciate you taking the initiative to contribute to this project.\n\nContributing isn’t limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.\n\nFor a more thorough introduction, [check out WP-CLI's guide to contributing](https://make.wordpress.org/cli/handbook/contributing/). This package follows those policy and guidelines.\n\n### Reporting a bug\n\nThink you’ve found a bug? We’d love for you to help us get it fixed.\n\nBefore you create a new issue, you should [search existing issues](https://github.com/wp-cli/cron-command/issues?q=label%3Abug%20) to see if there’s an existing resolution to it, or if it’s already been fixed in a newer version.\n\nOnce you’ve done a bit of searching and discovered there isn’t an open or fixed issue for your bug, please [create a new issue](https://github.com/wp-cli/cron-command/issues/new). Include as much detail as you can, and clear steps to reproduce if possible. For more guidance, [review our bug report documentation](https://make.wordpress.org/cli/handbook/bug-reports/).\n\n### Creating a pull request\n\nWant to contribute a new feature? Please first [open a new issue](https://github.com/wp-cli/cron-command/issues/new) to discuss whether the feature is a good fit for the project.\n\nOnce you've decided to commit the time to seeing your pull request through, [please follow our guidelines for creating a pull request](https://make.wordpress.org/cli/handbook/pull-requests/) to make sure it's a pleasant experience. See \"[Setting up](https://make.wordpress.org/cli/handbook/pull-requests/#setting-up)\" for details specific to working on this package locally.\n\n## Support\n\nGitHub issues aren't for general support questions, but there are other venues you can try: https://wp-cli.org/#support\n\n\n*This README.md is generated dynamically from the project's codebase using `wp scaffold package-readme` ([doc](https://github.com/wp-cli/scaffold-package-command#wp-scaffold-package-readme)). To suggest changes, please submit a pull request against the corresponding part of the codebase.*\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-cli%2Fcron-command","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwp-cli%2Fcron-command","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-cli%2Fcron-command/lists"}