=== Techfinder ===
Contributors: techfinder
Donate link: https://techfinder.ir
Tags: woocommerce, products, import, techfinder, price comparison
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 2.6.0
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.txt

Import Porodo, Levelo, Green Lion, Powerology, Lepresso and Porodo Gaming products into WooCommerce and share your prices with Techfinder.ir.

== Description ==
The Techfinder plugin connects your WooCommerce store to the Techfinder.ir catalog.

**Product import:** fetch products of Porodo, Levelo, Green Lion, Powerology, Lepresso and Porodo Gaming from the Techfinder catalog, review them in the plugin and turn them into WooCommerce products with title, Persian translation, SKU, description, category, brand, images and more.

**Price sharing (optional):** let the Techfinder.ir price comparison engine read the price and stock of your products so your store is listed with up-to-date prices and receives visitors from Techfinder.ir.

Key features:
- Imports title, Persian translation, SKU, barcode, model, description, category, brand and images.
- Keeps the imported catalog in sync automatically (optional daily update and hourly processing).
- Shares product prices and stock with Techfinder.ir (opt-in, disabled by default).
- Logs every step so you can see exactly what happened.

== External services ==
This plugin connects to services operated by Techfinder (https://techfinder.ir).

**1. Techfinder product catalog (product import)**
Used to fetch the products that the plugin imports. It is called when you click an "Update" button on the import page, or once a day if "Auto update API products" is enabled.

Endpoint: `https://techfinder.ir/wp-json/techfinder/v1/oskar-products`

Data sent: your Techfinder API key (in the `X-API-Key` request header), the URL of your site, the IP address of your server and the requested brand. Without an API key, older installations send a shared token instead; this is being phased out.
Data received: product details such as title, translation, SKU, barcode, model, description, category, stock, dimensions and links to images and videos.

When products are created, their images and videos are downloaded from the links provided by the catalog. These files are served from Techfinder's own servers (`techfinder.ir`); only for items Techfinder has not stored yet do the links point to the media servers of the brands' official distributor (for example `pics.naml.ae`). Only a standard download request is sent to them.

When you click "Test connection" in the settings, the plugin sends your API key to `https://techfinder.ir/api/v1/me` and receives the name of your shop and the key's expiry date.

**2. Price sharing (only if you enable it)**
When "Access permission" is enabled under Techfinder > Settings, the plugin adds the public address `/wp-json/techfinder/v1/products` to your site. Techfinder's servers read it regularly to update your prices on Techfinder.ir. It contains, for each published product: SKU, Techfinder SKU, barcode, model, title, price, store currency, stock and product link. Nothing is sent while this option is disabled, and disabling it removes the address.

Techfinder privacy policy: https://techfinder.ir/privacy-policy

== Installation ==
1. Upload the `techfinder` folder to the `/wp-content/plugins/` directory, or install it from Plugins > Add New.
2. Make sure WooCommerce is installed and active, then activate the plugin.
3. Get an API key from the Techfinder seller panel (https://techfinder.ir/panel/api) and register the public IP of your server there. Enter the key in Techfinder > Settings and click "Test connection".
4. Go to Techfinder > Products to fetch and process products.
5. To share your prices, go to Techfinder > Settings, enable "Access permission" and save. The page then shows your price sharing address; if your store is not yet listed on Techfinder.ir, send this address to Techfinder support.

== Frequently Asked Questions ==

= Which brands are supported? =
Porodo, Levelo, Green Lion, Powerology, Lepresso and Porodo Gaming.

= Does this plugin automatically update products? =
Yes. Enable "Auto update API products" to refresh the catalog daily and "Auto process products" to create WooCommerce products hourly.

= How do I share my product prices with Techfinder.ir? =
Enable "Access permission" in the plugin settings. Techfinder matches your products by SKU, barcode or model, so make sure your products have one of them. Prices are read in your WooCommerce currency (Rial or Toman are both supported).

= How is my data used? =
The data is used only for authentication, product synchronization and showing your prices on Techfinder.ir. See the [Techfinder Privacy Policy](https://techfinder.ir/privacy-policy).

== Changelog ==
= 2.6.0 =
* Compatible with the new Techfinder.ir platform.
* Per-shop API key: enter the key from the Techfinder seller panel in the settings; it is sent in a request header and works as your license. A "Test connection" button checks the key and shows which server IP to register if needed.
* Brand-new admin interface with the Vazirmatn font and Persian digits: dashboard with catalog stats, brand cards, status filters, product details window with image gallery, toggle switches and system status cards. Works on mobile and in RTL.
* Fixed: the plugin's own translations (Persian) were not loaded.
* Admin actions (update, process, delete logs, reset cron) are now protected with nonces and return to the same page.
* The plugin's styles and scripts are loaded only on its own admin pages; nothing is loaded on the storefront anymore.
* Fixed: updating large brands (such as Porodo) timed out; the catalog request now waits long enough for the full response.
* Fixed: price sharing reported products without stock management as out of stock.
* Price sharing now also sends barcode (WooCommerce GTIN), model and store currency for more accurate matching and prices.
* Price sharing response is cached for 5 minutes and refreshed when a product changes.
* Imported products keep their Techfinder SKU, so they still match after you change the SKU.
* Unchanged catalog items are no longer rewritten on every update.
* Safer media download: failed or non-image responses are no longer saved as images; SSL is verified.
* Disabling the automatic options now also removes their scheduled events.
* The settings page shows your price sharing address.

= 2.5.0 =
* Minor bug fixes and performance improvements.

= 2.4.0 =
* Minor bug fixes and performance improvements.

= 2.3.0 =
* Added support for product categories.
* Added the ability to share product prices with Techfinder.ir's price search engine.
* Enhanced product image import functionality.
* Minor bug fixes and performance improvements.

= 2.2.0 =
* Added API support for Green Lion and Powerology.
* Improved SKU management for imported products.

= 2.1.0 =
* Initial release with support for Porodo and Levelo product imports.

== Upgrade Notice ==

= 2.6.0 =
Required for the new Techfinder.ir platform: fixes product updates for large brands and stock status in price sharing.

= 2.3.0 =
Update to this version to enable price sharing with Techfinder.ir and other enhancements.

== License ==
This plugin is licensed under the GPLv3

The admin interface bundles the Vazirmatn font (admin/fonts), Copyright 2015 The Vazirmatn Project Authors (https://github.com/rastikerdar/vazirmatn), licensed under the SIL Open Font License 1.1 (see admin/fonts/OFL.txt).
