Skip to content

Conversation

@jdevalk
Copy link
Member

@jdevalk jdevalk commented Feb 5, 2026

Summary

  • sanitize_bool (admin/admin.php): ($value || !empty($value)) is equivalent to (bool) $value
  • function_exists checks (admin/comment-parent.php): add_meta_box (WP 2.5+) and wp_doing_ajax (WP 4.7+) are guaranteed to exist
  • filter_notification_headers (inc/notifications.php): two branches with duplicated header-append logic merged into one
  • comment_action_links (inc/clean-emails.php): build-then-rtrim replaced with implode
  • should_add_task (inc/progress-planner/): if/return true/return false simplified to direct boolean return
  • get_remove_comment_url_link (inc/hacks.php): redundant isset() before instanceof removed

Test plan

  • Verify comment parent meta box still appears on comment edit screen
  • Verify AJAX reply-to-comment and admin comment editing still work
  • Verify notification emails still include Reply-To header
  • Verify notification/moderation email action links render correctly
  • Verify boolean options (comment policy, clean emails) save correctly from settings page

🤖 Generated with Claude Code

- sanitize_bool: replace redundant logic with (bool) cast
- comment-parent: remove function_exists checks for ancient WP functions
- notifications: deduplicate filter_notification_headers branches
- clean-emails: use implode instead of build-then-rtrim for action links
- progress-planner: simplify should_add_task to direct boolean returns
- hacks: remove redundant isset before instanceof check

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:11
@github-actions
Copy link

github-actions bot commented Feb 5, 2026

🔍 WordPress Plugin Check Report

⚠️ Status: Passed with warnings

📊 Report

🎯 Total Issues ❌ Errors ⚠️ Warnings
1 0 1

⚠️ 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