Skip to content

Conversation

@Akhill2020
Copy link
Contributor

@Akhill2020 Akhill2020 commented Oct 31, 2025

Description: There was an request from customer in which they want to auto clear cache on first activation or manualy update plugin.

Clickup: https://app.clickup.com/t/86d0m9edk

Summary by CodeRabbit

  • Bug Fixes
    • Improved plugin activation by ensuring feed caches are properly cleared, preventing stale cached data from persisting after installation.

@Akhill2020 Akhill2020 requested a review from rosinghal October 31, 2025 12:03
@coderabbitai
Copy link

coderabbitai bot commented Oct 31, 2025

Walkthrough

A cache-clearing step is added to the plugin activation process. The simcal_delete_feed_transients() function is called to clear feed transients immediately after default terms and options are created, before the simcal_activated action is triggered.

Changes

Cohort / File(s) Summary
Activation Cache Clearing
includes/installation.php
Adds call to simcal_delete_feed_transients() during plugin activation to clear feed transients before triggering the simcal_activated action

Sequence Diagram(s)

sequenceDiagram
    participant Activation
    participant Installation as installation.php
    participant Cache as Cache System
    participant Actions as Action Hooks

    Activation->>Installation: Activation triggered
    Installation->>Installation: Create default terms
    Installation->>Installation: Create default options
    rect rgba(100, 200, 100, 0.2)
        note right of Installation: New: Clear cache
        Installation->>Cache: simcal_delete_feed_transients()
        Cache-->>Installation: Transients cleared
    end
    Installation->>Actions: do_action('simcal_activated')
    Actions-->>Installation: Action complete
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify simcal_delete_feed_transients() function exists and is properly defined
  • Confirm placement in activation flow is appropriate (after initialization, before action trigger)
  • Ensure no unintended side effects from clearing transients at this stage

Poem

🐰 Hop, hop, during activation's dance,
We clear those transient crumbs with our prance,
Fresh cache, fresh cache, before we say "go,"
Feed terms now gleam with a shimmer and glow!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "This is to clear cache on first activation or manualy update" is partially related to the actual changeset. The code change adds cache clearing (simcal_delete_feed_transients()) during the activation hook, which directly matches the "first activation" part of the title. While the title also references "manually update," the raw summary only shows activation-related changes, and the title contains a typo ("manualy" instead of "manually"). Despite these issues, the core message—cache clearing on activation—is clearly reflected in the code changes shown.
✨ 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 issue-clear-cache-on-activation

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.

@Akhill2020 Akhill2020 changed the title This is to clear cache on plugin update This is to clear cache on first activation or manualy update Nov 3, 2025
@github-actions
Copy link

github-actions bot commented Jan 2, 2026

This pull request has been marked as stale due to inactivity. It will be closed in 30 days if no further updates are made.

@github-actions github-actions bot added the stale label Jan 2, 2026
@Akhill2020 Akhill2020 merged commit ff94d3d into main Jan 6, 2026
3 checks passed
@Akhill2020 Akhill2020 deleted the issue-clear-cache-on-activation branch January 6, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants