From f0a55ebf715501a24aa69a40bd937a614fda6a5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Tue, 16 Jan 2024 13:43:06 +0000 Subject: [PATCH] Fix typos --- README.md | 8 ++++---- __tests__/bootstrap.php | 2 +- __tests__/unit-tests/test-event.php | 2 +- __tests__/unit-tests/test-events-store.php | 2 +- __tests__/unit-tests/test-events.php | 2 +- includes/class-events-store.php | 2 +- includes/class-events.php | 2 +- includes/wp-adapter.php | 4 ++-- readme.txt | 8 ++++---- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 1a9756bc..5ed129f2 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Execute WordPress cron events in parallel, with custom event storage for high-vo ## Description ## -This plugin sets up a custom cron table for better events storage. Using WP hooks, it then intercepts cron registration/retrieval/deletions. There are two additional interaction layers exposed by the plugin - WP CLI and the REST API. +This plugin sets up a custom cron table for better events storage. Using WP hooks, it then intercepts cron registration/retrieval/deletions. There are two additional interaction layers exposed by the plugin - WP-CLI and the REST API. By default the plugin disables default WP cron processing. It is recommended to use the cron control runner to process cron: https://github.com/Automattic/cron-control-runner. This is how we are able to process cron events in parallel, allowing for high-volume and reliable cron. @@ -27,9 +27,9 @@ By default the plugin disables default WP cron processing. It is recommended to ### Deviations from WordPress Core ### -* Cron jobs are stored in a custom table and not in the `cron` option in wp_options. As long relevent code uses WP core functions for retrieving events and not direct SQL, all will stay compatible. +* Cron jobs are stored in a custom table and not in the `cron` option in wp_options. As long relevant code uses WP core functions for retrieving events and not direct SQL, all will stay compatible. * Duplicate recurring events with the same action/args/schedule are prevented. If multiple of the same action is needed on the same schedule, can add an arbitrary number to the args array. -* When the cron control runner is running events, it does so via WP CLI. So the environment can be slightly different than that of a normal web request. +* When the cron control runner is running events, it does so via WP-CLI. So the environment can be slightly different than that of a normal web request. * The cron control runner can process multiple events in parallel, whereas core cron only did 1 at a time. By default, events with the same action will not run in parallel unless specifically granted permission to do so. ### Adding Internal Events ### @@ -122,7 +122,7 @@ Run `npm install` then `npm run build` to create/update language files and to co ### 3.0 ### * Implement WP cron filters that were added in WP 5.1. * Cleanup the event's store & introduce new Event() object. -* Switch to a more effecient caching strategy. +* Switch to a more efficient caching strategy. ### 2.0 ### * Support additional Internal Events diff --git a/__tests__/bootstrap.php b/__tests__/bootstrap.php index f62eb67d..2b4cf79e 100644 --- a/__tests__/bootstrap.php +++ b/__tests__/bootstrap.php @@ -48,7 +48,7 @@ function _manually_load_plugin() { // Start up the WP testing environment. require $_tests_dir . '/includes/bootstrap.php'; -// Setup WP CLI depedencies. +// Setup WP-CLI dependencies. if ( ! defined( 'WP_CLI_ROOT' ) ) { define( 'WP_CLI_ROOT', __DIR__ . '/../vendor/wp-cli/wp-cli' ); } diff --git a/__tests__/unit-tests/test-event.php b/__tests__/unit-tests/test-event.php index 99f652cc..1a8798e8 100644 --- a/__tests__/unit-tests/test-event.php +++ b/__tests__/unit-tests/test-event.php @@ -143,7 +143,7 @@ function test_find() { $this->assertEquals( 'test_find_action', $event->get_action(), 'found event by args' ); // Failed find by args. - $event = Event::find( [ 'action' => 'non_existant_action', 'timestamp' => 1637447876 ] ); + $event = Event::find( [ 'action' => 'non_existent_action', 'timestamp' => 1637447876 ] ); $this->assertNull( $event, 'could not find event by args' ); } diff --git a/__tests__/unit-tests/test-events-store.php b/__tests__/unit-tests/test-events-store.php index 9b46c951..0dca3f1c 100644 --- a/__tests__/unit-tests/test-events-store.php +++ b/__tests__/unit-tests/test-events-store.php @@ -70,7 +70,7 @@ function test_get_raw_event() { $this->assertNull( $result, 'returns null when given invalid ID' ); $result = $store->_get_event_raw( PHP_INT_MAX ); - $this->assertNull( $result, 'returns null when given an non-existant ID' ); + $this->assertNull( $result, 'returns null when given an non-existent ID' ); // Event w/ all defaults. $this->run_get_raw_event_test( [ diff --git a/__tests__/unit-tests/test-events.php b/__tests__/unit-tests/test-events.php index bd94ddda..3c006494 100644 --- a/__tests__/unit-tests/test-events.php +++ b/__tests__/unit-tests/test-events.php @@ -82,7 +82,7 @@ function test_flatten_wp_events_array() { // Ensure we flatten it w/ all events accounted for. $flattened = Events::flatten_wp_events_array( $formatted ); $this->assertEquals( count( $flattened ), 4, 'Returns all expected events' ); - // Could maybe test more here, but honestly feels like it would couple too closely to the implemention itself. + // Could maybe test more here, but honestly feels like it would couple too closely to the implementation itself. } private function create_test_events() { diff --git a/includes/class-events-store.php b/includes/class-events-store.php index ce6104c3..8fec66e8 100644 --- a/includes/class-events-store.php +++ b/includes/class-events-store.php @@ -285,7 +285,7 @@ public function _update_event( int $event_id, array $row_data ): bool { * * Currently no need for caching here really, * the action/instance/timestamp combination is the query that often happens on the FE. - * So perhaps room for enhacement there later. + * So perhaps room for enhancement there later. * * @param int $id The ID of the event being retrieved. * @return object|null Raw event object if successful, false otherwise. diff --git a/includes/class-events.php b/includes/class-events.php index d7303333..c6290938 100644 --- a/includes/class-events.php +++ b/includes/class-events.php @@ -191,7 +191,7 @@ private function reduce_queue( $events, $max_queue_size ): array { * * While the events are now out of order with respect to timestamp, they're ordered * such that one of each action is run before another of an already-run action. - * The timestamp mis-ordering is trivial given that we're only dealing with events + * The timestamp misordering is trivial given that we're only dealing with events * for the current $job_queue_window. */ diff --git a/includes/wp-adapter.php b/includes/wp-adapter.php index a1a98f83..14070c69 100644 --- a/includes/wp-adapter.php +++ b/includes/wp-adapter.php @@ -236,7 +236,7 @@ function pre_get_ready_cron_jobs( $pre ) { /** * Intercepts requests for the entire 'cron' option. - * Ideally this is never called any more, but we must support this for backwards compatability. + * Ideally this is never called any more, but we must support this for backwards compatibility. * * @param false $pre False if the process has not been intercepted yet. * @return array Cron array, in the format WP expects. @@ -264,7 +264,7 @@ function pre_get_cron_option( $pre ) { /** * Intercepts 'cron' option update. - * Ideally this is never called any more either, but we must support this for backwards compatability. + * Ideally this is never called any more either, but we must support this for backwards compatibility. * * @param array $new_value New cron array trying to be saved * @param array $old_value Existing cron array (already intercepted via pre_get_cron_option() above) diff --git a/readme.txt b/readme.txt index 4ef5b985..786cd18d 100644 --- a/readme.txt +++ b/readme.txt @@ -12,7 +12,7 @@ Execute WordPress cron events in parallel, with custom event storage for high-vo == Description == -This plugin sets up a custom cron table for better events storage. Using WP hooks, it then intercepts cron registration/retrieval/deletions. There are two additional interaction layers exposed by the plugin - WP CLI and the REST API. +This plugin sets up a custom cron table for better events storage. Using WP hooks, it then intercepts cron registration/retrieval/deletions. There are two additional interaction layers exposed by the plugin - WP-CLI and the REST API. By default the plugin disables default WP cron processing. It is recommended to use the cron control runner to process cron: https://github.com/Automattic/cron-control-runner. This is how we are able to process cron events in parallel, allowing for high-volume and reliable cron. @@ -27,9 +27,9 @@ By default the plugin disables default WP cron processing. It is recommended to = Deviations from WordPress Core = -* Cron jobs are stored in a custom table and not in the `cron` option in wp_options. As long relevent code uses WP core functions for retrieving events and not direct SQL, all will stay compatible. +* Cron jobs are stored in a custom table and not in the `cron` option in wp_options. As long relevant code uses WP core functions for retrieving events and not direct SQL, all will stay compatible. * Duplicate recurring events with the same action/args/schedule are prevented. If multiple of the same action is needed on the same schedule, can add an arbitrary number to the args array. -* When the cron control runner is running events, it does so via WP CLI. So the environment can be slightly different than that of a normal web request. +* When the cron control runner is running events, it does so via WP-CLI. So the environment can be slightly different than that of a normal web request. * The cron control runner can process multiple events in parallel, whereas core cron only did 1 at a time. By default, events with the same action will not run in parallel unless specifically granted permission to do so. = Adding Internal Events = @@ -122,7 +122,7 @@ Run `npm install` then `npm run build` to create/update language files and to co = 3.0 = * Implement WP cron filters that were added in WP 5.1. * Cleanup the event's store & introduce new Event() object. -* Switch to a more effecient caching strategy. +* Switch to a more efficient caching strategy. = 2.0 = * Support additional Internal Events