=== TidyBot ===
Contributors: thevikingwebdesign
Donate link: https://thevikingwebdesign.com/
Tags: tidycal, appointment, booking, calendar, scheduling
Requires at least: 5.0
Tested up to: 6.9
Stable tag: 1.9.85
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A frontend planning tool that works with Tidycal agenda tool.

== Description ==

Tidybot is a WordPress plugin that integrates with Tidycal to provide scheduling and appointment booking functionality directly on your website. The plugin displays a customizable chat-like widget that allows your visitors to book appointments through your Tidycal calendar.

**Key Features:**

* Easy integration with Tidycal
* Customizable widget position (bottom-right or bottom-left)
* Adjustable button color to match your brand
* Configurable delay time for automatic widget opening
* Subscription verification system

**Important Note:**
As of version 1.9.77, an email address is required for the widget to display on the frontend. This ensures proper subscription validation and prevents unauthorized usage.

== Installation ==

1. Upload the `tidybot` folder to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Go to the 'Tidybot' settings page
4. Enter your email address for subscription verification
5. Paste your TidyCal embed code
6. Configure additional settings as needed

== Frequently Asked Questions ==

= The widget isn't showing on my site =

Make sure you have:
1. Entered a valid email address in the Tidybot settings
2. Pasted your TidyCal embed code correctly
3. Activated your subscription

= How do I change the appearance of the widget? =

You can customize the widget's position and button color in the Tidybot settings page.

== Changelog ==

= 1.9.85 =
* TidyCal embed code: link in same line as description ("You can find your embed code here!" to tidycal.com/dashboard/booking-types)
* Subscription check runs hourly (WordPress cron)
* Plugin Check: removed hidden .DS_Store file

= 1.9.84 =
* TidyCal embed link, subscription check hourly, Plugin Check fix

= 1.9.83 =
* Added shop link when subscription ends (https://thevikingwebdesign.com/shop/)
* Trial link only shown if user hasn't used trial yet
* Improved trial detection logic to prevent trial reuse after uninstall/reinstall
* Updated all URLs from localhost to production URLs

= 1.9.82 =
* Fixed unlimited subscription detection and entitlements check
* Improved subscription lookup with site_url primary and email fallback
* Updated tested up to WordPress 6.9
* Removed discouraged load_plugin_textdomain() function
* Fixed security issues: input validation and output escaping
* Removed all error logging and console.log statements for production readiness
* Cleaned up debug output throughout the plugin
* Plugin now production-ready without debug information

= 1.9.81 =
* Security update: Changed database table name from tidycal_settings to tidybot_settings
* Updated trial link to https://thevikingwebdesign.com/tidybot-14day-trial
* Added website domain to subscription verification
* Fixed database table migration

= 1.9.80 =
* Fixed database structure issues by ensuring all required columns exist
* Added robust column verification and creation system
* Improved database table repair system for compatibility across all hosting environments
* Fixed errors related to missing database columns
* Enhanced plugin stability when running on various WordPress configurations
* Added rounded corners to the booking container for improved aesthetics
* Reduced toggle button size from 80px to 65px for less intrusive appearance
* Improved database prefix handling for compatibility with all WordPress configurations
* Enhanced plugin stability with better database table creation and validation
* Fixed issues with color picker in admin settings
* Added database caching for improved performance and reduced direct database queries
* Fixed nonce verification warnings for better security compliance
* Optimized database operations with proper phpcs:ignore comments
* Various code optimizations and cleanup

== Upgrade Notice ==

= 1.9.85 =
TidyCal embed link in settings, subscription check hourly, Plugin Check compliant.

= 1.9.82 =
Production-ready update! Removes all debug logging and console output for clean production deployment. All functionality maintained while cleaning up the codebase.

= 1.9.80 =
Critical update! Fixes database structure issues that could prevent plugin operation on some hosts. Adds required columns and includes visual improvements with rounded corners and a smaller toggle button.

= 1.9.79 =
This update improves compatibility with various WordPress configurations, enhances plugin stability, fixes color picker issues in admin settings, and includes various code optimizations. Recommended for all users.

== Configuration ==

1. **Email Address**: Required for subscription verification and for the widget to display
2. **TidyCal Embed Code**: Paste your TidyCal embed code from your Tidycal account
3. **Button Color**: Choose a color for the widget button that matches your site's branding
4. **Chat Position**: Select the position where the chat widget should appear (bottom-right or bottom-left)
5. **Delay Time**: Set the time in seconds before the widget automatically opens (0 = never)

== External Services ==

This plugin connects to the following external services:

1. TidyCal Booking System
   What this service is for: TidyCal is used to embed your appointment scheduling calendar within the chat widget on your website.
   Data sent: The TidyCal embed code that you configure in the plugin settings.
   When data is sent: When a visitor views a page where the Tidybot widget is displayed.
   Service provider: TidyCal (https://tidycal.com)
   JavaScript loaded from: https://asset-tidycal.b-cdn.net/js/embed.js
   What the JavaScript does: Loads the TidyCal booking widget interface and handles appointment scheduling functionality.
   Terms of Service: https://tidycal.com/terms-of-service
   Privacy Policy: https://tidycal.com/privacy-policy

2. The Viking Webdesign API
   What this service is for: This service verifies your subscription status for using the plugin.
   Data sent: The email address you enter in the plugin settings.
   When data is sent: During initial plugin setup, when settings are updated, and periodically (every hour) to validate your subscription.
   Service provider: The Viking Webdesign (https://thevikingwebdesign.com)
   API endpoint: https://thevikingwebdesign.com/wp-content/check-subscription
   Terms of Service: https://thevikingwebdesign.com/terms-of-service
   Privacy Policy: https://thevikingwebdesign.com/privacy-policy

3. Plugin Update Service
   What this service is for: This service checks for and delivers plugin updates.
   Data sent: Your site URL and current plugin version.
   When data is sent: Periodically when WordPress checks for plugin updates.
   Service provider: The Viking Webdesign (https://thevikingwebdesign.com)
   Update URL: https://thevikingcoaching.com/wp-content/downloads/tidybotC.json
   What data is received: Plugin version information and update files when available.
   Terms of Service: https://thevikingwebdesign.com/terms-of-service
   Privacy Policy: https://thevikingwebdesign.com/privacy-policy

4. Content Delivery Network (CDN)
   What this service is for: Fast and reliable delivery of JavaScript files needed for the booking widget.
   Service provider: BunnyCDN (via TidyCal)
   Domain used: asset-tidycal.b-cdn.net
   What is loaded: JavaScript files for widget functionality
   When accessed: When a page with the booking widget is loaded
   Data sent: Standard HTTP request data (user agent, IP address)
   Terms of Service: https://bunny.net/terms/
   Privacy Policy: https://bunny.net/privacy/