Simple-Calendar icon indicating copy to clipboard operation
Simple-Calendar copied to clipboard

This is to clear cache on first activation or manualy update

Open Akhill2020 opened this issue 2 months ago • 1 comments

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 avatar Oct 31 '25 12:10 Akhill2020

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

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.

coderabbitai[bot] avatar Oct 31 '25 12:10 coderabbitai[bot]