Investigate reported REST API 404 responses#483
Merged
Conversation
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
Contributor
There was a problem hiding this comment.
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_postinvocation 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.
Contributor
…effects 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>
Co-authored-by: galbus <665537+galbus@users.noreply.github.com>
Fix test global state mutation for $_REQUEST['meta-box-loader']
nklhtv
approved these changes
Feb 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
wp_after_insert_postaction 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]src/Core/Core.php,tests/phpunit/Core/CoreTest.php) [1] [2]Testing and documentation:
tests/phpunit/Core/CoreTest.php)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.