=== A1 Marketplace Sync with eBay for WooCommerce ===
Contributors: a1plugins, freemius
Tags: ebay, woocommerce, marketplace, listing, sync
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.2
WC requires at least: 9.5
WC tested up to: 10.9
Stable tag: 1.2.9
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connects WooCommerce to eBay via eBay REST APIs.

== Description ==

A1 Marketplace Sync with eBay for WooCommerce connects your WooCommerce store to eBay, allowing you to manage eBay listings, sync inventory, and import orders directly from the WordPress admin.

= Third-party services =

This plugin connects to eBay's REST APIs (developer.ebay.com) to publish and revise listings, pull inventory/price updates, and (on the Pro plan) import orders and push shipment tracking - your store and product data is sent to eBay to perform these actions. See [eBay's User Privacy Notice](https://www.ebay.com/help/policies/member-behaviour-policies/user-privacy-notice-privacy-policy?id=4260).

This plugin also uses the [Freemius](https://freemius.com) SDK for license management and plan gating, which may collect some usage data to enable licensing, in-dashboard updates, and payment processing. See [Freemius's Privacy Policy](https://freemius.com/privacy/) and [Terms of Service](https://freemius.com/terms/).

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/a1-marketplace-sync-with-ebay-for-woocommerce`, or install through the WordPress admin's Plugins screen.
2. Activate the plugin.
3. Go to WooCommerce → A1 Marketplace Sync with eBay for WooCommerce → Connections, and connect your eBay account (authorizes via eBay's own login, not a password you enter here).
4. Map your WooCommerce product categories to eBay categories, then publish or import listings.

Full setup walkthrough with screenshots: [a1plugins.com/a1-ebay-integration-for-woocommerce-docs](https://a1plugins.com/a1-ebay-integration-for-woocommerce-docs)

== Changelog ==

= 1.2.9 =
* wp.org Round 2 review fixes:
* Fix: Renamed 3 elements that used an inconsistent `a1wb` prefix (`a1wbAdmin`, `wp_ajax_a1wb_push_tracking`, `a1wbTrial`) to match the plugin's standard `a1woobay` prefix used everywhere else.
* Change: Removed the Pro gate on scheduled/automatic eBay -> WooCommerce sync - it shared its implementation with the free plan's manual "Sync Now" button, so blocking only the schedule was a runtime-only restriction rather than a genuinely separate feature. Automatic sync is now available on both plans.
* Change: Description Templates (reusable, token-driven eBay listing descriptions) moved to Pro, physically absent from the free build. Listings without a template still publish fine using the product's own WooCommerce description.

= 1.2.8 =
* wp.org Round 1 review fixes:
* Change: Removed the free plan's 25-listing and 1-profile caps - listing and profile creation is now unlimited on the free plan. Free vs. Pro is now differentiated only by genuinely separate features (image sync, scheduled/automatic sync, order import), which are physically absent from the free build rather than merely blocked.
* Fix: eBay Marketplace Account Deletion webhook endpoint (`class-a1woobay-compliance.php`) now requires a per-site secret in the endpoint path on both the GET challenge and POST deletion-notification requests, instead of accepting unauthenticated POSTs to a fixed URL. **Existing installs: the account-deletion webhook URL has changed** - after updating, re-copy the new URL from Settings and re-register it in your eBay Developer Portal, or deletion notifications will 404.
* Fix: Missing direct file access guard in `admin/views/settings-page.php` (was present but positioned after ~90 lines of executable code; now first statement in the file).
* Plugin renamed to "A1 Marketplace Sync with eBay for WooCommerce" per wp.org's naming guidelines (trademark placement).

= 1.2.7 =
* Pre-submission cleanup, before this plugin's first wp.org review:
* Fix: Plugin URI pointed at a page that doesn't exist (`/woobay`) - updated to the live page (`/a1-marketplace-sync-with-ebay-for-woocommerce/`).
* Add: `Requires Plugins: woocommerce` header.
* Fix: moved nine inline `<script>`/`<style>` blocks (admin pages, the tracking meta box, and the product-edit metabox) to properly enqueued assets via `wp_enqueue_script()`/`wp_enqueue_style()`, with `wp_localize_script()` for nonces/AJAX URLs/translated strings that used to be echoed directly into the page. One `<style>` block in the eBay listing-description template was deliberately left as-is - it's part of the HTML sent to eBay's API, not something WordPress renders, so the enqueue system doesn't apply there.

= 1.2.6 =
* Freemius: added `premium_slug` (`a1-marketplace-sync-with-ebay-for-woocommerce-premium`) and `wp_org_gatekeeper` to the SDK init, matching the updated integration snippet Freemius's dashboard generated after the product rename there. `slug` (`a1-woobay`), the `is_premium` build-identity conditional, and the real `menu` config (with the `account` menu fix) were left exactly as-is - Freemius's generic template snippet shows different defaults for those three, but the existing values are the correct ones for this plugin.

= 1.2.5 =
* Rename: renamed from "A1-WooBay" to "A1 Marketplace Sync with eBay for WooCommerce" (preemptive wp.org trademark compliance) - "WooBay" fused WooCommerce's "Woo" and eBay's "Bay" trademarks into one blended word, the same issue flagged on A1-WooCOG's own submission review. Text domain changed to `a1-marketplace-sync-with-ebay-for-woocommerce` to match. Internal constants, function/class prefixes (AW_*, aw_*, A1WooBay_*), database meta keys, and the Freemius product slug (`a1-woobay`, tied to existing license records) are unchanged.

= 1.2.4 =
* Fix (WordPress.org Guideline 5): the Pro-only `is__premium_only()` conditions for image sync, order import, tracking push, and scheduled sync were combined with `&&`/`||` in the same condition (e.g. `is__premium_only() && allow_x()`). Verified directly against an actual Freemius-generated free build that this compound form is NOT recognized by Freemius's code-stripping build step - only an isolated `is__premium_only()` condition is, matching the SDK's documented example. Restructured all four call sites so the Pro logic sits inside an isolated `is__premium_only()` block, with the license-tier check and free-plan fallback nested/following separately. This also removes a dead reference to the stripped `A1WooBay_Orders` class that was otherwise sitting unreachable-but-present in the free build's `import_orders()`/`push_tracking()` AJAX handlers.

= 1.2.3 =
* Fix: added the missing `account` menu config to the Freemius SDK init - without it, there was no Account page for Freemius to render "Activate License" on after installing the premium zip (same fix already applied to A1-WooCOG).
* Packaging: added bin/build-release.sh to produce the release zip directly (no longer relying on .gitattributes' export-ignore), and removed .gitattributes since it's no longer needed and was itself flagged as a disallowed hidden file when scanning the plugin folder directly.

= 1.2.2 =
* Second Plugin Check pass, verified directly against the bundled scanner's own bundled PHPCS ruleset rather than assumed: replaced bare (int)/(float)/(array) casts with absint()/sanitize_text_field()/map_deep() on request data (type casts alone aren't recognized as sanitization by the scanner), added sanitize_text_field() to nonce values passed to wp_verify_nonce(), and added isset() checks before $_SERVER['REQUEST_METHOD'] comparisons. Remaining nonce-verification warnings on read-only redirect-flag notices and the OAuth callback (which uses a state-token check instead of a WP nonce, since eBay's server generates that redirect) are left as reviewed, expected warnings.

= 1.2.1 =
* WordPress.org Plugin Check compliance: added missing translators comments, escaped remaining unescaped output, replaced strip_tags() with wp_strip_all_tags(), gated debug error_log() calls behind WP_DEBUG, guarded set_time_limit() for hosts that disable it, added wp_unslash() before sanitizing/casting request data, and excluded dev-only dotfiles from the release package.

= 1.2.0 =
* WordPress.org submission compliance (Guideline 5, no trialware): order import, scheduled/automatic sync, and image sync are now removed entirely from the free build via Freemius's code-stripping (`__premium_only`), not just gated behind a license check. Existing customers who unlocked Pro in-place under the old model now need to download and install the separate premium zip from their Freemius account instead.

= 1.1.1 =
* Fix: Freemius account/license menu now appears correctly in WP admin sidebar
* Fix: Deletion log now filters out bot/scanner requests; only real eBay notifications are logged
* Add: Clear Log button for eBay compliance deletion request log
* Fix: Verification token UI text clarified — you create the token, eBay does not provide it

= 1.1.0 =
* Add: Freemius SDK integration for license management and distribution
* Add: Free/Pro plan feature gating (25 listing cap, 1 profile, no image sync, no auto-sync, no order import on free)
* Add: 14-day Pro trial, no credit card required

= 1.0.6 =
* Add: eBay Marketplace Account Deletion compliance webhook (required by eBay for all API apps)
* Add: Buyer username stored on order import for GDPR anonymization on deletion request

= 1.0.4 =
* Fix: Removed duplicate stock update hook
* Add: Optional price pull from eBay (off by default to prevent feedback loops)

= 1.0.2 =
* Add: Stock = 0 in WooCommerce automatically ends the eBay listing

= 1.0.0 =
* Add: eBay listing status panel in WP product publish sidebar
* General stability improvements
