Skip to content

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

Description

@donnchawp

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:

$generated = '';
if ( is_file( ABSPATH . $page . '/index.html' ) )
    $generated = '<input class="button-secondary" type="Submit" name="deletepage" value="' . $page . '">';
$out .= "<tr><td><input type='text' $readonly name='direct_pages[]' size='30' value='$page' /></td><td>$generated</td></tr>";

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions