Automattic / Automattic/wp-super-cache

Bug: Delete cache button does not trigger wpsc_after_delete_cache_admin_bar hook when used from admin panel

Open
#999 2 comments 0 reactions 0 assignees View on GitHub
[Plugin] Super Cache bug
Dominant language
PHP
Stars
436
Forks
130
Avg merge
15h 11m
Merged PRs (30d)
10

Description

### Impacted plugin

Super Cache

### Quick summary

When deleting cache via button on admin panel side, hook `wpsc_after_delete_cache_admin_bar` is not triggered, as function is called via AJAX call.

### Steps to reproduce

1. Add any action to `wpsc_after_delete_cache_admin_bar`
2. Run cache delete from front site, hook will trigger properly
3. Run cache delete from admin panel
4. Hook will not fire

### A clear and concise description of what you expected to happen.

In that case, hook should be fired with path `/` as cache is purged for entire page then.

### What actually happened

_No response_

### Impact

All

### Available workarounds?

No but the platform is still usable

### Platform (Simple and/or Atomic)

_No response_

### Logs or notes

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the AJAX call used by the admin-panel cache delete button and compare it with the front-site cache deletion path, focusing on the wpsc_after_delete_cache_admin_bar hook. Done means the hook fires for admin-panel deletion with the path set to /, while the existing front-site behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.