Automattic / Automattic/wp-super-cache

Directly Cached Files: the "Delete cached file" cell is blank with no explanation until the file exists

Open Beginner friendly
#1,098 0 comments 0 reactions 0 assignees View on GitHub
bug ready-for-agent
Dominant language
PHP
Stars
436
Forks
130
Avg merge
15h 11m
Merged PRs (30d)
10

Description

## Summary

On Settings → WP Super Cache → Advanced, the "Directly Cached Files" table has a column headed **Delete cached file**, but the cell is empty for any page whose static file has not been generated yet.

`partials/lockdown.php:49-52`:

```php
$generated = '';
if ( is_file( ABSPATH . $page . '/index.html' ) )
$generated = '';
$out .= "$generated";
```

The logic is defensible — there is no file to delete, so there is no button. The problem is that nothing says so. You add a direct page, the row appears immediately, and the column that is supposed to act on it is blank with no explanation.

## Steps

1. Advanced tab → "Directly Cached Files" → add a direct page, e.g. `/about/`.
2. The row appears with an empty cell under "Delete cached file".
3. Visit `/about/` as an anonymous user so the static file is generated.
4. Reload the settings page — the button is now there.

Between steps 2 and 3 the UI reads as broken rather than as "nothing to do yet".

## Suggested fix

Render something in the empty cell — an em dash, or text along the lines of "Not generated yet". The help text below the table already explains the mechanism ("The cached file will be generated the next time an anonymous user visits that page"), so the cell only needs to point at it rather than repeat it.

## Not this issue

Removing the *entry* from the list is a separate gap — see the companion issue. "Delete cached file" deletes the generated HTML and leaves the entry in place, which is the correct scope for that button but is easy to mistake for a remove control.

Suggested labels: `bug`, `ready-for-agent`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in partials/lockdown.php around lines 49-52, where the Directly Cached Files row leaves the delete cell empty when index.html is absent. Check the Advanced settings table with a newly added direct page and after visiting it anonymously; done means the pre-generation state is explained while the delete button still appears once the file exists.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
frontend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.