=== Postage for WordPress ===
Contributors: postage
Tags: shipping, shipping labels, shipping rates
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 8.0
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Quote Postage shipping rates and sell shipping labels on any WordPress site — no WooCommerce required.

== Description ==

This plugin connects a plain WordPress site to your Postage account (via a personal access token — create one under your Postage account's API Tokens page) and adds two shortcodes:

1. `[postage_rate_calculator]` — a quote-only rate calculator. A visitor enters a destination and package weight and sees live Postage rates. Never spends anything, safe for any page.
2. `[postage_buy_label]` — quotes a rate and actually buys it, spending your Postage account balance. Because plain WordPress has no built-in cart/checkout/payment step, **who is allowed to trigger a purchase is controlled by a setting** (the "Who can buy a label" setting under Postage → Features), and defaults to logged-in users only — turn on "Anyone" only if you have another way to control access to the page.

In the block editor, add a **Shortcode** block and paste the shortcode in.

Sandbox vs live is decided entirely by the token you paste: a Test token never charges your balance and returns sample labels; swap in a Live token to buy real ones.

If you run WooCommerce, use **Postage for WooCommerce** instead — it offers the same two capabilities (live rates at checkout, and a Shipping Label product) backed by a real cart, checkout and payment step, and works alongside this plugin if you also want the standalone shortcodes on a non-store page.

= Requirements =

* A Postage account with a personal access token granting the `rates:read`, `carts:write`, `orders:read` and `orders:write` abilities
* PHP 8.0+

== Installation ==

1. Upload the `postage-wordpress` folder to `/wp-content/plugins/`, or install the zip via Plugins → Add New → Upload Plugin.
2. Activate the plugin.
3. Go to the "Postage" menu, enter your Postage site URL, API token and ship-from address.
4. Add `[postage_rate_calculator]` and/or `[postage_buy_label]` to a page (in the block editor, via a Shortcode block).

== Changelog ==

= 1.0.1 =
* Fixed: the feature checkboxes could not be turned off — saving the settings form silently switched them back on.
* Fixed: settings not shown on the form (e.g. the default package type) were reset on every save.
* Fixed: the two shortcodes clashed when used on the same page; each form is now self-contained.
* Removed: the "Test mode" checkbox, which never did anything. Sandbox vs live depends only on whether you paste a Test or Live token.
* Removed: the rate-calculator/buy-label blocks, which could never be inserted (they were registered server-side only). Use a Shortcode block.

= 1.0.0 =
* Initial release: rate calculator shortcode/block, label purchase shortcode/block with an access-control setting.
