=== Affiliate Amazon Shortcode ===
Contributors: OnoDev77
Donate link: https://softwareapp.it/affiliate-amazon-shortcode/
Tags: amazon affiliate, amazon associates, amazon products, affiliate marketing, product comparison
Requires at least: 5.0
Tested up to: 7.0
Stable tag: 3.5
Requires PHP: 7.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Display Amazon affiliate products with Creators API v3, customizable product boxes, comparison layouts, caching, and global marketplaces.

== Description ==

**Affiliate Amazon Shortcode** is an Amazon affiliate plugin for WordPress that displays Amazon products in posts and pages using simple shortcodes.

It supports the current **Amazon Creators API v3**, automatically detects the correct v3.1 / v3.2 / v3.3 OAuth endpoint, supports Amazon marketplaces worldwide, and helps diagnose common Credential, Partner Tag and Marketplace configuration errors.

Existing installations can keep their saved legacy API profiles for backward compatibility. New configurations should use **Amazon Creators API v3**.

= Main features =

* Amazon Creators API v3 with automatic OAuth region detection
* Separate API profiles so existing legacy configurations can remain available during migration
* Amazon marketplaces worldwide with independent Marketplace and Partner Tag configuration
* Guided API connection test with clear fixes for InvalidAssociate, InvalidPartnerTag, eligibility and OAuth errors
* API Test automatically saves the values currently entered before testing
* Smart caching and retry/backoff protection to reduce API calls
* Product title, image, price and savings data when returned by Amazon
* Automatic product-box language based on the WordPress site language
* Manual language override globally or per shortcode
* Responsive product boxes and columns
* Existing shortcode, Card/List layout and custom-style compatibility
* FREE version supports up to 3 products per shortcode

= PRO features =

* Up to 9 products per shortcode and up to 4 columns
* Premium templates: Compact, Modern Card, Editorial Minimal, Recommended Highlight, Deal Box and Comparison Table
* Dedicated product comparison shortcode
* Product feature highlights when available from Amazon
* Configurable highlights word limit to keep boxes compact
* Theme presets and fully custom colors
* Custom CTA button text and optional badge
* Per-shortcode template, theme, columns, CTA, badge and highlights-length overrides
* No FREE watermark

Learn more about PRO: https://softwareapp.it/affiliate-amazon-shortcode/

== Shortcodes ==

Basic usage:

`[affiamsh_amazon keyword="wireless headphones"]`

Force the frontend box language:

`[affiamsh_amazon keyword="wireless headphones" language="it"]`

Supported box languages: English, Italian, Spanish, French, German, Portuguese, Dutch, Polish, Turkish, Swedish, Japanese and Arabic. Automatic mode follows the WordPress site language.

= PRO shortcode options =

Example:

`[affiamsh_amazon keyword="robot vacuum" number="6" template="modern" columns="3" button="Check price" badge="Our pick" highlight_words="25"]`

Available template values:

* `card`
* `list`
* `compact`
* `modern`
* `minimal`
* `highlight`
* `deal`
* `comparison`

`highlight_words="25"` limits the total number of feature words shown for each product. Use `highlight_words="0"` for no word limit.

Product comparison:

`[affiamsh_amazon_compare keyword="wireless headphones" number="3"]`

Existing shortcodes without the new PRO attributes keep their saved legacy appearance.

== Installation ==

1. Upload and activate the plugin.
2. Open **Affiliate Amazon Shortcode** in the WordPress admin.
3. Select **Creators API v3 (Recommended)**.
4. Paste your Amazon Credential ID and Credential Secret.
5. Select the target Amazon Marketplace and enter the Partner Tag / Tracking ID registered for that marketplace.
6. Click **Test API Connection**. The current values are saved automatically before the test.
7. Add `[affiamsh_amazon keyword="your keyword"]` to a post or page.

== Amazon Creators API setup ==

New Creators API v3 credentials normally look like:

* Credential ID: `amzn1.application-oa2-client...`
* Credential Secret: `amzn1.oa2-cs.v1...`

You do not need to select v3.1, v3.2 or v3.3 manually. The plugin tries the appropriate Amazon OAuth endpoints, detects the credential region and caches the working endpoint.

The credential region and product marketplace are separate concepts. A valid credential can authenticate globally, but the **Partner Tag must be valid for the selected Marketplace**.

== Frequently Asked Questions ==

= Which API should I use? =

Use **Creators API v3** for all new configurations. Legacy profiles are retained only so existing installations can continue working while they migrate.

= What does InvalidAssociate mean? =

Your OAuth credential is valid, but the Partner Tag is not linked to the selected Amazon Marketplace. Select the correct marketplace or use a Tracking ID registered for that marketplace.

= What does AssociateNotEligible mean? =

Amazon accepted authentication but the Associates account currently does not meet Creators API eligibility requirements. The plugin displays the Amazon reason and a guided explanation in the API test.

= Do I have to save before testing the API? =

No. **Test API Connection** saves the values currently entered and then performs the test.

= How many products can I show? =

FREE supports up to 3 products. PRO supports up to 9 and allows `number="x"` per shortcode.

= Can I keep my existing product box design? =

Yes. Existing shortcodes, Card/List layouts, themes and saved custom styling remain compatible. Premium templates are opt-in and do not automatically replace existing boxes.

= Can product box labels be translated automatically? =

Yes. Automatic mode follows the site language. You can also choose a global Box Language or use `language="it"`, `language="de"`, etc. in one shortcode.

= Can I shorten product feature bullets? =

Yes in PRO. Enable Product Highlights and set a word limit globally, or use `highlight_words="25"` for one shortcode.

== Screenshots ==

1. Amazon API configuration and guided connection test
2. Product display and language settings
3. Premium Layout Gallery
4. Display PRO templates, themes and shortcode values
5. Comparison table and premium product layouts

== External Services ==

This plugin connects directly to Amazon services in order to retrieve product data.

**Amazon Creators API / Login with Amazon**
https://affiliate-program.amazon.com/creatorsapi

For Creators API, the Credential ID and Credential Secret are sent to the appropriate Amazon OAuth endpoint to obtain an access token. Product requests send the access token, selected Marketplace, Partner Tag and requested product/search information to Amazon.

**Legacy Amazon Product Advertising service (PA-API 5.0 — existing installations only)**
https://webservices.amazon.com/paapi5/documentation/

Legacy credentials and product request information are sent directly to Amazon only when an existing installation explicitly selects that legacy profile.

All API communications use HTTPS. The plugin does not send Amazon credentials or product-request data to SoftwareApp.it.

== Changelog ==

= 3.5 =
* Refocused public plugin copy on Amazon Creators API v3.
* Removed legacy API naming from the main description, feature list and promotional admin copy.
* Kept the legacy integration available for backward compatibility and disclosed it only where technically or legally relevant.
* No change to API behavior, saved settings, shortcodes or existing product boxes.

= 3.4 =
* Refreshed WordPress.org readme, plugin metadata and search tags.
* Updated documentation for Creators API v3, premium layouts, comparison shortcode, localization and Product Highlights word limits.
* Corrected outdated feature descriptions and moved older release history to `changelog.txt`.
* No change to existing shortcode output or saved settings.

= 3.3 =
* Added exact `template="..."` value below the Template selector.
* Added configurable Product Highlights word limit and `highlight_words="25"` shortcode override.
* Preserved existing Card/List layouts, shortcodes and custom styling.

== Upgrade Notice ==

= 3.5 =
Public copy now focuses on Creators API v3 while legacy compatibility remains unchanged.
