Handle Amazon PA-API 403 errors with fallback display#50
Merged
Conversation
…r later) closes #44 Co-authored-by: Claude <noreply@anthropic.com>
- Add Direct Input UI in block editor sidebar for ASIN entry - Add fallback template when PA-API is unavailable - Scrape Amazon product page to get title for fallback display - Cache fallback data with transients (7 days) - Add URL generation methods to AmazonLocales - Allow short ternary operators and short array syntax in phpcs rules refs #49 Co-authored-by: Claude <noreply@anthropic.com>
- Add $fallback parameter (default: true) to get_item_by_asin() - Return fallback data instead of WP_Error when API fails - All existing users automatically get fallback support refs #49 Co-authored-by: Claude <noreply@anthropic.com>
- Internal block rendering uses explicit fallback handling - External API calls still get fallback by default refs #49 Co-authored-by: Claude <noreply@anthropic.com>
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.
Summary
get_item_by_asin()automatically get fallback data by defaultChanges
get_fallback_item(),scrape_amazon_title(), and fallback parameter toget_item_by_asin()get_product_domain()andget_product_url()for URL generation from ASINTest plan
Closes #49
🤖 Generated with Claude Code