noteflowai/ai-chat-for-amazon-bedrock · 1.48.0 · 2026-09-29

choose the content gaps period and export the same window

The Content gaps card on the Conversations screen now has a Period control with Last 7 days, Last 30 days and Last 90 days, plus a Show button. The form does not submit when the select changes. After Show, the summary sentence, the gap table and the empty state cover the chosen window. The empty state names the window and suggests trying a longer period. The period carries over to the Stored exchanges filter, pagination and the Reset link. Reset clears only the log search, source and rating. At 30 days, including when invalid input falls back to 30, none of those forms or URLs gain aicfab_gap_days, and Reset is the plain page URL, as in 1.47.6. Download content gaps CSV exports the window shown on screen. Seven-day and 90-day files are named ai-chat-bedrock-content-gaps-7d-YYYYMMDD-HHMMSS.csv and ...-90d-.... A 30-day file, or one with a missing or rejected period, keeps the legacy name. The columns are unchanged. The new AI_Chat_Bedrock_Insights::gap_window() accepts only an int, or a string of digits alone, equal to 7, 30 or 90. Anything else returns 30. The export handler reads the period only after the manage_options and nonce checks. The version is 1.48.0. The controller ran the checks on commit f279e41. The feature test failed on the base commit, which lacks the feature, and passed on the candidate. On the candidate, bin/prerelease.sh passed: 40 suites, including admin-ux.php, insights.php and the earlier content-gap test test_feature_9ecd4de5ba50.php, which had failed in the prior attempt; phpcs was clean across 75 files. tests/tooling.php and bin/build-package.py also passed (89 files).

Use it

Prerequisites: a WordPress 6.4+ site on PHP 7.4+ with plugin 1.48.0 active, conversation logging turned on in Settings, and a user with manage_options.

1. Create sample input (manual, synthetic). In the site's public chat, ask two questions the site has no content for, for example "What payload can the demo robot arm lift?" twice. Each question needs at least 8 characters. Each is logged as an ungrounded exchange.
2. Go to WP Admin, AI Chat for Amazon Bedrock, Conversations.
3. In the Content gaps card, set Period to Last 7 days and press Show. The summary and table now cover 7 days. Filtering or paging the Stored exchanges log keeps the period.
4. Press Download content gaps CSV. The file is named like ai-chat-bedrock-content-gaps-7d-YYYYMMDD-HHMMSS.csv and has the columns question, occurrences, last_asked_utc, grounded_count and ungrounded_count.

From code, for example with WP-CLI:
wp eval 'var_dump( AI_Chat_Bedrock_Insights::gap_window( "90" ), AI_Chat_Bedrock_Insights::gap_window( "7\n" ) );'
This prints int(90) and int(30).
wp eval 'echo AI_Chat_Bedrock_Insights::export_filename( 7, 0 );'
This prints ai-chat-bedrock-content-gaps-7d-19700101-000000.csv.

Repository checks, run from the plugin root:
php -d zend.assertions=1 -d assert.exception=1 tests/test_feature_ed4081b0c575.php
bash bin/prerelease.sh --php /usr/bin/php

Scope

Only 7, 30 and 90 days are offered. There are no custom date ranges and no saved or per-user preference. Gap grouping, the full-conversation Export CSV, CLI and REST are unchanged. Conversation retention and the MAX_ENTRIES log cap still limit how far back a window reaches. On short-retention sites, 90 days can show the same result as 30. The rendered-HTML checks run the real partial against stubbed WordPress functions, with synthetic seeded entries. The controller's run did not include WordPress Plugin Check or live integration (no --wp-cli was given), nor any browser, screenshot or real-WordPress run for this feature. The 360px wrapping, focus rings and overall look are inferred from the flex-wrap rule and core admin classes; they were not visually verified. bin/audit-accessibility.py remains a manual check against a live site. Passing tests show that the window, URLs and file names behave as specified. They do not show that the gap grouping is accurate for any particular site. The checks ran on PHP 8.4.26; PHP 7.4 and WordPress 6.4 support is the plugin's stated floor and was not re-run here.

Upgrade and rollback

Update to 1.48.0. There is no migration and there are no new options: the period exists only in the request. The default 30-day view, the log filter, pagination and Reset URLs, the CSV columns, and the file name for a download with no period or an invalid one are the same as in 1.47.6. Only 7-day and 90-day downloads get -7d- or -90d- in the name, so any script that collects these files by the legacy pattern should also allow that segment. To roll back, reinstall 1.47.6. The control disappears, any leftover aicfab_gap_days parameter in bookmarks is ignored, and no stored conversations, ratings or settings change in either direction.

Source commit: 530e7e242c2e289fd57acc4751544294023c72a1