Skip to content

Fix repeat redirect overriding first-time commenter redirect#175

Open
jdevalk wants to merge 5 commits intodevelopfrom
fix/comment-redirect-logic
Open

Fix repeat redirect overriding first-time commenter redirect#175
jdevalk wants to merge 5 commits intodevelopfrom
fix/comment-redirect-logic

Conversation

@jdevalk
Copy link
Member

@jdevalk jdevalk commented Feb 5, 2026

Summary

  • The repeat-redirect block ran unconditionally, always overwriting the first-time redirect
  • When both redirect_page and redirect_repeat_page were configured, first-time commenters would incorrectly get the repeat redirect
  • Fixed by making the repeat redirect an elseif so it only applies to repeat commenters

Test plan

  • Configure both a first-time redirect page and a repeat redirect page
  • Submit a comment as a first-time commenter — should redirect to the first-time page
  • Submit a comment as a repeat commenter — should redirect to the repeat page

🤖 Generated with Claude Code

The repeat-redirect block was not inside an else branch, so when
redirect_repeat_page was set it would always overwrite the first-time
redirect URL. Now the repeat redirect only applies to repeat commenters.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Feb 5, 2026

Test on Playground
Test this pull request on the Playground
or download the zip

jdevalk and others added 2 commits February 5, 2026 12:05
@github-actions
Copy link

github-actions bot commented Feb 5, 2026

🔍 WordPress Plugin Check Report

❌ Status: Failed

📊 Report

🎯 Total Issues ❌ Errors ⚠️ Warnings
2 1 1

❌ Errors (1)

📁 readme.txt (1 error)
📍 Line 🔖 Check 💬 Message
0 stable_tag_mismatch Mismatched Stable Tag: 2.1.6 != 2.1.7. Your Stable Tag is meant to be the stable version of your plugin and it needs to be exactly the same with the Version in your main plugin file's header. Any mismatch can prevent users from downloading the correct plugin files from WordPress.org.

⚠️ Warnings (1)

📁 comment-hacks.php (1 warning)
📍 Line 🔖 Check 💬 Message
0 textdomain_mismatch The "Text Domain" header in the plugin file does not match the slug. Found "yoast-comment-hacks", expected "comment-hacks".

🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

@jdevalk jdevalk requested a review from aristath February 5, 2026 12:32
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.

2 participants