Skip to content

feat: add Clear Cache button to Freemius block sidebar (0.5.0)#63

Draft
evrpress wants to merge 7 commits into
developfrom
feature/clear-cache-button
Draft

feat: add Clear Cache button to Freemius block sidebar (0.5.0)#63
evrpress wants to merge 7 commits into
developfrom
feature/clear-cache-button

Conversation

@evrpress

@evrpress evrpress commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

Adds a "Clear Cache" button in two Freemius sidebar locations: below the mapping info text on child blocks, and next to Reset Modifications on the parent scope panel.

Introduces a shared ClearCacheButton component wired to POST /freemius/v1/cache/clear via the API store, with a force-refetch of pricing data so block content updates immediately. Shown only to users with manage_options. Files: src/scope/ClearCacheButton.js, MappingSettings.js, Settings.js. Targets release 0.5.0.
image

Editors previously had no in-editor way to bypass server/client API caches when Freemius product data changed; they had to wait for cache expiry or use workarounds.

Open WordPress Playground Preview

evrpress and others added 7 commits June 28, 2026 13:02
Adds a "Clear Cache" button in two Freemius sidebar locations: below the mapping info text on child blocks, and next to Reset Modifications on the parent scope panel.

Introduces a shared ClearCacheButton component wired to POST /freemius/v1/cache/clear via the API store, with a force-refetch of pricing data so block content updates immediately. Shown only to users with manage_options. Files: src/scope/ClearCacheButton.js, MappingSettings.js, Settings.js. Targets release 0.5.0.

Editors previously had no in-editor way to bypass server/client API caches when Freemius product data changed; they had to wait for cache expiry or use workarounds.
Updated the useApi hook to ensure local data is kept in sync with the shared store. If cached data is available, it sets the local data accordingly; if local data exists without cached data, it resets the local data to null. This change improves data consistency after cache clear and refetch operations.
…nent

Wrapped the ClearCacheButton in a Flex component to justify it to the end, enhancing the layout of the MappingSettings interface.
…sage

Added the ClearCacheButton to the Edit component, enhancing the user interface by placing it alongside the Select Scope button within a Flex container. Updated the ClearCacheButton to remove the size prop for consistency across components. This change improves accessibility to cache clearing functionality directly from the block editor.
Keep Cursor config in a local nested repo under .cursor/ and ignore
it in the plugin repository so it is not pushed to origin.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant