OAmazon v1.1.1
The professional Amazon affiliate plugin for WordPress. PA-API 5.0 integration, 15 display types, geo-routing across 17 locales, A/B testing with chi-square significance, FTC-compliant disclosures, and end-to-end click analytics.
What OAmazon does
A first-class Amazon affiliate plugin built for editorial sites: context-aware product cards, statistically rigorous A/B testing, and geo-routing that sends US traffic to amazon.com and UK traffic to amazon.co.uk automatically.
fg-amazon-ads. The 1.1.x release rebrands and adds full Orravo Suite integration: OIntel sync, OEngage tracking, OMailer list crossover.Getting installed
From WordPress admin
oamazon.zip and click Install Now, then Activate.Manual install (FTP / SFTP)
oamazon.zip.oamazon/ folder to /wp-content/plugins/.wp_oam_*), seeds the default FTC disclosure, schedules cron jobs, and flushes rewrite rules for slug-based affiliate links.Up and running in minutes
From plugin install to a live product card embedded in your post.
B08N5WRWNW). The plugin fetches title, price, image via PA-API.[oam_display id="123"] from the display row.Clicks are tracked from the first impression. View per-link analytics under OAmazon → Analytics.
PA-API 5.0 setup
OAmazon ships an AWS Signature V4 client (OAM_API class) that signs every request to Amazon Product Advertising API 5.0.
Required credentials per locale
- Associates ID: your tracking tag (e.g.
mysite-20) - PA-API Access Key: issued by Amazon Associates Central
- PA-API Secret Key: paired with the access key
Each Amazon locale (US, UK, etc.) requires its own credentials. Stored encrypted in the wp_oam_programs table.
What the API client fetches
- Title, brand, bullet points
- Price (current, list, savings), currency
- Availability state
- Rating, review count
- Images (small, medium, large)
- Categories
- Affiliate URL with your tracking tag
Rate limiting & queueing
Amazon enforces 1 request/second per credentials. OAmazon tracks per-credentials throttle in transients. When the limit is hit, overflow requests are written to the oam_api_queue option and processed by cron in the next tick.
Caching
Successful PA-API responses are cached in wp_oam_products with a cached_at timestamp. Subsequent renders use the cache; refresh runs on a schedule to keep prices current.
15 display types
Pick the visual that fits the editorial context: a single product card, a comparison table, a sidebar widget, a sticky deal strip.
| Type | Layout | Best for |
|---|---|---|
card | Product Card | Inline product mention in editorial |
compact | Compact Card | Sidebar, minimal footprint |
button | Mini Button | Inline link with subtle CTA styling |
comparison | Comparison Table | Head-to-head product reviews |
ranked | Ranked List | "Top 10" style listicles |
grid | Bestseller Grid | Category landing pages |
feature | Feature Box | Hero placement above-the-fold |
price_alert | Price Alert Strip | Sticky deal notifications |
image_box | Image Box | Visual-first product showcase |
shelf | Product Shelf | Horizontal scroller of ASINs |
editorial | Editorial Grid | Magazine-style multi-card layout |
deal | Deal Box | Time-sensitive promotions |
quote | Quote Box | Testimonial-style with product |
table | Affiliate Table | Spec / feature comparison |
widget | Sidebar Widget | Persistent sidebar placement |
Display styles
Every display type can be rendered in three style themes: light, dark, or orravo (the editorial theme). Set per-display in the admin or via shortcode attribute.
Geo-routing across locales
A US visitor clicks your link → routed to amazon.com. A UK visitor → amazon.co.uk. A German visitor → amazon.de. The Associates ID for that locale is automatically applied.
Detection priority
CF-IPCountry request header (most reliable, no DB lookup)Country → locale map
| Locale | Countries |
|---|---|
us | US, PR, VI, GU |
uk | GB, IE |
ca | CA |
de | DE, AT, CH |
fr | FR, BE, LU |
it | IT |
es | ES |
jp | JP |
au | AU, NZ |
in | IN |
br | BR |
mx | MX |
sg | SG, MY |
ae | AE, SA, EG |
nl | NL |
se | SE, NO, DK, FI |
tr | TR |
pl | PL, CZ, SK |
wp_oam_links entry. When disabled, the link always points to the locale where it was created.A/B testing with significance
Pit two displays against each other. OAmazon assigns variants client-side, tracks impressions and clicks per variant, and declares a winner once chi-square significance crosses the 95% threshold.
Variant assignment
- Cookie-based: first impression sets
oam_ab_*cookie, 30-day TTL - Sticky: same visitor sees the same variant on every page load
- 50/50 split: random assignment for new visitors
Statistical significance
OAmazon runs a chi-square test on a 2×2 contingency table (variant A clicks/impressions vs variant B clicks/impressions) on every analytics page load. When p-value crosses the 0.95 threshold, the test status flips to resolved and the winner is recorded.
Pseudocode// Contingency table
// Clicks No-click
// A a b
// B c d
//
// chi² = ((a + b + c + d) × (ad − bc)²)
// / ((a + b) × (c + d) × (a + c) × (b + d))
//
// significance = 1 − (1 − chi²_p_value)
// declare winner when significance >= 0.95
Test storage
Tests live in wp_oam_abtests with: name, two display IDs, accumulated clicks/impressions per side, current significance, status (draft, running, resolved), winner display ID, and timestamps.
FTC compliance
Amazon's Operating Agreement requires affiliate disclosure on every page that includes affiliate links. OAmazon handles this automatically.
Auto-injected disclosures
When a post contains an OAmazon affiliate link, the plugin auto-injects a disclosure based on context. Configurable per-context (post, widget, sidebar) with position (before / after) and active toggle.
Default disclosure (seeded on activation):
"This post contains affiliate links. As an Amazon Associate,
we earn from qualifying purchases at no extra cost to you."
Manual injection
Use the shortcode for finer placement:
[oam_disclosure context="post"]
ToS checker
Built-in compliance scanner runs on the admin dashboard and flags:
- Stale prices: cached price older than configured threshold
- Missing review counts: affiliate links lacking required attribution
- Price language: references like "the cheapest" or "the lowest" that violate Amazon ToS
- Missing disclosures: pages with affiliate links but no detected disclosure
Analytics dashboard
Every click is recorded. Per-link, per-display, per-variant, with device, country, and referrer dimensions for filtering and breakdowns.
Per-click stored fields
link_id,post_id,display_idabtest_id,abtest_variant(when click is part of an active test)ip_hash,user_agent_hash(hashed for privacy)country_code(from geo detection)device_type(mobile / desktop / tablet)referrerURLcreated_attimestamp
Dashboard reports
- Summary: total clicks, unique links, top product, device breakdown
- Time series: clicks-over-time line chart, 30-day or weekly rollup
- Top products: clicks grouped by ASIN
- Top posts: clicks grouped by source post
- Geo: distribution by country (top 30)
- Device: mobile / desktop / tablet split
Shortcodes & blocks
Render a saved display
[oam_display id="123"]
References a display configured in the admin. Inherits all settings from the saved display row.
Render an inline display
[oam_product asin="B08N5WRWNW" display="card" style="orravo"]
Renders a one-off display without saving it. Accepts asin (single) or asins (comma-separated for multi-ASIN displays like comparison), display (any of the 15 types), style (light, dark, orravo), and locale.
Inline price & button
[oam_price asin="B08N5WRWNW"]
[oam_button asin="B08N5WRWNW" text="Check current price"]
[oam_price] outputs the cached current price for the visitor's locale. [oam_button] outputs a CTA link routed through the cloaked tracker URL.
FTC disclosure
[oam_disclosure context="post"]
Gutenberg block
A custom Gutenberg block called OAmazon Display is registered for visual placement in the block editor. The block UI exposes display selection, ASIN entry, style picker, and inline preview.
Free vs Pro
OAmazon ships freemium. Free covers single-product use cases; Pro unlocks the analytics, A/B testing, and geo-routing infrastructure.
| Capability | Free | Pro |
|---|---|---|
| Maximum products | 10 ASINs | Unlimited |
| Display types | Card, compact, button, widget | All 15 |
| A/B testing | - | ✓ |
| Geo-routing | - | ✓ |
| REST API | - | ✓ |
| AI keyword scanner | - | ✓ |
| Click analytics | Basic | Full breakdowns + filtering |
| FTC disclosure | ✓ | ✓ |
Pro is unlocked via your Orravo Core license. The oam_is_pro filter exposes the gate for custom integrations.
Suite integrations
OAmazon plugs into the rest of the Orravo Suite when those plugins are active, loaded conditionally on plugins_loaded.
WP-CLI commands
Registered when running under WP-CLI as wp oamazon <command>. Five command namespaces:
| Command | Purpose |
|---|---|
wp oamazon products import --file=<path> [--locale=us] | Bulk import ASINs from a file (one per line) via PA-API |
wp oamazon products import --asins=B08...,B07... | Bulk import a comma-separated ASIN list |
wp oamazon products list | List cached products as a table |
wp oamazon links scan-content | Scan all posts for raw amazon.* URLs (managed and unmanaged) |
wp oamazon links list | List managed affiliate links |
wp oamazon cache flush [--asin=<asin>] [--locale=us] | Flush product cache (one ASIN or all) |
wp oamazon analytics export [--period=30days] [--out=<file>] | Export click analytics to CSV |
wp oamazon health check | Run link health + ToS compliance scan |
Database & REST API
Database tables
| Table | Purpose |
|---|---|
wp_oam_products | Cached PA-API product data per ASIN per locale |
wp_oam_links | Managed affiliate links: slug, label, click_count, geo flag, schedule |
wp_oam_clicks | Per-click event log |
wp_oam_displays | Saved display configurations (type, style, ASINs, settings) |
wp_oam_abtests | A/B test definitions, results, significance |
wp_oam_programs | PA-API credentials per locale |
wp_oam_keywords | Auto-link keywords (scanner) |
wp_oam_disclosures | FTC disclosure entries per context |
REST API endpoints
Namespace: oamazon/v1. Admin endpoints require manage_options; public endpoints are open (rate-limited at the link / display layer).
| Method | Endpoint | Purpose |
|---|---|---|
GET | /products | List all cached products (admin) |
GET | /products/{asin} | Fetch product by ASIN with optional locale (public) |
GET POST | /links | List or create managed links (admin) |
DELETE | /links/{id} | Delete a managed link (admin) |
GET POST | /displays | List or save display configs (admin) |
GET DELETE | /displays/{id} | Get or delete a display config |
GET | /displays/{id}/render | Render display HTML (public) |
GET | /analytics/clicks | Click data by period or link_id (admin) |
GET | /analytics/summary | Dashboard summary stats (admin) |
GET | /abtests | List A/B tests (admin) |
GET | /abtests/{id}/significance | Recompute and return chi-square significance (admin) |
GET | /search | Search products via PA-API by keyword + locale (admin) |
Admin menu
Top-level menu at admin.php?page=oamazon. Tabs: Dashboard, Products, Links, Displays, Analytics, Content, Compliance, Settings. When Orravo Core is active, the menu nests under the unified Orravo dashboard and registers with the Cmd+K command palette.
Frequently asked questions
wp_oam_products. The default refresh schedule re-fetches active ASINs in the background to keep prices current. Stale prices trigger a ToS-checker warning.CF-IPCountry header directly with no extra service. Otherwise, OAmazon falls back to a built-in IP-to-country map. Geo-routing can also be disabled per-link.resolved status and the higher-CTR variant is recorded as the winner. You can also resolve manually.ip_hash and user_agent_hash are SHA-hashed before storage. The raw IP and UA are not persisted. Country code, device type, and referrer are stored in plain form.wp_oam_* tables. Take a database backup before uninstalling if you want to preserve click history or display configurations.Got a question about OAmazon?
Reach out directly. Kenneth replies within 24 hours.

