Getting started

Requirements

  • WordPress 6.9 or newer
  • PHP 8.1 or newer
  • A Stripe account

WooCommerce is optional. If you have it, see Stripe or WooCommerce first — it changes how subscriptions and accounts work.

1. Install and activate

Upload the plugin and activate it. Settings → Fabrica Monetization Kit appears, with six tabs: Monetization, Gateways, Accounts & login, Advanced, License, and Hooks (a read-only reference to the plugin’s filters and actions). On a multisite subsite there is no License tab, since the network’s main site holds the licence. A site that only gates, with fabrica_monetization_kit_restriction_only on, has no Accounts & login tab (Gating without selling).

Enter your licence details on the License tab.

2. Connect Stripe

Go to Gateways and enter your Stripe keys in the Stripe keys card, from the Stripe dashboard:

  • Publishable key — starts pk_. Safe to expose; it goes into the page.
  • Secret key — starts sk_, or rk_ for a restricted key. Never leaves the server.

Once saved, the secret key is never shown again, not even in the page source. Its field stays empty, with a hint naming only the kind of key saved, such as sk_live_…. Leave it empty to keep the saved key, paste a new one to replace it, or tick Remove saved key under it to delete it. The webhook secret works the same way. The publishable key stays visible, since it is public anyway.

Where the plugin holds the keys itself, test and live mode are read from the key prefix. There is no separate switch, so a pk_test_ key simply means the site is in test mode. Where WooCommerce Stripe holds them, its own test-mode setting chooses the pair instead.

If WooCommerce Stripe is installed and configured, the plugin reads its keys instead and the card shows what WooCommerce Stripe holds for each mode in place of the fields. WooCommerce Stripe is then the single place to manage them.

Lock warning

Once live payments have been taken, the site locks to that Stripe account and the key fields and their Remove saved key boxes are disabled; saving the tab leaves the stored keys as they are. This protects existing subscriptions: pointing a site at a different Stripe account would orphan every subscriber. Moving accounts deliberately means adding this to wp-config.php, reloading, and saving the new keys:

define('FMK_ALLOW_STRIPE_ACCOUNT_CHANGE', true);

The Gateways tab checks the keys in use against the locked account each time it opens. If they belong to another account, or cannot be checked at all, it says so and the plugin takes no Stripe payments until the locked account’s keys are back. Where WooCommerce Stripe holds the keys the lock covers them too, so point WooCommerce Stripe at another account only when moving accounts on purpose.

3. Set up the webhook

This step is not optional. Without it, cancellations, failed payments and renewals at Stripe never reach your site, and readers keep access after cancelling.

Your webhook URL is your site address followed by /wp-json/fabrica-monetization-kit/v1/stripe-webhook. The Gateways tab’s Webhook card shows it along with the exact events to subscribe to, and you paste Stripe’s signing secret into its Webhook secret field.

If WooCommerce Stripe is installed and configured, press Set up endpoint in that card instead: the plugin creates its endpoint with WooCommerce Stripe’s keys and keeps the secret itself. It needs only invoice.payment_succeeded there, alongside the endpoint WooCommerce Stripe creates for itself, through which the plugin receives its other events. Press it again after switching WooCommerce Stripe between test and live. It is needed only if a contribution block sells a Stripe product, and the tab warns only then.

Full detail in Webhooks.

4. Create an account page

Readers need somewhere to log in, see what they have bought and manage their subscription.

On a site with no WooCommerce, add a page containing the Account block (or the [fmk_account] shortcode) and set it under Accounts & login → Account page. If you skip this, the plugin will warn you in the admin and offer to create the page for you — worth accepting, because without a valid account page new readers get WordPress’s stock login email instead of your set-password page.

On a WooCommerce site, the existing My Account page already does this job.

5. Decide what gets gated

Not everyone needs this. If you are gating nothing — a membership page, a donation campaign — you can stop after this step. Add the Contributions block and set its amounts on the block, or pick your tiers under Monetization → Memberships and add the Membership block. Neither restricts anything, so the rest of this page does not apply.

Under Monetization → Paywall → What gets gated, choose what the plugin gates:

  • Only posts with a Paywall block — nothing is gated until you add the block. The safest way to start.
  • All posts of selected types — everything of the chosen post types is gated.
  • Posts in selected taxonomies — anything carrying a term in the taxonomies you pick.

Start with the first. You can gate a single post and check the result before touching the rest of the site.

6. Put up your first wall

Edit a post, add the Paywall block where the free preview should end, and publish. Then view the post while logged out — anyone who can edit posts is waved past the wall, Contributors and Authors included, so a normal browser window will mislead you.

7. Sell something

A fresh install already prices a single post at 75p, so your first wall has something to sell whether you meant it to or not. Under Monetization → Paywall, change that Default post price under One-off purchases, pick a product under Subscriptions, or both — before you switch to live keys. The wall only offers what is actually available for that post.

Testing before you go live

Use Stripe test keys and Stripe’s test cards — 4242 4242 4242 4242 with any future expiry and any CVC will succeed.

Check the whole path in a logged-out window: preview, wall, payment, and the account page afterwards. Watching a subscription cancel at Stripe and seeing access disappear on the site is the one test that proves your webhook is working.

Removing the plugin

Deleting the plugin from the Plugins screen leaves its data in place, so a reinstall picks up where it left off. To erase it instead, tick Advanced → Delete all data on uninstall before deleting. That removes the plugin’s settings, campaign totals and contributor lists, its cached data, the _fmk_ meta it keeps on posts, terms and orders, and its Customer and Member roles. The Stripe customer and payment IDs that WooCommerce Stripe shares are kept.

Readers’ purchases, entitlements and contributions live in user meta, which is erased too on a single site. On a multisite network it is kept, because one table holds every site’s readers and uninstalling does not separate one site’s records from another’s.