2.1. Requirements and How They Are Used - thinkshout/wp-otis GitHub Wiki
Installation requirements
- WordPress (6.0+) ** WP Cron must be enabled (it is by default)
- PHP version 8.1+
- Composer or Docker for package management
- Action Scheduler 3.0+ (Installed with the plugin)
- Advanced Custom Fields PRO plugin 5.8+ (source code)
- WP-CLI
- An OTIS account
How WP-OTIS Uses Advanced Custom Fields
For post types which fall under the OTIS umbrella within Wordpress, WP-OTIS displays a large field group called "OTIS Fields" whose values are stored (as usual for ACF) as keyed metadata on the post. It is technically possible to use the ACF dashboard interface to change this field group, but this is inadvisable, as any update to the plugin will overwrite the changes. The ACF export file that defines the fields is in the source tree and is loaded within wp-otis.php.
How WP-OTIS Uses WP Cron
WP-Cron works by checking, on every page load, a list of scheduled tasks to see what needs to be run. Any tasks due to run will be called during that page load. For WP-OTIS, this means that data imports from OTIS are scheduled to run once per hour. These jobs are identical to the WP-CLI commands.
OTIS listings and history updates may come in large batches, and if a site (especially a testing site) goes some time without being loaded, the backlog may build up. For this reason, these two types of imports are paginated. Each import job will attempt to import a batch of up to 500 items, and then, if there are more left unsynced from OTIS, will schedule another WP Cron job immediately to work on another 500-item batch. The goal is to minimize execution or memory timeouts, which web hosts often configure PHP to cancel if they grow too large; with a large number of listings, a query trying to match for all the history updates may grow too large and be halted before finishing.
The normal hourly job will not run if the plugin detects that a paginated bulk job is still running. However, a canceled job may result in the "bulk job is running now" flag never being unset if it does not complete. The nobulk CLI command exists to reset and return to the normal import process if that happens.