=== Scanely QR ===
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.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

QR codes for your pages, products and PDFs, and an order QR code for every WooCommerce order. Print-ready files. No account needed.

== Description ==

Scanely QR does two jobs. You can use either one on its own, and both work without an account.

= 1. A QR code for a page, product, PDF or link =

Pick a published page, post, WooCommerce product or Media Library PDF, or paste any public link. The plugin makes the code, keeps it in a searchable library and gives you files to print.

* Download PNG at 256, 512, 1024 or 2048 px, or real vector SVG. Transparent backgrounds are supported.
* Print menu, review, product, package-insert and document cards as vector PDF on US Letter, A4 or 90 x 55 mm, including sheets of 10 labels.
* Show a code on your site with the Scanely QR block or the [scanely_qr] shortcode.
* Export many codes at once: filter your content in Bulk export and download a ZIP.

= 2. An order QR code for your WooCommerce customers =

Every order gets its own QR code. It opens that order on your store, on a page the plugin serves at your own domain. There is nothing to create or design.

* Show the code in customer emails, on the order confirmation page and in My Account. Each place has its own switch and preview.
* Print it for the package from one order or up to 100 at once: 4 x 6 in inserts or US Letter/A4 labels. No invoice plugin is needed.
* After scanning, customers see their items and order status. They can add the items to their cart again at current prices, review products and open product help. Buy again never creates an order or a payment.
* Registered customers sign in. Guests confirm the email they used at checkout.
* Optionally add the same code to WP Overnight PDF invoices and packing slips.

= Optional: a Scanely account =

A free account adds dynamic QR codes: change where a printed code leads and see how often it is scanned. Free includes 3 dynamic codes and 1,000 recorded scans per month. On Free, each scan of a dynamic code shows a Scanely screen for about one second before your page opens. Paid plans, Lifetime included, redirect directly. You connect without copying an API key. The FAQ covers plans, schedules and statistics.

== Installation ==

1. Install the ZIP in Plugins > Add Plugin, or upload the scanely-qr folder, and activate Scanely QR.
2. Open Scanely > Get started.
3. Connect a free Scanely account, or continue without one.
4. Choose QR code for a page, product or link, or Order QR codes for your customers if you run WooCommerce.
5. Check the preview and finish. You can return to Get started at any time.

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

== Frequently Asked Questions ==

= Do I need a Scanely account? =
No. Static QR codes, the library, the block and shortcode, print templates, bulk exports and WooCommerce order QR codes all work without one.

= What does a free Scanely account add? =
Dynamic QR codes: you can change where a printed code leads and see how often it is scanned. Free includes 3 dynamic QR codes and 1,000 recorded scans per month, shared across the account and its connected sites. On Free, each scan of a dynamic code shows a Scanely screen for about one second before your page opens. Paid plans, Lifetime included, redirect directly. A free account can also count order visits for 500 new WooCommerce orders per month.

= How do I connect an account? =
Open Scanely > Get started or Scanely > Settings and choose Create free account / Connect. You sign in at Scanely, select a personal or client workspace you can edit, approve the site and return to WordPress. No API key is copied. A draft you were editing is preserved while you sign in or view plans. Saved codes retain their original account and workspace. With Use an existing Scanely QR you can reuse a link QR you already have, without creating another code or consuming another allowance. Existing Business integrations can still connect with an API key in Settings.

= What do paid plans add in the plugin? =
On Pro, Business and every Lifetime plan, a dynamic code can have 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 and windows limited to days of the week are managed in the Scanely app. The same plans include WooCommerce purchase attribution with a compact 30-day conversion report, and unlimited order visit counting. Starter counts order visits for 2,000 new orders per month. Scan counts and status refresh in WordPress; full analytics open in Scanely.

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

= 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.

= What happens to printed dynamic codes if I stop paying? =
They keep redirecting. When a paid period ends, the account returns to Free and every existing code keeps working under Free rules, including the one-second Scanely screen. Scanely blocks a code only for a breach of its terms, such as a link to phishing or malware, and emails the owner. Every plan can download a CSV with every code and where it leads. Details: https://scanely.io/promise

= 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, a window limited to days of the week or another QR type must be managed in the Scanely app.

= How do WooCommerce order QR codes work? =
Open Scanely > Get started or Scanely > WooCommerce, choose where customers see the code, save, and preview a recent order. The code opens that order on your store, on a page the plugin serves at your own domain. Registered buyers sign in; guests verify their billing email. 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. Store administrators can replace compromised order links, which invalidates old printed QR and guest sessions. Always test a physical sample at actual size.

= 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.

= How does counting order visits work? =
It is off until you connect a Scanely account and turn it on in Scanely > WooCommerce > Advanced: count order visits. 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.

Allowances for new orders per month: Free 500; Starter 2,000; Pro, Business and every Lifetime plan unlimited. The allowance is shared across the account. Detailed events are kept for 30 days on Free, 90 on Starter, 365 on Pro and every Lifetime plan, and 730 on Business. Order QR codes, invoices and the order page keep working at the limit, and no dynamic QR codes are used.

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 purchase attribution work? =
Available on Pro, Business and every Lifetime plan, and off until you turn it on. Open Scanely > Settings > Advanced: purchase attribution and enable it 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 my server need? =
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.

= What does deleting the plugin remove? =
The local QR library, plugin settings, connection key and queued order visits 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. Counting order visits 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

== Screenshots ==

1. Get started: choose which QR code you need, then pick a page, post, product or PDF from your site.
2. Preview the saved code, download PNG or SVG, or make a print.
3. WooCommerce: every order gets its own QR code. Choose where customers see it.
4. What the customer sees after scanning: their order on your store, with Buy again, product reviews and help.
5. Print studio: package inserts and label sheets for one order or up to 100.

== Development source ==

The readable QR entry point is included in src/qr.js. The package.json and package-lock.json files pin the JavaScript dependencies; scripts/build.cjs bundles the QR renderer and copies the local JSZip and jsPDF builds and licenses. Run npm ci and npm run build from the plugin directory to reproduce these browser assets. Node.js is needed only for development, not to use the plugin.

Source and build details, including upstream library references, are in docs/integration.md under Rendering and build.

== Changelog ==

= 1.0.0 =
* Initial WordPress.org release of Scanely QR.
* Guided Get started flow for a first QR or WooCommerce setup, with resumable account connection, preserved drafts and shared account usage refresh.
* Analytics preferences let verified buyers grant, change or withdraw consent, with duplicate-visit prevention and safe handling of pending requests.
* 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.
