Classes & Helpers

CruiseAppy is built with a modular class structure and a set of helper functions to support core features, integrations, and automation. This organization ensures maintainability, extensibility, and efficient data handling.

Main Classes

  • Booking (classes/booking.php): Oversees booking processes, validation, and payment integration.
  • Brand (classes/brand.php): Manages brand-specific settings, assets, and customizations.
  • Cabin (classes/cabin.php): Manages cabin selection, pricing, and inventory.
  • CabinSelect (classes/cabin-select.php): Facilitates advanced cabin selection workflows and user preferences.
  • Cruise (classes/cruise.php): Orchestrates cruise-related operations, including data retrieval and synchronization.
  • CruiseLine (classes/cruiseline.php): Manages cruise line information, branding, and partnerships.
  • Reports (classes/reports.php): Generates and manages analytical reports for bookings, revenue, and user activity.
  • Search (classes/search.php): Implements search and filtering functionalities.
  • Ship (classes/ship.php): Handles ship details, amenities, and onboard services.
  • Special (classes/special.php): Handles special offers, promotions, and limited-time deals.

Helper Functions

  • Located in the helpers/ directory.
  • Provide utility methods for data formatting, validation, logging, and error handling.
  • Examples:
  • formatCurrency($amount, $currency): Formats monetary values for display.
  • validateBookingData($data): Ensures booking data meets required criteria.
  • logAction($message, $level): Writes logs to the appropriate file or database table.
  • sanitizeInput($input): Cleans user input to prevent security issues.

Integration & Extensibility

  • Classes and helpers are designed for easy extension via WordPress hooks and filters.
  • Custom actions and filters are documented in the plugin for advanced integrations.
  • Automation scripts leverage helper functions for data import, export, and transformation.