Skip to content

Disable contact forms on past WordCamp sites#1656

Open
dd32 wants to merge 4 commits into
productionfrom
fix/claude/1468-disable-past-contact-forms
Open

Disable contact forms on past WordCamp sites#1656
dd32 wants to merge 4 commits into
productionfrom
fix/claude/1468-disable-past-contact-forms

Conversation

@dd32
Copy link
Copy Markdown
Member

@dd32 dd32 commented Mar 24, 2026

Summary

  • Replaces Jetpack contact form HTML with a message on past WordCamp sites to reduce spam to organizers
  • Forms are disabled when either:
    1. A newer event site exists for the same city (using existing get_latest_home_url() logic), OR
    2. The event ended more than 18 months ago (covers cities that stopped hosting events)
  • The replacement message directs visitors to the latest edition (if one exists) and always includes a link to report Code of Conduct concerns to the WordPress Incident Response Team at reports@wordpress.org
  • Uses the jetpack_contact_form_html filter as suggested by @jeherve in the issue discussion
  • Added to latest-site-hints.php as suggested by @dd32

Implementation details

  • Reuses the existing get_latest_home_url() function and get_wordcamp_post() end date logic
  • Events still in progress (within 1 day of end date) keep their forms active
  • The 18-month grace period ensures forms stay active for slightly longer than a year after the event, giving time for a new edition to be scheduled

Test plan

  • Visit a past WordCamp site that has a newer edition — verify contact form is replaced with message linking to the new site
  • Visit the most recent WordCamp site for a city — verify contact form still works
  • Verify the Code of Conduct reporting link appears in the replacement message
  • Visit a site whose event ended less than 18 months ago with no newer site — verify form still works
  • Visit a site whose event ended more than 18 months ago with no newer site — verify form is replaced

Fixes #1468

🤖 Generated with Claude Code

dd32 and others added 4 commits March 24, 2026 11:36
Replace Jetpack contact form HTML with a message when:
1. A newer event site exists for the same city, OR
2. The event ended more than 18 months ago.

This reduces spam sent to organizers of past events. The replacement
message directs visitors to the latest edition (if available) and
includes a link to report Code of Conduct concerns to the WordPress
Incident Response Team.

Uses the jetpack_contact_form_html filter as suggested in the issue
discussion.

Fixes #1468

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Optimization per review feedback: avoid the expensive database query
to find a newer site during the first 3 months after an event ends,
since a new edition is unlikely to exist that soon.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests the contact form disabling logic for past WordCamp sites:
- Past event with newer site disables form with redirect message
- Current/future event keeps form active
- Recent past event without newer site keeps form active
- Old past event (>18 months) disables form
- Disabled form includes Code of Conduct reporting link
- Event with no end date keeps form active

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Automatically disable Jetpack Contact forms when the site is no longer the most recent edition.

1 participant