Skip to content

Commit

Permalink
Merge pull request #372 from szepeviktor/typos
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
WPprodigy authored Jan 16, 2024
2 parents 400dc10 + f0a55eb commit f5e9e00
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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 ###
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion __tests__/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
}
Expand Down
2 changes: 1 addition & 1 deletion __tests__/unit-tests/test-event.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
}

Expand Down
2 changes: 1 addition & 1 deletion __tests__/unit-tests/test-events-store.php
Original file line number Diff line number Diff line change
Expand Up @@ -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( [
Expand Down
2 changes: 1 addition & 1 deletion __tests__/unit-tests/test-events.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion includes/class-events-store.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion includes/class-events.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/

Expand Down
4 changes: 2 additions & 2 deletions includes/wp-adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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 =
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f5e9e00

Please sign in to comment.