Skip to content

Investigate reported REST API 404 responses#483

Merged
galbus merged 14 commits intomainfrom
s-7904-el-libero-wordpress-issues-since-update
Feb 17, 2026
Merged

Investigate reported REST API 404 responses#483
galbus merged 14 commits intomainfrom
s-7904-el-libero-wordpress-issues-since-update

Conversation

@galbus
Copy link
Copy Markdown
Contributor

@galbus galbus commented Feb 8, 2026

A publisher has reported 404 responses from the REST API.

This pull request focuses on improving the plugin's robustness when handling audio generation for posts, particularly in scenarios involving duplicate REST API triggers and handling stale audio content IDs. The changes include both code updates and new tests to ensure correct behavior.

REST API deduplication and 404 recovery:

  • The plugin now skips the redundant wp_after_insert_post action triggered by Gutenberg's meta box save, preventing duplicate API calls when saving posts. (src/Core/Core.php, tests/phpunit/Core/CoreTest.php) [1] [2]
  • If an audio update request to the REST API returns a 404 (indicating stale or missing content), the plugin clears the old content and podcast IDs from post meta and creates new audio content. (src/Core/Core.php, tests/phpunit/Core/CoreTest.php) [1] [2]

Testing and documentation:

  • Added comprehensive PHPUnit tests to verify that the plugin correctly skips redundant requests and recovers from 404 errors by clearing legacy IDs and generating new audio content. (tests/phpunit/Core/CoreTest.php)
  • Updated the changelog and inline documentation to reflect these fixes and improvements. (readme.txt, src/Core/Core.php) [1] [2]

These changes enhance the reliability of the audio generation workflow, especially when posts are edited using the Gutenberg editor or when stale content references exist.

@linear
Copy link
Copy Markdown

linear bot commented Feb 8, 2026

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 8, 2026

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

Copy link
Copy Markdown
Contributor

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 robustness of the BeyondWords WordPress plugin’s post-save audio generation flow by preventing duplicate REST API triggers in Gutenberg and attempting recovery when updating stale audio content returns a 404.

Changes:

  • Skip the redundant wp_after_insert_post invocation caused by Gutenberg’s meta box compat request.
  • Add “404 recovery” behavior: clear stored content/podcast IDs and create new audio content when an update fails due to missing remote content.
  • Add PHPUnit coverage for deduplication and 404 recovery scenarios; bump version metadata and update changelog.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Core/Core.php Adds meta-box-loader deduplication guard and 404 recovery path in generateAudioForPost().
tests/phpunit/Core/CoreTest.php Adds tests for deduplication behavior and 404 recovery/legacy ID clearing.
readme.txt Updates stable tag and changelog entry for the release.
speechkit.php Bumps plugin header/version constant to 6.0.5-beta.1.
package.json Bumps package version to 6.0.5-beta.1.

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

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 8, 2026

@galbus I've opened a new pull request, #484, to work on those changes. Once the pull request is ready, I'll request review from you.

…effects

Co-authored-by: galbus <665537+galbus@users.noreply.github.com>
Copilot AI and others added 6 commits February 8, 2026 22:05
Co-authored-by: galbus <665537+galbus@users.noreply.github.com>
Co-authored-by: galbus <665537+galbus@users.noreply.github.com>
Co-authored-by: galbus <665537+galbus@users.noreply.github.com>
Co-authored-by: galbus <665537+galbus@users.noreply.github.com>
Co-authored-by: galbus <665537+galbus@users.noreply.github.com>
Fix test global state mutation for $_REQUEST['meta-box-loader']
@galbus galbus merged commit 5936669 into main Feb 17, 2026
2 checks passed
@galbus galbus deleted the s-7904-el-libero-wordpress-issues-since-update branch February 17, 2026 13:56
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.

4 participants