Skip to content

Enhance RSVP system with anonymous submissions, guest counts, and improved testing infrastructure#1179

Merged
mauteri merged 37 commits intodevelopfrom
feature/GP-1086
Nov 4, 2025
Merged

Enhance RSVP system with anonymous submissions, guest counts, and improved testing infrastructure#1179
mauteri merged 37 commits intodevelopfrom
feature/GP-1086

Conversation

@mauteri
Copy link
Copy Markdown
Contributor

@mauteri mauteri commented Aug 26, 2025

Description of the Change

This PR introduces significant enhancements to the GatherPress RSVP system, focusing on expanding functionality for non-logged-in
users and improving code maintainability.

🚀 New Features

Anonymous RSVP Support

  • Added support for anonymous RSVP submissions with name and email fields
  • Implemented guest count functionality for RSVPs
  • Added email update opt-in preferences for non-logged-in users
  • Enhanced RSVP form with conditional field visibility based on user authentication status

Token-Based Authentication

  • Expanded Rsvp_Token class with factory pattern for token creation and validation
  • Added from_token_string() and from_url_parameter() methods for flexible token handling
  • Improved token security and validation logic

Email Communication System

  • Added new EmailNotificationManager component for managing email notifications
  • Created dedicated email modal store (src/stores/email-modal.js) for state management
  • Enhanced email communication UI with better user experience

🔧 Technical Improvements

HTTP Input Handling Refactor

  • Created Utility::get_http_input() wrapper for secure and testable HTTP input processing
  • Added Utility::get_wp_referer() wrapper with testing capabilities
  • Implemented WordPress-style pre_ filter pattern for test mocking (test-environment only for security)
  • Removed redundant wrapper methods throughout codebase in favor of centralized utility

Form Processing Enhancements

  • Updated RSVP form schema to support new field types (gatherpress_rsvp_guests, gatherpress_rsvp_anonymous,
    gatherpress_event_updates_opt_in)
  • Enhanced form visibility handling with data attributes and conditional rendering
  • Improved form submission flow with better success/error state management

Code Quality & Standards

  • Added proper use statements throughout codebase, eliminating fully-qualified namespace calls
  • Enhanced CSS class checking with Utility::has_css_class() to prevent false positive substring matches
  • Fixed PHP 8.4 compatibility issues with nullable type declarations
  • Resolved PHPStan static analysis issues

🧪 Testing Infrastructure Overhaul

Comprehensive Test Coverage

  • Restored and enhanced unit tests for HTTP input handling with multiple sanitizer functions
  • Added extensive test coverage for Rsvp_Token functionality (18 new test methods)
  • Enhanced Rsvp_Setup tests with proper WordPress environment simulation
  • Created comprehensive utility tests covering edge cases and special characters

Testing Methodology Improvements

  • Replaced global variable mocking with WordPress filter-based testing patterns
  • Implemented secure test-only filters using WP_TESTS_DOMAIN and PHPUNIT_RUNNING checks
  • Fixed test environment simulation for proper RSVP form handling
  • Added proper callable sanitizer function testing

📝 Additional Changes

  • Updated composer dependencies and resolved version conflicts
  • Enhanced modal management system for better user interactions
  • Improved event REST API with additional validation and security measures
  • Updated JavaScript components for better React patterns and state management
  • Fixed various linting issues (PHP CodeSniffer, PHPStan, ESLint)

🔒 Security Considerations

  • Test-only filter access restricted to unit test environments
  • Enhanced token validation with proper factory pattern
  • Improved input sanitization with callable sanitizer functions
  • Added proper nonce handling and caching headers for security

Closes #1086 #1157 #1158

How to test the Change

Changelog Entry

Added - New feature
Changed - Existing functionality
Deprecated - Soon-to-be removed feature
Removed - Feature
Fixed - Bug fix
Security - Vulnerability

Credits

Props @mauteri

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

mauteri added 30 commits August 26, 2025 11:14
@mauteri mauteri changed the title Update RSVP No-Status template with Open RSVP form. Enhance RSVP system with anonymous submissions, guest counts, and improved testing infrastructure Nov 2, 2025
@mauteri mauteri marked this pull request as ready for review November 2, 2025 01:23
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 2, 2025

Preview changes with Playground

You can preview the recent changes for PR#1179 with the following PHP versions:

PHP Version 8.3

PHP Version 7.4

Download .zip with build changes

Made with 💙 from GatherPress & a little bit of WordPress Playground. Changes will not persist between sessions.

@mauteri mauteri requested a review from jmarx November 2, 2025 19:13
@jmarx
Copy link
Copy Markdown
Collaborator

jmarx commented Nov 4, 2025

LGTM

@mauteri mauteri merged commit 99d6467 into develop Nov 4, 2025
17 checks passed
@mauteri mauteri deleted the feature/GP-1086 branch November 4, 2025 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update RSVP No-Status Template to Add Guest RSVP UI

2 participants