Skip to content

Addressing PR comments#1200

Closed
Claude wants to merge 3 commits intomasterfrom
claude/show-actual-clock-timestamps
Closed

Addressing PR comments#1200
Claude wants to merge 3 commits intomasterfrom
claude/show-actual-clock-timestamps

Conversation

@Claude
Copy link
Copy Markdown

@Claude Claude AI commented Mar 23, 2026

Original prompt

This section details on the original issue you should resolve

<issue_title>Show actual clock timestamps on import list (Last Run / Next Run columns)</issue_title>
<issue_description>## Problem

The import list page shows only relative times ("Ran 3 hours 12 minutes ago", "2 hours") for Last Run and Next Run columns. Users debugging timing issues or verifying cron behavior need actual timestamps to correlate with server logs, feed update times, and hosting cron schedules.

Solution

import.php — Add date_i18n() formatted timestamps below the existing relative times in both columns:

  • Last Run: append <br><small style="color:#888;">March 23, 2026 14:30</small> below "Ran X hours Y minutes ago"
  • Next Run: same pattern below the human_time_diff() output
  • Uses WordPress get_option('date_format') and get_option('time_format') to respect site locale settings

Files Affected

  • includes/admin/feedzy-rss-feeds-import.php

Acceptance Criteria

  • Last Run column shows both relative time and actual timestamp
  • Next Run column shows both relative time and actual timestamp
  • Timestamps respect WordPress date/time format settings
  • Timestamp is visually de-emphasized (small, gray) so it doesn't clutter the UI
  • "Never Run" state is unchanged (no timestamp shown)

Priority: Medium — UX improvement for debugging
Regression risk: None — display-only change</issue_description>

Comments on the Issue (you are @claude[agent] in this section)

Shows WordPress-formatted timestamps below relative times in import list.
Uses date_i18n() with site date/time format settings.
Timestamps are visually de-emphasized (small, gray).
Only display-only changes - no functional modifications.

Co-authored-by: ineagu <1849868+ineagu@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Codeinwp/feedzy-rss-feeds/sessions/a6dbeeaf-bb57-4df5-ba98-1b34eb0805ed
@Claude Claude AI changed the title [WIP] Add actual clock timestamps on import list Add actual timestamps to import list Last Run / Next Run columns Mar 23, 2026
@Claude Claude AI requested a review from ineagu March 23, 2026 15:14
@ineagu ineagu requested a review from Copilot March 23, 2026 15:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves the Feedzy Imports list table UX by displaying an absolute, site-localized timestamp alongside the existing relative “Last Run” and “Next Run” times to help users correlate imports with server logs and cron schedules.

Changes:

  • Appends a WordPress date/time formatted timestamp below “Last Run” relative time when a job has run.
  • Appends a WordPress date/time formatted timestamp below “Next Run” relative time when a job is scheduled.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 939 to 943
$date_format = get_option( 'date_format' );
$time_format = get_option( 'time_format' );
$timestamp = date_i18n( $date_format . ' ' . $time_format, $last );
$msg .= '<br><small style="color:#888;">' . esc_html( $timestamp ) . '</small>';
}
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this list-table callback, get_option( 'date_format' ) / get_option( 'time_format' ) are fetched for every row and column. Even with WP option caching, it’s avoidable duplication—consider caching the combined format (or both options) once per request (e.g., static vars) and reusing it for both Last Run / Next Run rendering.

Copilot uses AI. Check for mistakes.
Comment on lines +959 to +964
echo wp_kses_post( human_time_diff( $next, time() ) );
// Add actual timestamp below relative time.
$date_format = get_option( 'date_format' );
$time_format = get_option( 'time_format' );
$timestamp = date_i18n( $date_format . ' ' . $time_format, $next );
echo '<br><small style="color:#888;">' . esc_html( $timestamp ) . '</small>';
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

human_time_diff() is echoed via wp_kses_post(), but the appended <br><small ...> timestamp is echoed without any kses/escaping of the HTML wrapper. Since this is still HTML output, consider building a single string and outputting it via wp_kses_post() (the timestamp itself can remain esc_html()), to keep output escaping consistent within this branch.

Suggested change
echo wp_kses_post( human_time_diff( $next, time() ) );
// Add actual timestamp below relative time.
$date_format = get_option( 'date_format' );
$time_format = get_option( 'time_format' );
$timestamp = date_i18n( $date_format . ' ' . $time_format, $next );
echo '<br><small style="color:#888;">' . esc_html( $timestamp ) . '</small>';
$relative_time = human_time_diff( $next, time() );
// Add actual timestamp below relative time.
$date_format = get_option( 'date_format' );
$time_format = get_option( 'time_format' );
$timestamp = date_i18n( $date_format . ' ' . $time_format, $next );
$output = $relative_time . '<br><small style="color:#888;">' . esc_html( $timestamp ) . '</small>';
echo wp_kses_post( $output );

Copilot uses AI. Check for mistakes.
Comment on lines +939 to +942
$date_format = get_option( 'date_format' );
$time_format = get_option( 'time_format' );
$timestamp = date_i18n( $date_format . ' ' . $time_format, $last );
$msg .= '<br><small style="color:#888;">' . esc_html( $timestamp ) . '</small>';
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file mixes wp_date() (used elsewhere) and date_i18n() (used here) for localized timestamps. Consider using wp_date( $date_format . ' ' . $time_format, (int) $last ) for consistency and future-proofing, since wp_date() is the newer WP API for timezone/locale-aware formatting.

Copilot uses AI. Check for mistakes.
@ineagu
Copy link
Copy Markdown
Contributor

ineagu commented Mar 23, 2026

@claude[agent] can you fix the review items?

…t escaping

- Cache date/time format with static var to avoid repeated get_option() calls per row
- Replace date_i18n() with wp_date() for consistency with rest of codebase
- Build single output string for Next Run and use wp_kses_post() consistently

Co-authored-by: ineagu <1849868+ineagu@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Codeinwp/feedzy-rss-feeds/sessions/65c79e55-9a5a-4071-83f9-6d8396d3dc32
@Claude
Copy link
Copy Markdown
Author

Claude AI commented Mar 23, 2026

@claude[agent] can you fix the review items?

Fixed in 9d9e87f:

  • Date/time format now cached with static variable (fetched once per request instead of per row)
  • Replaced date_i18n() with wp_date() for consistency with existing codebase usage
  • Next Run output built as single string and uses wp_kses_post() consistently

@Claude Claude AI changed the title Add actual timestamps to import list Last Run / Next Run columns Addressing PR comments Mar 23, 2026
@ineagu ineagu closed this Mar 24, 2026
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.

Show actual clock timestamps on import list (Last Run / Next Run columns)

3 participants