=== QRotto – QR Code Generator ===
Contributors: prosteptechnologies
Tags: qr code, qr, wifi, vcard, block
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Static QR codes for links, WiFi, contact cards and text. Made on your own server, with the smallest safe print size shown in the editor.

== Description ==

QRotto adds a "QR code" block and a `[qrotto]` shortcode. Pick a type, fill in the fields, and the code appears in your post as a sharp SVG image.

**Four types**

* **Link (URL).** Adds https:// if you leave it out.
* **This page's link.** The code always points to the page it sits on.
* **WiFi network.** Guests scan and join. Special characters in the network name or password are escaped correctly, and hidden networks are supported.
* **Contact card (vCard 3.0).** Name, company, phone, email and website.
* **Plain text.** Anything up to the size one code can hold.

**Scan check in the editor**

While you edit, each code shows its grid size and the smallest width it should be printed at, never below 20 mm (0.8 in). Dense codes get a warning before you print a hundred copies. Visitors never see this.

**Print cards for your counter or tables**

Tools → QR Print Cards makes a sheet of cards ready to print and cut: guest WiFi with the network and password written underneath, a "Scan for our menu" sign, a review link or your contact card. Choose 1, 2, 4 or 8 cards on A4 or US Letter. The page warns you if the code would be printed too small to scan.

**Static and private**

* Codes are made on your own server. The plugin contacts no outside service, loads nothing from a CDN and tracks nothing.
* Codes are static: the content is inside the code itself, so they keep working as long as the content does. No redirects, no expiry, no account.
* Visitors load no JavaScript, only one small stylesheet.

**Documentation**

Every type and format is explained, with decoded examples, at [qrotto.com/docs](https://qrotto.com/docs/).

QR Code is a registered trademark of DENSO WAVE INCORPORATED.

== Installation ==

1. Install from Plugins → Add New, or upload the `qrotto` folder to `/wp-content/plugins/`.
2. Activate the plugin.
3. In the block editor, add the "QR code" block. In other editors, use the shortcode.

== Frequently Asked Questions ==

= How do I use the shortcode? =

`[qrotto url="https://example.com"]`

`[qrotto type="wifi" ssid="Cafe Guest" password="coffee123"]`

`[qrotto type="wifi" ssid="Office" security="nopass" hidden="yes"]`

`[qrotto type="vcard" name="Sara Khan" org="Khan Studio" phone="+1 555 0100" email="sara@example.com" website="https://example.com"]`

`[qrotto type="text" text="Table 4"]`

`[qrotto type="page" download="yes"]`

Display options for every type: `size` (width in pixels, 80 to 1000, default 200), `caption`, `align` (left, center or right), `alt`, `download="yes"` for a download button, and `download_text` to change its words.

= Can visitors download the code? =

Yes, turn on "Download button for visitors" in the block, or add `download="yes"` to the shortcode. Visitors get a sharp PNG. Without JavaScript they get an SVG file instead.

= Do the codes expire? =

No. They are static codes, so there is nothing to expire. If the link inside stops working, the code points to a dead page, so use links you control.

= Can I track how many people scan a code? =

Not with this plugin, on purpose: counting scans means sending people through a redirect service. You can add UTM parameters to your link and see the visits in your own analytics.

= Is my WiFi password safe? =

The password has to be inside the code for phones to join, so anyone who can scan the code can read it. Only put WiFi codes where you would write the password on a card. The automatic alt text never includes the password.

= What happens if I enter too much content? =

The block shows a message to editors asking you to shorten it. Visitors see nothing rather than a broken code.

= Does it add a link to your site? =

Only if you turn it on in Settings → QRotto. It is off by default.

== Screenshots ==

1. The QR code block with its settings and the scan check.
2. A sheet of guest WiFi cards from Tools → QR Print Cards.
3. A WiFi code on a published page, with the download button.
4. Settings → QRotto.

== Changelog ==

= 1.0.1 =
* The print sheet's page-size rule is now added through wp_add_inline_style() instead of an inline style tag.

= 1.0.0 =
* First release: block and shortcode for links, this page's link, WiFi, vCard and text, with the scan check.
* Print cards: sheets of WiFi, menu and contact cards on A4 or US Letter.
* Optional download button for visitors.

== Third party code ==

The QR encoder is qrcode-generator by Kazuhiko Arase (MIT licence), bundled in `includes/lib/`. It was moved into its own PHP namespace; the changes are listed at the top of that file.
