=== SatchelSoft Kündigungsbutton ===
Contributors: sammyawad8090
Tags: kündigungsbutton, kündigung, 312k bgb, woocommerce, subscriptions
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

The German cancellation button (§ 312k BGB): “Verträge hier kündigen”, a two-step cancellation page, instant confirmations and receipts.

== Description ==

If consumers can sign up for a subscription, membership or other continuing contract on your website, § 312k BGB (German Civil Code) requires you to let them cancel online just as easily. SatchelSoft Kündigungsbutton adds the complete cancellation path to any WordPress or WooCommerce site. It works as soon as you activate it:

1. **“Verträge hier kündigen”** appears in the footer of every page, or wherever you place the block or shortcode.
2. The link leads straight to a **confirmation page** that asks for the details the law lists: type of cancellation (and the reason for an extraordinary cancellation), name, email address for the confirmation, optional customer number, the contract and the requested termination date.
3. The customer submits the cancellation with the **“jetzt kündigen”** button.
4. They immediately see an **on-screen confirmation** with the date and time of receipt, which they can print or download, and they receive a **confirmation email**. You are notified at the same time.

= Made for German shops =

* German interface in formal “Sie” for every German locale, including “Deutsch (Sie)”, Austria and Switzerland, and English for all other languages. The statutory labels “Verträge hier kündigen” and “jetzt kündigen” always stay in German.
* No login, no retention offers, no pause options and no other content on the confirmation page, in line with the BGH judgment of 16 July 2026 (I ZR 200/25) on the confirmation page.
* Works with block and classic themes, on phones, and with keyboard and screen readers.
* A list of cancellations under Tools > Cancellations, with a status (New, In progress, Done) and whether both emails were sent.
* Privacy-friendly: data stays in your WordPress database. No IP addresses, no tracking, no external requests. Supports the WordPress personal data export and erasure tools and adds a suggested text to the privacy policy guide.
* Your records are kept when you delete the plugin, unless you choose otherwise in the settings.

WooCommerce is not required. The plugin records and confirms cancellations; it does not change or cancel subscriptions in your shop by itself, so you stay in control of processing each one.

= Pro add-on =

The optional Kündigungsbutton Pro, sold separately on sidecarsoft.com, adds PDF receipts, an export of your merchant actions, your own email wording and merchant-triggered cancellation in WooCommerce Subscriptions, Paid Memberships Pro and MemberPress. The free plugin is complete without it.

= A tool, not legal advice =

SatchelSoft Kündigungsbutton is a tool and does not provide legal advice. Whether and how § 312k BGB applies to your business, and keeping the cancellation page reachable at all times (not behind a login, page cache, maintenance mode or bot check), remain your responsibility. The Federal Court of Justice (BGH) will hear two cases on 5 November 2026 about whether a login may be required before cancelling (I ZR 272/25 and I ZR 275/25). Kündigungsbutton never requires a login.

== Installation ==

1. Install and activate the plugin under Plugins > Add New, or upload the `satchelsoft-kuendigungsbutton` folder to `wp-content/plugins`.
2. Open a private browser window (logged out) and check that “Verträge hier kündigen” appears in your site footer.
3. Make sure WordPress can send email reliably, for example with an SMTP plugin, because confirmations are sent by email.
4. Optional: under Settings > Kündigungsbutton, choose where notifications go and whether the footer link is shown automatically.
5. Submit one test cancellation and check both emails. Incoming cancellations appear under Tools > Cancellations.

== Frequently Asked Questions ==

= Do customers need an account? =

No. The cancellation page, the confirmation and the receipt all work without logging in. Logged-in customers get their name and email address pre-filled.

= Does the plugin cancel subscriptions automatically? =

No. Each cancellation is recorded, confirmed to the customer and sent to you, and you process it in your shop or subscription system. The Pro add-on can cancel a matching subscription for you, but only when you click the button.

= Where does the button appear? Can I place it myself? =

By default it appears in the footer of every page. You can also use the “Cancellation button” block or the `[kuendigungsbutton]` shortcode, for example in your theme’s footer, and then turn off the automatic footer link in the settings. The cancellation form is also available as the “Cancellation form” block and the `[kuendigungsformular]` shortcode; if you use it on your own page, keep that page free of other content and offers.

= What does the customer receive? =

Right after clicking “jetzt kündigen”: a confirmation page with the date and time of receipt and the full declaration, which they can print or download, and an email confirming receipt with the content of the declaration, the date and time of receipt and the requested termination date.

= What if the email cannot be sent? =

The confirmation page says so and asks the customer to save the receipt. Your notification and the list of cancellations show that the customer’s email failed, so you can send the confirmation yourself.

= Does it work with page caching? =

The cancellation page sends no-cache headers and pages with the form tell caching plugins not to cache them. If your host or CDN caches full pages, exclude URLs containing `kuebu_cancel` and `kuebu_receipt`.

= What data is stored? =

Name, email address, optional customer number, contract, type of cancellation, reason, requested termination date, the time of receipt (UTC), the status, whether the emails were sent, and a hash of the receipt link. No IP address is stored.

= What happens when I delete the plugin? =

Your cancellation records and settings are kept, because you may need them as evidence. To remove everything, tick “Permanently delete all cancellations and settings” under Settings > Kündigungsbutton before deleting the plugin.

= Does the plugin make external requests? =

No. Emails use the mail setup of your WordPress site.

== Screenshots ==

1. The “Verträge hier kündigen” link in the footer of a shop.
2. The cancellation page with the required details and the “jetzt kündigen” button.
3. The immediate confirmation with the date and time of receipt.
4. The list of cancellations in the WordPress admin.
5. The settings page.

== Changelog ==

= 1.0.3 =
* New name on WordPress.org: SatchelSoft Kündigungsbutton (slug and text domain `satchelsoft-kuendigungsbutton`).
* Settings, cancellations, shortcodes and blocks are unchanged. If you installed an earlier version from a ZIP (folder `kuendigungsbutton`), deactivate and delete it before activating this one; your data is kept.
* Kündigungsbutton Pro needs version 1.0.4 or later with this plugin.

= 1.0.2 =
* All internal names now use the unique prefix `kuebu_` instead of `kb_` (WordPress.org asks for prefixes of at least 4 characters): database table, options, transient, hooks, form actions, nonces, query arguments, admin page slug, script handle and CSS classes.
* Automatic migration from 1.0.0 and 1.0.1 on update: the table `{prefix}kb_requests` is renamed to `{prefix}kuebu_requests` (reference numbers and receipt links stay valid) and the settings move to `kuebu_settings`. Nothing to do for you.
* Old addresses keep working: `?kb_cancel=1` and receipt links from confirmation emails already sent redirect to the new addresses (`?kuebu_cancel=1`, `?kuebu_receipt=…`).
* Unchanged: the shortcodes `[kuendigungsbutton]` and `[kuendigungsformular]` and the blocks `kuendigungsbutton/button` and `kuendigungsbutton/form`.
* For developers: the hooks are now `kuebu_email_intro`, `kuebu_email_body`, `kuebu_receipt_links`, `kuebu_pdf`, `kuebu_admin_tools`, `kuebu_admin_request` and `kuebu_admin_messages`. If you styled the page with your own CSS, change `.kb-…` selectors to `.kuebu-…`. Kündigungsbutton Pro needs version 1.0.3 or later.

= 1.0.1 =
* German texts reworked throughout: formal “Sie”, consistent legal terms. German is now used for every German locale, including “Deutsch (Sie)”.
* Cancellation page: clearer labels and hints, date picker for the requested termination date, choice buttons for the type of cancellation, mobile-friendly layout, pre-filled name and email for logged-in customers.
* Accessible error messages that keep the customer’s input. An expired page no longer blocks a cancellation: the form is shown again with the input kept.
* After submitting, the customer is redirected to the confirmation, so reloading cannot submit twice. Date and time of receipt are shown in your site’s time zone, plus UTC.
* Emails: greeting, clear subjects with a reference number, your site name, Reply-To set to the customer on your notification, and a warning to you if the customer’s confirmation could not be sent.
* New list of cancellations (Tools > Cancellations) with an empty state, status labels, email results and paging.
* New settings page: footer link on or off, notification address, optional data deletion when the plugin is deleted.
* Blocks: preview in the editor; colour, size and spacing options for the button block.
* Suggested privacy policy text and an uninstall routine.

= 1.0.0 =
* First public release: footer button, shortcodes and blocks, public cancellation form, consumer and merchant email confirmations, timestamped receipts, admin list, privacy export and erase, German and English.

== Upgrade Notice ==

= 1.0.3 =
New name: SatchelSoft Kündigungsbutton. Deactivate and delete an earlier ZIP install (folder kuendigungsbutton) first; cancellations and settings are kept. Kündigungsbutton Pro users: update Pro to 1.0.4.

= 1.0.2 =
Internal names now use the prefix kuebu_. Your cancellations and settings are migrated automatically. If you use Kündigungsbutton Pro, update it to 1.0.3.
