WordPress Plugin: Grand Illusion Cinema

github.com/bixgomez/gicinema/tree/main/wp-content/plugins/gicinema-plugin

This custom WordPress plugin automates the import, synchronization, and management of films and screenings from Agile Ticketing into the cinema’s WordPress site. It maintains a dedicated screenings database table, supports scheduled synchronization via cron, and provides a suite of admin tools for data cleanup, deduplication, and maintenance.

Built with a clear separation of concerns (core logic in function__*.php files, admin UI in page__*.php files, and a central bootstrap) the plugin is designed for maintainability and safe operation in a live production environment. It empowers cinema staff and volunteers to keep showtimes accurate without deep technical intervention.

Important context:
Some maintenance tools are destructive by design (e.g., deleting all films or truncating the screenings table) and require careful handling. Other tools exist to address recurring but hard-to-trace data anomalies, such as time zone-related duplicate screenings.

Key code to peruse:

  1. Film Import Logic function__import_films_from_agile.php
    Handles fetching film metadata from Agile Ticketing, mapping it to WordPress film posts, and managing updates to existing entries.
  2. Screening Import Logic function__import_screenings_from_agile.php
    Retrieves and processes screening times, linking them to films and storing them in the custom screenings table.
  3. Deduplication function__dedupe_screenings_table.php
    Removes duplicate screening records based on film ID and start time.
  4. Delete Overnight Screenings function__delete_overnight_screenings.php
    Cleans up screenings with start times between 12:00 AM and 6:00 AM — often caused by a time zone offset issue (likely GMT vs Pacific Time) that can originate from multiple sources (Agile, WordPress, hosting, or plugin logic).
  5. Database Backup & Cleanup function__db_backup_and_cleanup.php
    Backs up the screenings table before maintenance tasks and clears outdated records.

The entire repository can be found at
https://github.com/bixgomez/gicinema