=== Scanely - QR Codes for WordPress & WooCommerce ===
Contributors: scanely
Tags: qr code, woocommerce, gutenberg, pdf, dynamic qr
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Create QR codes from your pages, products and PDFs. Download vector files, print labels, and optionally connect dynamic codes to Scanely.

== Description ==

Scanely connects your WordPress content to printed materials.

Free, local tools:

* Save QR codes in a searchable WordPress library.
* Choose a public post, page, WooCommerce product, PDF from Media Library, or URL.
* Download PNG at 256, 512, 1024 or 2048 px and real vector SVG, including transparent backgrounds.
* Use the native Scanely QR block in Gutenberg or keep existing [scanely_qr] shortcodes.
* Make menu, review, product, package-insert and document cards.
* Download vector PDF on US Letter, A4 or 90 x 55 mm cards, including sheets of 10 labels.
* Search and filter bulk exports; select across pages or select all matching content. ZIP names include IDs to avoid slug collisions.
* Use the WooCommerce orders tab in Bulk export to filter by status, creation dates or order ID, select up to 100 orders, and open the shared label/package-insert print studio.
* Add order QR to selected customer emails, checkout confirmation and My Account order details with separate controls and previews.
* Print order QR directly from a WooCommerce order or a batch of up to 100 orders. Local 4 x 6 in inserts and US Letter/A4 labels work without an invoice plugin or Scanely account.
* Let verified buyers add available items to their existing WooCommerce cart at current prices, review products and open product help. No order or payment is created by Buy again.
* Optionally place the same private order access on WP Overnight invoices and packing slips. Registered buyers sign in; guests verify the checkout email.

Optional Scanely connection:

* Connect a Free, monthly or Lifetime account without copying an API key. Free includes 3 dynamic QR codes and 1,000 recorded scans per month, shared across the account and its connected sites.
* Your draft is preserved while signing in or viewing plans; return to the same editor.
* Reuse an existing Scanely link QR without creating another code or consuming another allowance.
* Create real dynamic QR codes and keep the same short link when editing their destination.
* On Pro, Business and every Lifetime plan, set up to 12 daily redirect windows in an IANA timezone, including US timezones, overnight periods and daylight saving changes. The default destination applies outside windows. One-time schedules are managed in the Scanely app.
* Select a personal or client workspace you can edit. Saved codes retain their original account/workspace association.
* Refresh scan counts and status, and open full analytics in Scanely.
* On Pro, Business and every Lifetime plan, record paid WooCommerce purchases after visitor consent, with stable event IDs, retry handling and duplicate prevention.
* View a compact 30-day conversion report for the selected workspace.
* Track order-document visits separately: Free 500 new orders/month; Starter 2,000; Pro, Business and all Lifetime tiers unlimited. Shared across the account. Event history: 30/90/365/730 days respectively (all Lifetime tiers: 365).
* Invoices and customer access continue working at the analytics limit; no ordinary dynamic QR slots are consumed.

Static QR codes already printed cannot become dynamic. Connecting an account does not change them: create a dynamic code and download its new pattern.

== Installation ==

1. Upload the scanely-qr folder or install the ZIP in Plugins > Add Plugin.
2. Activate Scanely.
3. Open Scanely > Get started. Connect a free Scanely account or continue with local tools.
4. Choose Share a link or content to create a QR, or Help customers after purchase to configure WooCommerce.
5. Save your QR or placements, check the preview and finish setup. Return to Get started at any time.
6. The full Create QR editor, WooCommerce settings and Legacy Business API key connection remain available.

Step-by-step guide: https://scanely.io/docs/wordpress
Plugin overview: https://scanely.io/wordpress-qr-code-plugin

PHP mbstring is required for QR generation. PHP OpenSSL is required for an encrypted account connection. PHP GD is required for QR images in WooCommerce emails and WP Overnight PDFs. Native SVG print previews and browser PDF exports work without GD. The frontend shortcode renders without JavaScript. The admin editor and browser exports require JavaScript.

== Frequently Asked Questions ==

= Do I need a Scanely account? =
No. Static generation, the local library, editor block, print templates and bulk exports work without an account.

= Where are my statistics? =
Dynamic codes, scan history, schedules and conversion reports belong to your Scanely account. WordPress stores content associations and cached scan counts. Static codes do not collect Scanely scan statistics.

= Does deleting or disconnecting the plugin delete my Scanely codes? =
No. Disconnect revokes this site’s account access, while existing dynamic codes and statistics remain in Scanely. Before uninstalling, disconnect in Settings; if the site is unavailable, revoke it from Scanely Settings.

= Does selecting a WordPress PDF use Scanely file hosting? =
No. The document stays on your WordPress hosting. The QR links to that public file; dynamic codes use a URL redirect to it. Verify that an anonymous reader can access the file, especially if another plugin restricts media access.

= What happens when I edit a WordPress page? =
Its existing URL keeps working normally. If you change the permalink or replace a linked file, open the saved QR in Scanely and save it to resolve the current destination. No remote QR is created during frontend rendering or routine post saves.

= What if a code was edited in Scanely? =
The plugin refuses to overwrite a changed remote destination or schedule. Use Load remote changes, review the imported values, then save. A one-time schedule or another QR type must be managed in the Scanely app.

= How does purchase attribution work? =
Enable it in Settings for a workspace with a matching website origin and purchase goal. Existing configuration for another site or goal is preserved. A visit through a dynamic QR supplies an attribution token. With visitor consent it is stored in a signed, HttpOnly first-party cookie for up to 30 days. Paid orders send the token, an opaque event ID, total in minor currency units and currency. The plugin does not send customer names, email addresses, addresses or cart contents. It does not automatically report refunds or net revenue. Disabling this plugin's tracking stops its collection and sending without disabling another integration's project.

= Does it work with cookie consent tools? =
The WordPress Consent API statistics category is supported. Without a consent tool, the plugin shows an optional consent prompt on attributed visits. Developers can use the scanely_qr_tracking_consent filter or window.ScanelyConsent.grant()/revoke(); see docs/integration.md. Cache systems should avoid caching checkout and consent AJAX responses.

= What does deleting the plugin remove? =
The local QR library, plugin settings, connection key and queued order analytics are removed. Local order-access QR stops working after uninstall. Dynamic codes already created in Scanely are not deleted. Existing paper codes keep their encoded URLs. Historical WooCommerce order annotations may remain with the orders for audit purposes.

== External services ==

All JavaScript libraries, print fonts and PHP QR generation are included locally. No external QR-image service is used.

When an administrator explicitly connects an account, the plugin contacts https://scanely.io/api to register its site name and address, request account authorization, manage dynamic codes and retrieve statistics. The website connection uses a scoped, revocable token stored encrypted on the WordPress server. No token is put in a browser URL. Disconnect from the plugin or from Scanely Settings. Saving a dynamic QR sends its name, destination, colors, schedule and campaign identifier. Purchase attribution is opt-in at the site and visitor levels as described above. Order analytics is separately enabled and sends opaque order/event references, document placement and timestamps; customer details and private order URLs stay on the store. Detailed events expire by plan; a minimal quota ledger remains until account/workspace deletion.

Scanely terms: https://scanely.io/terms
Scanely privacy policy: https://scanely.io/privacy

= How do order QR codes and analytics work? =
Open Scanely > WooCommerce, choose placements, save, and preview a recent order. Native emails, order pages and print inserts work with WooCommerce alone. WP Overnight is an optional PDF invoice integration. The Scanely preview does not create an invoice number or enroll an order. Registered buyers sign in; guests verify their billing email. Store administrators can replace compromised order links, which invalidates old printed QR and guest sessions. Always test a physical sample at actual size.

Connect Scanely and explicitly enable order analytics. A minimal opaque order reference consumes one allowance slot at first admission. Reprints, visits and reconnecting the same store/workspace do not consume another slot. The account-wide allowance resets each calendar month at 00:00 UTC. Previously admitted orders keep collecting eligible visits at the limit; extra orders wait for an upgrade or a future allowance. Unlimited applies only to WooCommerce tracked orders.

Visits are counted only after verification and analytics consent; document/image loads and administrator previews do not count. WP cron syncs in the background with retries, or use Sync pending orders. Unsent local events expire after 30 days. Customer identities, item lists and private URLs stay in WooCommerce. Scanely receives opaque references, placement and time linked to the connected site. These are order visits, not new sales or shipment tracking. Disconnecting/changing account or workspace pauses collection.

= How does Buy again work? =
After verifying their order, the buyer can add available simple products and variations to their current WooCommerce cart. Completed orders are eligible by default, using the native order-again status filter. Current prices, stock and cart validation apply. Fully refunded quantities and unavailable or unsupported product types are skipped. The customer reviews the cart and completes normal checkout. No payment is automatic. Review links use the native product review form and its permissions. A product-specific help URL overrides the optional store default; otherwise the product details are linked.

== Screenshots ==

1. Guided setup explains the WordPress and Scanely connection and shows current account allowances.
2. Native WooCommerce QR placements, customer actions and document previews.
3. Bulk export filters WooCommerce orders and opens the shared package-insert and label print studio.

== Changelog ==

= 1.1.0 =
* Resumable Get started flow for account connection, a first QR or WooCommerce setup, and previews.
* Free/local path with visible shared account allowances and contextual plan information.
* Preserve existing WooCommerce appearance, email types and optional invoice settings during guided setup.
* Connection approval returns to setup; pending dynamic QR saves retain the same draft for retry.
* WordPress installation guide and real product screenshots.


= 1.0.0 =
* First public release with the complete Scanely interface for WordPress and WooCommerce.
* Local QR library for URLs, posts, pages, products and Media Library PDFs; Gutenberg block and shortcodes.
* Full-resolution PNG, vector SVG/PDF, print cards and labels, plus filtered bulk content exports.
* Free-account connection with draft preservation, shared quotas, existing Scanely QR reuse and full analytics links.
* Dynamic QR codes, daily timezone schedules, workspaces and consent-based WooCommerce purchase attribution on eligible plans.
* Native WooCommerce order QR in selected customer emails, checkout confirmation and My Account, with separate controls and previews.
* Order QR printing from HPOS/classic order screens and Bulk export: up to 100 orders, 4 x 6 in inserts and US Letter/A4 labels.
* Private registered/guest order access with revocable links, Buy again, product reviews and help links.
* Optional WP Overnight invoice and packing-slip integration.
* Separate order-visit analytics with Free 500 tracked orders/month, plan allowances, consent and retry-safe background sync.
