feat(plugins): add auto update status to plugin response#15
Conversation
WalkthroughAdded auto-update status tracking to plugin API responses by retrieving the site's auto-update plugin list and extending each plugin response object with an Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
includes/Api/Plugins.php (1)
36-39: Option name confirmed correct; consider type safety per WordPress patterns.The option name
'auto_update_plugins'is correct and matches WordPress core conventions. Theget_site_option()usage with a default array is the correct pattern for retrieving the array of plugin file paths that have auto-updates enabled.For added robustness, WordPress documentation examples show casting to array:
(array) get_site_option( 'auto_update_plugins', array() ), which guards against data corruption:- $auto_updates = get_site_option( 'auto_update_plugins', [] ); + $auto_updates = (array) get_site_option( 'auto_update_plugins', [] );
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
includes/Api/Plugins.php(2 hunks)
🔇 Additional comments (1)
includes/Api/Plugins.php (1)
62-62: LGTM!The
auto_updatefield is correctly implemented using strict comparison inin_array(), which is a best practice. The field seamlessly integrates with the existing response structure.
Summary by CodeRabbit