Setting up pricing with an AI agent
Live Pricing for Freemius has an agent interface. An AI agent working on your site, such as Claude, can read your products and settings, save the whole set up as one file, and apply a file back. It works through two doors WordPress already has: WP-CLI, and on WordPress 6.9 or later the Abilities API.
The interface is part of the plugin. Nothing on your pages or your screens changes until an agent applies a change.
What an agent can and cannot do
| An agent can | An agent cannot |
|---|---|
| List your products by their Freemius product ID, with their names from Freemius | See or set a product's token, secret key or webhook |
| Read every setting, with its default and what it changes | Change the log level or the Share settings usage switch |
| Check each product's health, one fact per line | Overwrite a change you made in the admin since its file was saved, unless told to |
| Save the whole set up as one file and apply a file back | Edit a page |
| Preview a pricing card with your settings, without saving | Remove a product, unless it runs as an administrator |
| Refresh a product's prices from Freemius |
A product an agent adds has no token. It shows no price until you paste the product's token on its screen, the same as a product you add yourself.
Who may use it
Every ability and command needs the capability pflp_agent. The plugin gives
it to administrators, and to the shared plugupp_agent role when your site
has one. That role never gets manage_options, and removing a product needs
it, so an agent signed in with that role can never remove one.
The site file
The file holds every site-wide setting and every product by its Freemius product ID with its own Featured plan styling. It never holds a token, a secret key, a webhook address, the log level or the Share settings usage switch, so you can keep it with your site's other files and apply it to another site.
wp pflp site export --file=pricing.json
wp pflp site diff --file=pricing.json
wp pflp site apply --file=pricing.json --dry-run
wp pflp site apply --file=pricing.json
A second apply of the same file reports every item unchanged and writes nothing. A setting the file leaves out keeps its value.
One product can be saved and applied the same way:
wp pflp product export 33521 --file=product.json
wp pflp product apply --file=product.json --dry-run
Changes you make in the admin
When you save a setting tab or a product screen, the plugin records that you
edited it. If you did that after the agent's file was saved, the agent's next
apply is refused, so your change is not lost. The agent can save the file
again and carry your change over, or apply with --force to replace it.
Which pages say more
- Getting started - add a product and its token.
- Reference - every shortcode and block a page can carry.