Skip to content

Fix get_option_from_cache returning key instead of value#176

Open
jdevalk wants to merge 4 commits intodevelopfrom
fix/get-option-from-cache
Open

Fix get_option_from_cache returning key instead of value#176
jdevalk wants to merge 4 commits intodevelopfrom
fix/get-option-from-cache

Conversation

@jdevalk
Copy link
Member

@jdevalk jdevalk commented Feb 5, 2026

Summary

  • get_option_from_cache() returned $option (the key name) instead of $options[$option] (the value)
  • This made the is_array() check in upgrade() always false, so legacy options from pre-1.0 (MinComLengthOptions, min_comment_length_option, CommentRedirect) were never migrated
  • Fixed by returning $options[$option]

Test plan

  • If any ancient pre-1.0 installations exist with old option names, they would now be migrated correctly
  • For modern installations this is a no-op since those old options don't exist

🤖 Generated with Claude Code

The method returned the option name (key) instead of the option value,
making the downstream is_array() check always false and the entire
legacy option migration block dead code.

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

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