Skip to content

feat(plugins): add auto update status to plugin response#15

Merged
alaminfirdows merged 1 commit into
developfrom
feat/auto-update-status
Oct 22, 2025
Merged

feat(plugins): add auto update status to plugin response#15
alaminfirdows merged 1 commit into
developfrom
feat/auto-update-status

Conversation

@itsrafsanjani
Copy link
Copy Markdown
Member

@itsrafsanjani itsrafsanjani commented Oct 21, 2025

Summary by CodeRabbit

  • New Features
    • Plugins API now includes auto-update status information for each plugin, indicating whether automatic updates are enabled.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Oct 21, 2025

Walkthrough

Added 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 auto_update field indicating whether it is configured for automatic updates.

Changes

Cohort / File(s) Summary
Plugin Auto-Update Status
includes/Api/Plugins.php
Retrieves auto-update plugin list via get_site_option('auto_update_plugins', []) and adds auto_update field to plugin response objects, set based on membership in the auto-update array.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A plugin that updates all by itself,
No need to wait upon a shelf,
The API now knows which ones to keep,
Auto-updating through the night so deep! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "feat(plugins): add auto update status to plugin response" is fully aligned with the changeset. The primary change in the PR is the addition of an auto_update field to plugin response objects, which is exactly what the title describes. The title is specific and clear, using standard commit conventions, and accurately summarizes the main change without being vague or misleading. A reviewer scanning the repository history would immediately understand that this PR adds auto-update status information to the plugin API response.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/auto-update-status

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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. The get_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

📥 Commits

Reviewing files that changed from the base of the PR and between 7673cf6 and be4c9bf.

📒 Files selected for processing (1)
  • includes/Api/Plugins.php (2 hunks)
🔇 Additional comments (1)
includes/Api/Plugins.php (1)

62-62: LGTM!

The auto_update field is correctly implemented using strict comparison in in_array(), which is a best practice. The field seamlessly integrates with the existing response structure.

@alaminfirdows alaminfirdows merged commit 5e1f078 into develop Oct 22, 2025
2 checks passed
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