Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .wordpress-org/screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
75 changes: 51 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,93 @@
# Freemius for WordPress

Contributors: freemius, xaverb
Tags: freemius, checkout, payment, button
Tags: freemius checkout, pricing table, block editor, customer portal, payment button
Requires at least: 6.6
Tested up to: 6.9
Stable tag: 0.4.2
License: MIT

Freemius for WordPress helps you to add Freemius Checkout to any button of your WordPress content using the block editor.
Add Freemius checkout, pricing tables, and a Customer Portal to WordPress with the Block Editor—no custom code required.

## Description

Freemius for WordPress is a powerful WordPress plugin that allows you to transform any block-based button into a Freemius checkout button. This makes it easy to integrate Freemius payment processing into your WordPress site with minimal effort.
Freemius for WordPress lets you sell Freemius products from the Block Editor (Gutenberg). Turn any Button into a Freemius checkout, build dynamic pricing tables with scopes and modifiers, manage multiple products in settings, and embed the Freemius Customer Portal so customers can manage licenses, billing, and downloads—without JavaScript, theme hacks, or custom coding.

<https://www.youtube.com/watch?v=MTOuIBGan7E>
**Not using the Block Editor?** See the [overlay checkout](https://freemius.com/help/documentation/selling-with-freemius/freemius-checkout-buy-button/) or [hosted checkout](https://freemius.com/help/documentation/selling-with-freemius/freemius-checkout-hosted-page/) in the Freemius docs.

### Key features

- Convert any block button to a Freemius checkout button
- Seamless integration with Freemius payment processing
- Customizable checkout experience
- Works with all block-based themes and plugins
- Native Block Editor support: Freemius checkout on Button blocks, with preview in the editor
- Dynamic pricing tables: plan columns, field mapping (price, title, description), and checkout CTAs
- Scope modifiers: currency, billing cycle, and license toggles on the page
- Multi-product settings: connect Product IDs and API tokens under Settings → Freemius
- Freemius Customer Portal block: embed the members dashboard (Store ID + Public Key)
- Compatible with modern block themes and classic themes that support the block editor
- Free and open source

### Roadmap
### Try it

- Support for Pricing tables.
- Better support to measure analytics.
- Dedicated Settings page.
- Testimonials (from the API).
- [WordPress Playground demo](https://playground.wordpress.net/?plugin=freemius)
- [Plugin documentation on GitHub](https://github.com/Freemius/freemius-wp-plugin/tree/main/docs)

https://www.youtube.com/watch?v=MTOuIBGan7E

## Installation

1. Upload the plugin files to the `/wp-content/plugins/freemius` directory, or install the plugin through the WordPress plugins screen directly
2. Activate the plugin through the 'Plugins' screen in WordPress
3. Place a button via the block editor into your page/post
4. Enable Freemius checkout in the button settings
5. Configure your product details and the button will automatically handle the checkout process.
1. Install and activate **Freemius for WordPress** from Plugins → Add New, or upload the plugin zip.
2. Open **Settings → Freemius** and add your product under **Products** (Product ID and Token from the [Freemius Developer Dashboard](https://dashboard.freemius.com/)).
3. Optionally set site-wide defaults under **Editor Settings**.
4. Add a **Button** block, enable **Freemius Checkout** in the Freemius panel, and use **Preview** before publishing.
5. For a pricing page: use Group/Columns with Freemius scopes, map plan fields, and add checkout buttons per plan.
6. For the Customer Portal: add the **Freemius Customer Portal** block and enter your **Store ID** and **Public Key**.

## Frequently Asked Questions

### How do I set up a Freemius checkout button?

Simply add a button block to your page or post, then enable the Freemius checkout option in the button settings. Configure your product details and the button will automatically handle the checkout process.
Add a **Button** block, turn on **Freemius Checkout** in the Freemius panel, and connect your product under **Settings → Freemius**. See the [getting started guide](https://github.com/Freemius/freemius-wp-plugin/blob/main/docs/getting-started.md) and [button docs](https://github.com/Freemius/freemius-wp-plugin/blob/main/docs/button.md).

### How do I build a Freemius pricing table?

Create a page with a scoped Group and one Column per plan, map price and plan fields, then add a checkout Button in each column. Details: [Creating your Pricing page](https://github.com/Freemius/freemius-wp-plugin/blob/main/docs/creating-your-pricing-page.md).

### How do I embed the Freemius Customer Portal?

Add the **Freemius Customer Portal** block and enter your **Store ID** and **Public Key** from the Freemius Developer Dashboard (Stores → Settings → Keys). See the [Customer Portal guide](https://github.com/Freemius/freemius-wp-plugin/blob/main/docs/customer-portal.md) and [Freemius portal documentation](https://freemius.com/help/documentation/users-account-management/embedding-customer-portal/).

### Can I customize the checkout experience?

Yes, you can customize various aspects of the checkout process through the plugin settings, including product details, pricing, and checkout flow.
Yes. Configure product details and site-wide defaults under **Settings → Freemius**, and adjust per-button Freemius options (plan, licenses, callbacks, and more) in the block sidebar.

### Is this plugin compatible with my theme?

The plugin works with any WordPress theme that supports the block editor (Gutenberg). It's designed to be compatible with all modern WordPress themes and plugins.
The plugin targets the Block Editor (Gutenberg). It works with block themes and classic themes that support the block editor.

### Where do I find the offical Freemius documentation?
### Where is pricing data loaded from?

Mapped prices and plan copy are saved when you edit and publish a page; the frontend does not call the Freemius API on every visit. After you change prices in the Freemius dashboard, reopen the page in the editor and **Update** it.

### Where do I find the official Freemius documentation?

[Freemius Documentation](https://freemius.com/help/documentation/)

## Screenshots

1. Button block settings with Freemius checkout option
2. Example of a Freemius checkout button in action
1. Freemius checkout preview in the block editor
2. Freemius scope modifiers on a pricing page
3. Published Freemius pricing page
4. Freemius Customer Portal for licenses, billing, and downloads
5. Freemius Products settings tab


## Changelog

## [Unreleased]

- added: Freemius Customer Portal block to embed the members dashboard on your site
- improved: portal block height adapts to iframe content with viewport-based limits instead of a fixed pixel size on the frontend
- improved: portal block editor preview height supports px, vh, vw, rem, em, and % units

## [0.4.2]

- fixed: missing import for MappingSettings
Expand Down
22 changes: 19 additions & 3 deletions screenshots/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ Playwright and the `/screenshot` Cursor command store PNGs here. The tree is **g

## Manifest

[`image-manifest.json`](image-manifest.json) lists all images: titles, descriptions, `use` type, optional Playwright `capture` URLs, and where each image belongs in docs.
[`image-manifest.json`](image-manifest.json) lists all images: titles, descriptions, `use` type, optional Playwright `capture` URLs, and where each image belongs in docs or WordPress.org assets.

| `use` | Storage | What happens |
| ----- | ------- | -------------- |
| `docs` | `screenshots/{id}/` + copy under doc `assets/` | Script copies into the doc path in `embed.path` and updates markdown |
| `review` | `screenshots/{id}/` | QA captures; no doc copy |
| `wordpress` | `screenshots/{id}/` and/or `docs/assets/` → `.wordpress-org/screenshot-N.png` | Script copies into `wordpress.path`, sets status, syncs README Screenshots captions |
| `review` | `screenshots/{id}/` | QA captures; no doc / WP.org copy |

Register or edit entries in the manifest; do not maintain a separate targets file.

**Manifest-first:** every doc PNG under `docs/**/assets/` and every `![alt](assets/...)` in markdown must have a matching `images[]` entry. Add or update the manifest in the same change set as the asset or markdown edit.
**Manifest-first:** every doc PNG under `docs/**/assets/` and every `![alt](assets/...)` in markdown must have a matching `images[]` entry. Every `.wordpress-org/screenshot-N.png` must have a matching `use: wordpress` entry. Add or update the manifest in the same change set as the asset or markdown edit.

## Layout

Expand All @@ -30,6 +31,7 @@ Editor captures use **post 428** on `dev.local`. See [`fixture-post-428.md`](fix

- Editor: `https://dev.local/wp-admin/post.php?post=428&action=edit`
- Frontend playground: `https://dev.local/playground/`
- Customer Portal (WP.org screenshot): `https://dev.local/portal/#!/licenses`

Override with `SCREENSHOT_FIXTURE_POST_ID` and `SCREENSHOT_PLAYGROUND_URL`.

Expand All @@ -46,10 +48,24 @@ npx playwright install chromium
npm run update-screenshots
npm run update-screenshots -- button-overview
npm run update-screenshots -- --force button-overview
npm run update-screenshots -- wporg-customer-portal
```

Or `/update-screenshots` in Cursor. See [`.cursor/skills/update-screenshots/SKILL.md`](../.cursor/skills/update-screenshots/SKILL.md).

Contributor inventory (manifest ids, capture status): [`INVENTORY.md`](INVENTORY.md) (generated by `npm run sync:screenshots-docs`).

**Compare thresholds:** `SCREENSHOT_MIN_DIFF_RATIO` (default `0.02`), `SCREENSHOT_ABORT_RATIO` (default `0.98`), `SCREENSHOT_COMPARE_TOLERANCE` (default `2`). Pass `--force` to always write PNGs.

## WordPress.org entries

`use: wordpress` entries require a `wordpress` block:

| Field | Purpose |
| ----- | ------- |
| `from` | `screenshots/{id}/source.png` or an existing `docs/assets/….png` |
| `path` | `.wordpress-org/screenshot-N.png` |
| `caption` | Text for the numbered Screenshots list in root `README.md` |
| `status` | `placeholder` until copied/captured, then `captured` |

After a successful wordpress update, the script rewrites the `## Screenshots` section in `README.md` from captions ordered by screenshot number.
88 changes: 88 additions & 0 deletions screenshots/image-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,94 @@
"alt": "Products tab on the Freemius settings page",
"status": "captured"
}
},
{
"id": "wporg-button-overview",
"title": "WordPress.org: checkout preview in the block editor",
"description": "Plugin directory screenshot of the Freemius checkout preview modal open in the block editor after clicking Preview.",
"use": "wordpress",
"match": [
"wordpress.org screenshot 1",
"checkout preview",
"preview modal"
],
"wordpress": {
"from": "docs/assets/docs-homepage-preview.png",
"path": ".wordpress-org/screenshot-1.png",
"caption": "Freemius checkout preview in the block editor",
"status": "captured"
}
},
{
"id": "wporg-customer-portal",
"title": "WordPress.org: Customer Portal licenses view",
"description": "Plugin directory screenshot of the Freemius Customer Portal embed on the licenses screen.",
"use": "wordpress",
"match": [
"wordpress.org screenshot 3",
"customer portal",
"licenses"
],
"capture": {
"url": "https://dev.local/portal/#!/licenses",
"viewports": [
"desktop"
]
},
"wordpress": {
"from": "screenshots/wporg-customer-portal/source.png",
"path": ".wordpress-org/screenshot-4.png",
"caption": "Freemius Customer Portal for licenses, billing, and downloads",
"status": "captured"
}
},
{
"id": "wporg-pricing-page",
"title": "WordPress.org: published pricing page",
"description": "Plugin directory screenshot of a published Freemius pricing page with plan columns and checkout buttons.",
"use": "wordpress",
"match": [
"wordpress.org screenshot 2",
"pricing page"
],
"wordpress": {
"from": "docs/assets/pricing-page-playground.png",
"path": ".wordpress-org/screenshot-3.png",
"caption": "Published Freemius pricing page",
"status": "captured"
}
},
{
"id": "wporg-scope-modifiers",
"title": "WordPress.org: scope modifiers",
"description": "Plugin directory screenshot of Freemius scope modifiers for currency, billing cycle, and licenses.",
"use": "wordpress",
"match": [
"wordpress.org screenshot 4",
"scope modifiers"
],
"wordpress": {
"from": "docs/assets/scope-modifiers.png",
"path": ".wordpress-org/screenshot-2.png",
"caption": "Freemius scope modifiers on a pricing page",
"status": "captured"
}
},
{
"id": "wporg-settings-products",
"title": "WordPress.org: Products settings tab",
"description": "Plugin directory screenshot of Settings → Freemius Products tab with Product ID and Token fields.",
"use": "wordpress",
"match": [
"wordpress.org screenshot 5",
"products settings"
],
"wordpress": {
"from": "docs/assets/settings-products.png",
"path": ".wordpress-org/screenshot-5.png",
"caption": "Freemius Products settings tab",
"status": "captured"
}
}
]
}
52 changes: 48 additions & 4 deletions screenshots/image-manifest.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
"useType": {
"type": "string",
"enum": [ "docs", "website", "review" ]
"enum": [ "docs", "wordpress", "review" ]
},
"embedStatus": {
"type": "string",
Expand Down Expand Up @@ -123,6 +123,29 @@
"status": { "$ref": "#/$defs/embedStatus" }
}
},
"wordpressBlock": {
"type": "object",
"additionalProperties": false,
"required": [ "from", "path", "caption", "status" ],
"properties": {
"from": {
"type": "string",
"pattern": "^(screenshots/[a-z0-9]+(-[a-z0-9]+)*/[^/]+\\.png|docs/assets/[^/]+\\.(png|jpg|jpeg|webp|gif))$",
"description": "Source under screenshots/{id}/ or a committed docs/assets file."
},
"path": {
"type": "string",
"pattern": "^\\.wordpress-org/screenshot-[0-9]+\\.png$",
"description": "WordPress.org plugin directory screenshot path."
},
"caption": {
"type": "string",
"minLength": 1,
"description": "README Screenshots section caption (numbered list text)."
},
"status": { "$ref": "#/$defs/embedStatus" }
}
},
"imageEntry": {
"type": "object",
"additionalProperties": false,
Expand All @@ -137,22 +160,43 @@
"items": { "type": "string", "minLength": 1 }
},
"capture": { "$ref": "#/$defs/captureBlock" },
"embed": { "$ref": "#/$defs/embedBlock" }
"embed": { "$ref": "#/$defs/embedBlock" },
"wordpress": { "$ref": "#/$defs/wordpressBlock" }
},
"allOf": [
{
"if": {
"properties": { "use": { "const": "docs" } },
"required": [ "use" ]
},
"then": { "required": [ "embed" ] }
"then": {
"required": [ "embed" ],
"not": { "required": [ "wordpress" ] }
}
},
{
"if": {
"properties": { "use": { "const": "wordpress" } },
"required": [ "use" ]
},
"then": {
"required": [ "wordpress" ],
"not": { "required": [ "embed" ] }
}
},
{
"if": {
"properties": { "use": { "const": "review" } },
"required": [ "use" ]
},
"then": { "not": { "required": [ "embed" ] } }
"then": {
"not": {
"anyOf": [
{ "required": [ "embed" ] },
{ "required": [ "wordpress" ] }
]
}
}
}
]
}
Expand Down
Loading
Loading