# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),  
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

---

## [1.0.2] - 2025-10-27

### Fixed
- **WooCommerce Blocks Checkout**: Fixed "Please verify that you are human" error on checkout
  - Added WooCommerce Store API integration for block-based checkout
  - Implemented multiple fallback methods for token validation
  - Added REST API filter to ensure token is properly captured
  - Fixed duplicate Turnstile loading issues with manual rendering
  - Added comprehensive debug logging for troubleshooting
- **WooCommerce Lost Password**: Fixed issue where the "Please verify that you are human" error would appear even after successful verification
  - Modified `mountdev_turnstile_check()` to conditionally bypass nonce verification when a Turnstile token is passed directly
  - Updated `mountdev_turnstile_woo_reset_check()` to properly handle WooCommerce's nonce verification
- **Button Disabling**: Fixed issue where submit buttons would be disabled even when the "Disable Submit Button" setting was unchecked
  - Updated JavaScript to only disable buttons if the Turnstile widget has a data-callback attribute
- **Elementor Integration**: Fixed critical JavaScript errors preventing form submissions
  - Fixed "Invalid or missing type for parameter 'sitekey', expected 'string', got 'object'" error in form re-render functions
  - Fixed PHP validation to properly accept alphanumeric Elementor form IDs (previously only accepted numeric IDs)
  - Updated callback function references to use proper function objects instead of string names

## [1.0.1] - 2025-10-22

### Fixed
- **Admin Test Form**: Test credentials button now always enabled and functional
  - Removed conditional logic that hid test button after successful verification
  - Added exclusion for admin test form in JavaScript button disabling logic
  - Added exclusion for admin test form in form submission prevention
  - Added nonce verification support for test form in `mountdev_turnstile_check()`
- **WooCommerce Checkout**: Improved Turnstile verification for block-based checkout
  - Enhanced error handling in `mountdev_turnstile_check()` to properly handle WP_Error responses
  - Added JSON decode validation to prevent invalid response processing
  - Fixed error-codes array access using proper object notation
  - Improved strict comparison for success validation (`===` instead of loose comparison)
  - Applied same improvements to `mountdev_turnstile_check_woo_blocks()` function
- **Code Quality**: Enhanced robustness of Cloudflare API response handling across all verification functions

### Changed
- Improved error handling for Cloudflare API communication failures
- Better validation of API responses before processing

---

## [1.0.0] - 2025-10-21

### Changed
- Excluded root assets folder from release package

### Documentation
- Added plugin icons and banner assets
- Enhanced readme.txt with compelling, informative content
- Updated README.md to match enhanced readme.txt structure
- Added comprehensive FAQ section
- Added detailed feature descriptions and use cases
- Added support policy and external services disclosure

---

## [1.0.0-beta] - 2025-10-10

### Added
- Plugin icons and banner for WordPress.org listing
- Screenshots for readme documentation
- Comprehensive documentation updates

### Fixed
- Data sanitization improvements across all forms
- Nonces and user permissions validation for enhanced security
- Enqueue script issues resolved
- Turnstile widget alignment improvements
- Input sanitization for Contact Form 7
- Input sanitization for Elementor forms
- Script version management (semver)
- Processing of complete input data
- WordPress enqueue functions properly implemented
- WordPress comment form integration
- Nonce verification for Elementor integration
- Elementor integration stability
- Removed duplicate external script registration
- Added nonce verification to Contact Form 7
- Added nonce verification to Elementor integration
- Proper escaping throughout the plugin
- Removed error logs from production code
- Renamed labels for clarity
- WooCommerce disable button functionality
- Button disable setting
- WooCommerce authentication improvements
- WooCommerce login issues
- WooCommerce integration stability
- Fluent Forms integration
- WordPress default forms functionality
- Generic function names improved
- Tab render issues
- Variable escaping
- Array access on boolean value
- Nonce verification
- Undocumented use of 3rd party/external service (added disclosure)
- Calling files remotely (security improvement)
- Updated to use wp_enqueue commands properly
- Updated author name
- Updated contributor information
- Updated plugin name
- Updated plugin details
- Test integration key form submission
- Removed duplicate plugin details
- Offload error handling

### Documentation
- Added Kiro documentation
- Updated README with comprehensive information
- Added external services disclosure
- Enhanced plugin description

---

## [1.0.0-alpha] - 2025-10-01

### Added
- **Initial Release**
- Fluent Forms integration with Turnstile
- Elementor Pro support for Turnstile verification
- Contact Form 7 support
- Turnstile validation for WordPress AJAX comments
- WooCommerce Checkout integration with Turnstile
- Turnstile support for WooCommerce authentication pages
- List of supported plugins in the Integrations tab
- WordPress core forms support (login, registration, password reset, comments)
- Customizable widget themes (light, dark, auto)
- Multi-language support
- Flexible appearance modes
- Submit button locking functionality
- Custom error messages
- Widget positioning controls
- Built-in credential testing
- Script deferral options
- WordPress Multisite compatibility
- Developer-friendly hooks and filters

### Changed
- Updated plugin metadata and details
- Improved pill component styles in UI
- Enhanced admin settings page layout and user experience
- Better folder structuring
- Improved form submission persistence

### Fixed
- Resolved issue with Elementor Turnstile theme not being applied
- Fixed "disable button" functionality not working properly in Elementor forms
- Reset button now re-enables correctly on default form page
- CSS and JS version management
- Turnstile undefined warnings
- Various warnings and errors

### Security
- Implemented secret key masking for enhanced security
- Added proper nonce verification throughout
- Implemented data sanitization
- Added user permission checks

### Documentation
- Initial README and documentation
- Changelog documentation
- License file added
- Comprehensive setup guide

---

## [0.0.1] - Initial Development

### Added
- Initial plugin structure
- Basic Turnstile integration
- WordPress form integration
- WooCommerce basic integration
- Admin settings and configurations
- Button control scripts
- Form field styling
- Tailwind CSS setup
- Release script for automating plugin releases
- Package dependencies

### Changed
- Better folder structuring
- Plugin entry point updates

### Removed
- Non-working implementations

---

## Development Notes

### Key Features
- **Enterprise-grade bot protection** using Cloudflare Turnstile
- **Privacy-first approach** - no tracking or unnecessary data collection
- **Lightweight & fast** - optimized for performance
- **Comprehensive form support** - WordPress core, WooCommerce, Contact Form 7, Elementor Pro, Fluent Forms
- **Highly customizable** - themes, languages, positioning, error messages
- **Developer-friendly** - clean code, hooks, filters, WordPress coding standards

### Contributors
- **Cascadia Web Services** - Development and maintenance
- **Isaac A.** (`isaacdarcilla`) - Lead developer

### Support
For support and documentation, visit [Cascadia Web Services](https://cascadiaweb.services/contact)
