control-search.sh

Performs various operations related to cruise data management in a WordPress environment, including updating search tables, cruise line and ship information, prices, and more.

Usage

./control-search.sh

Description

  • Checks if the script is already running and exits if it is.
  • Logs the start and end of the script execution.
  • Executes control-tables.sh scripts for various lookup tables.
  • Deletes prices older than 48 hours from the database.
  • Sets up and populates search tables with cruise data.
  • Handles WPML languages if enabled.
  • Updates cruise line and ship information in the search table.
  • Updates cruise subtitles, extras, codes, and IDs.
  • Updates itinerary, destination, and local departure information.
  • Updates ship information, star ratings, and links.
  • Updates cruise duration and travel types.
  • Prefetches data for cruises.
  • Updates cruise prices from various sources.
  • Calculates and updates minimum and maximum prices.
  • Handles "call for price" cruises if enabled.
  • Updates best cabin types, best value, and most popular cruises.
  • Updates ship and cruise line image URLs.
  • Hides cruises from search based on meta key.
  • Updates cabin types for ships.
  • Updates display titles for cruises.
  • Handles cruise packages if enabled.
  • Drops and rebuilds search and destination tables.
  • Flushes WordPress cache.

Dependencies

  • functions.sh: Utility functions.
  • mysql: MySQL commands.
  • wp: WP-CLI for WordPress operations.

Notes

  • Ensure all required environment variables and plugins are set before running.
  • Intended for use by developers or system administrators familiar with WordPress and server scripting.

For further details, refer to the comments in the script or contact the development team.