=== Agile Tix ===

Tags: Posts
Requires at least: 6.7.0
Tested up to: 6.8.0
Requires PHP: 7.4
Stable tag: 1.2.2
Contributors: Luke Schnetlage
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Connect with your AgileTix shows and automatically create, cull, and customize posts.

== Description ==

Agile Tix is a powerful WordPress integration plugin that connects your WordPress site directly to your AgileTix data. This plugin automatically creates, updates, and manages WordPress posts based on your event and show data from AgileTix, eliminating the need for manual data entry and keeping your website content synchronized with your ticketing system.

Key Benefits:

* **Automatic Post Management**: Automatically create and update WordPress posts from your AgileTix show data, keeping your site current without manual intervention
* **Smart Content Generation**: Automatically generates rich post content including media carousels, event descriptions, showtimes, and venue information
* **Flexible Customization**: Configure how your ATS data translates to WordPress posts, including custom styling, metadata mapping, and taxonomy assignments
* **Theme Integration**: Seamlessly integrates with popular WordPress themes like Event Champ, or use custom post types for complete flexibility
* **Event Display Tools**: Includes powerful shortcodes for displaying event lists with filtering, sorting, and calendar views

== Requirements ==

Before installing Agile Tix, ensure your WordPress installation meets the following requirements:

* WordPress version 6.7.0 or higher
* PHP version 7.4 or higher
* Active internet connection for API communication with AgileTix
* Valid AgileTix credentials (Domain, Corp Org ID, EPGID, and GUID)
* Administrator access to your WordPress site

The plugin uses Action Scheduler for background processing, which is included with the plugin. If you have WooCommerce installed, the plugin will use the existing Action Scheduler instance.

== Installation ==

0. For absolute safety, ensure you have a backup of your site before making any changes.
1. Activate the plugin through the 'Plugins' menu in WordPress, starting by pressing "Add New Plugin".
2. Continue by pressing "Upload Plugin".
3. Drag and drop or select the entire agile-ticketing-plugin.zip when prompted.
4. Click "Install Now" and wait until you are prompted with "Active Plugin".

**Post-Installation Setup:**

After activation, navigate to "AgileTix Options" in your WordPress admin menu to begin configuration:

1. Go to the **Credentials** tab and enter your AgileTix connection details
2. Save your credentials - the plugin will validate them automatically
3. Once validated, proceed to the **Config** tab to set your post creation preferences
4. We recommend starting with post status set to "Draft" for testing purposes
5. Use the **Utility** tab to perform a manual refresh and test post creation
6. Review the created posts and adjust settings in the **Style**, **Content**, and **Theme** tabs as needed
7. Once satisfied, change post status to "Publish" and enable automatic data refreshes

== Features ==

Agile Tix provides a comprehensive set of features for managing event content on your WordPress site:

* **Automatic Post Creation and Updates**: Automatically creates WordPress posts from your AgileTix show data and keeps them synchronized with your ticketing system
* **Media Carousel Generation**: Automatically generates interactive media carousels for event images and videos, enhancing the visual presentation of your events
* **Event List Shortcode**: Use the `[ats_event_list]` shortcode to display filtered, sortable event listings with alphabetical, date, and genre filtering options
* **Custom Post Content Styling**: Configure default styling and formatting for automatically generated post content to match your site's design
* **Theme Integration Options**: Seamlessly integrate with popular themes like Event Champ, or configure custom post types for complete flexibility
* **Manual and Automatic Data Refresh**: Choose between manual refreshes for testing or automatic scheduled refreshes to keep your site always up to date
* **Action Scheduler Integration**: Efficiently processes large datasets in the background using WordPress Action Scheduler, ensuring optimal site performance
* **Advanced Configuration Options**: Customize metadata mapping, taxonomy assignments, and field translations to match your specific needs
* **Post Status Management**: Control whether posts are created as drafts or published immediately, with automatic culling of outdated content
* **Block Editor Support**: Generates content using WordPress block editor format for full compatibility with modern WordPress themes

== Frequently Asked Questions ==



= Why am I getting an error when I save my credentials? =

The plugin validates your credentials when you save them. Common causes of credential errors include:

**Missing Required Fields:**
* Ensure all required fields are filled: Domain, Corp Org ID, and Secret
* You must provide either EPGID and GUID together, OR EPGTAG (not both)


**Invalid Entry Point:**
* The EPGID/GUID or EPGTAG must point to at least one show in your AgileTix system
* If you receive a "no shows found" error, verify that your EPGID/GUID or EPGTAG is correct and that it references shows in your system
* Contact your AgileTix administrator if you're unsure about your entry point identifiers

**API Connection Issues:**
* Check that your WordPress site has internet connectivity
* Verify that your server is not blocking outbound API calls





= Why can't I enable automated data refreshes on a staging site? =

Due to security and data integrity concerns, automatic data refreshes are disabled for staging sites.

**Using Manual Refresh Tools:**
* Navigate to the **Utility** tab in AgileTix Options
* Use "Fast Refresh ATS Data" to reformat existing data without fetching new data (useful for testing configuration changes)
* Use "Full Refresh ATS Data" to fetch new data from AgileTix and recreate all posts (useful for complete testing)

**For Production Sites:**
Automatic data refreshes are available on production sites. Once you've tested your configuration on staging and are satisfied with the results, you can enable automatic refreshes on your production site.

= Why are my posts not appearing on my site? =

**Check Post Status:**
* Navigate to the **Config** tab and verify your post status setting
* If set to "Draft", posts will be created but not visible to public visitors
* Change to "Publish" to make posts visible (after testing)

**Verify Post Creation:**
* Go to WordPress Posts (or your configured post type) in the admin area
* Check if draft posts were created
* If no posts exist, perform a manual refresh from the **Utility** tab

**Check Post Type:**
* Verify that you're looking in the correct post type (agile_post, event, or your custom post type)
* The post type is configured in the **Theme** tab

**Permissions:**
* Ensure your user account has permission to view the post type
* Check that the post type is publicly queryable in your theme configuration

= Why are my posts not updating automatically? =

**Automatic Refresh Status:**
* Verify that automatic data refreshes are enabled (not available on staging sites)
* Check the **Advanced** tab to see if Action Scheduler tasks are running
* Ensure your WordPress cron is functioning properly

**Action Scheduler:**
* Navigate to the **Advanced** tab to view Action Scheduler status
* Large datasets are processed in the background - check the queue for pending actions
* If actions are stuck, you may need to manually trigger them or check for errors

**Credentials:**
* Ensure your credentials are still valid (check the **Credentials** tab)
* Invalid credentials will disable automatic refreshes

**Manual Refresh:**
* Use the **Utility** tab to perform a manual refresh if automatic updates aren't working
* This can help identify if the issue is with automatic scheduling or data fetching

= The shortcode [ats_event_list] is not displaying events =

**Verify Posts Exist:**
* Ensure that posts have been created and are published (or visible to the current user)
* Check that posts have the ATS_EventID meta field (this identifies them as AgileTix events)

**Check Post Type:**
* The shortcode uses the post type configured in your **Theme** tab by default
* You can override this with the `posttype` attribute: `[ats_event_list posttype="your_post_type"]`
* Verify the post type matches the one used when creating posts

**Theme Compatibility:**
* Some themes may need additional CSS for proper display
* Check the **Style** tab for customization options
* Review browser console for JavaScript errors that might prevent display

**Cache Issues:**
* Clear your WordPress cache and browser cache
* If using a caching plugin, purge the cache after creating or updating events

= The event list filters are not working =

**JavaScript Requirements:**
* Ensure JavaScript is enabled in your browser
* Check browser console for JavaScript errors
* Verify that your theme is not conflicting with the shortcode's JavaScript

**Post Meta Data:**
* Filters rely on post meta data and taxonomies
* Ensure events have genre taxonomies assigned (if using genre filtering)
* Verify that event dates are properly stored in post meta

**CSS Issues:**
* Check that filter buttons are visible (they may be hidden by CSS)
* Review the **Style** tab for filter-related styling options
* Inspect the page to ensure filter containers are present in the HTML

= The media carousel is not displaying =

**Media Data:**
* Check that media embeds are properly formatted in the ATS data
* Empty or invalid media data will result in no carousel display

**Content Generation:**
* The carousel is automatically generated as part of post content
* Check the **Content** tab to ensure media carousel generation is enabled
* Review generated post content to see if carousel HTML is present

**Theme Compatibility:**
* Some themes may need additional CSS for carousel display
* Check the **Style** tab for carousel styling options

= I'm experiencing performance issues with large datasets =

**Action Scheduler:**
* The plugin uses Action Scheduler for efficient background processing
* Navigate to the **Advanced** tab to monitor Action Scheduler performance
* Large datasets are processed in batches to prevent timeouts

**Server Resources:**
* Ensure your server has adequate PHP memory and execution time limits
* Consider increasing `max_execution_time` and `memory_limit` in PHP settings
* Check server logs for timeout or memory errors


**Monitoring:**
* Check the **Advanced** tab for Action Scheduler queue status
* Monitor WordPress debug logs for processing information
* Use the **Utility** tab to see last known runtime information

= How do I integrate with my theme? =

**Theme Tab Configuration:**
* Navigate to the **Theme** tab in AgileTix Options
* Select your integration type:
  * **None**: Uses default agile_post post type
  * **Event Champ**: Integrates with Event Champ theme
  * **Custom**: Configure your own custom post type
  * **Amy Movie**: Integrates with Amy Movie theme

**Custom Post Types:**
* For custom integration, specify your post type slug
* Configure taxonomy mappings (e.g., genres, categories)
* Set up custom field mappings in the Theme tab

**Metadata Mapping:**
* Use the Theme tab to map ATS data fields to WordPress meta fields
* Configure taxonomy assignments for categories, tags, and custom taxonomies
* Define custom property translations

**Testing:**
* Perform manual refreshes to verify data mapping
* Adjust mappings in the Theme tab as needed


**Best Practices:**
* Always backup your site before making configuration changes
* Test configuration changes with draft posts first
* Use manual refreshes during initial setup and testing
* Monitor the Action Scheduler in the Advanced tab for large datasets
* Keep your WordPress and PHP versions up to date

== Changelog ==

= 1.0 =
* Initial Release

== Upgrade Notice ==

= 1.1 =
Added media carousel generation 
Added event list short code [ats_event_list]
Default post content styling
Bug fixes

= 1.1.1 = 
Bug Fixes: 
	Inconsistent option defaults in config
	Failed integration widget deployment
	Accidental resetting of text content fields on credential save

= 1.2.0 =
Reworked post creation to use the action scheduler library for better performance on large data sets.
Added advanced tab for action scheduler management.
Reworked text content generation to use new block editor
Utility tab display improvements
Added style presets feature with Minimal and Dark mode presets for quick CSS styling
Improved style editor layout with expanded editor width and preset buttons sidebar
Bug fixes

= 1.2.1 =
Added "Coming Soon" feed support with separate API endpoint configuration
Added coming soon banner shortcode [ats_coming_soon_banner] for auto-scrolling display of coming soon events
Added now showing banner shortcode [ats_now_showing_banner] for auto-scrolling display of current events

1.2.2
Added "Rating" block to text content creator. This maps to "TMDB Rating" mapped to a custom property "Vote Average" and
"TMDB Votes" mapped to a custom property "Vote Count" if the user has TMDB integration set up in admin
Bug fixes relating to custom post type post creation

