Use case · Custom plugin

Add a pricing calculator to your WordPress website

For service businesses whose prices follow clear rules. Claude turns those rules into a small plugin with a shortcode — you test it, then decide when to activate it.

  • Example workflow · Meikero Pro
  • Write access to one approved plugin folder
  • Activation stays a separate manual step

Example workflow. The business and rates below are fictional, and the code has not been run as part of this article. Treat it as a plan to adapt and test.

The situation

A fictional window-cleaning company, Northfield Windows, answers the same question every day: “How much for my house?” The answer follows rules, so a calculator on the website could give an estimate instantly and send serious enquiries to the contact form.

Assumed rules for this example: a €40 call-out fee, €4 per window, 25% extra for upper floors, and a minimum price of €60.

What you’ll make

A small custom plugin with one prefixed shortcode, such as [northfield_quote], that shows an accessible form and an estimate. You place the shortcode on any page. Keeping it in a plugin means the calculator survives a theme change.

What you need

  • Claude connected to your site, ideally a staging copy.
  • Meikero Pro and write access to the new plugin’s folder in Meikero’s folder permissions. Depending on your setup, you may need to create the empty folder first. See Free and Pro.
  • Your exact calculation rules and three to five worked examples with known answers.

How it works

  1. Write down the rules

    Inputs, rates, rounding, minimums and what happens with unusual values. Ambiguous rules produce ambiguous code.

  2. Agree a plan

    Claude proposes the file structure, shortcode name, inputs and where the calculation runs, then waits.

  3. Create the files

    Claude writes the plugin into the approved folder. PHP files that would not parse are refused, and writes keep automatic backups.

  4. Read back and test

    Claude reads the files back; you activate on staging and check every worked example.

Build it safely

The WordPress Plugin Handbook covers the basics and security. Its shortcode guidelines are short and worth following: return output instead of echoing it, prefix the shortcode name, sanitise input and escape output.

  • Validation: treat every input as untrusted. Window counts must be whole numbers within a sensible range; reject or correct anything else with a clear message.
  • Escaping: escape everything printed, including the result and any echoed input.
  • Accessibility: use real labels, native inputs and buttons, keyboard-reachable controls and a result announced to screen readers.
  • Private rates: anything in frontend JavaScript is visible to visitors. If your rates or margins must stay private, calculate on the server and return only the estimate.

Test against known examples

InputExpected estimate
3 windows, ground floor€60 (€52 raised to the minimum)
10 windows, ground floor€80
12 windows, upper floor€110 (€88 + 25%)

If any result differs, the rules or the code need fixing before visitors see it.

Copy this prompt

Plan a small WordPress plugin that adds a pricing calculator shortcode. Use the available Meikero tools.

1. Read the site information and confirm which plugin folder you may write to. Do not touch any other folder.
2. Propose: plugin folder and file names, a prefixed shortcode name, the form fields, validation rules, where the calculation runs (server-side if the rates must stay private), how output is escaped and how the form works with a keyboard and screen reader. Wait for my approval.
3. After I approve, create the plugin files in the approved folder only. The shortcode must return its output, not echo it.
4. Read every file back and show me how each of my worked examples would be calculated by the code.
5. Do not activate the plugin or add the shortcode to any page. Tell me exactly what I need to test after activating it on staging.

Rules: ...
Worked examples: ...

Review before activating

  • All worked examples return the expected numbers, including edge cases and invalid input.
  • The form is usable with a keyboard only and on a phone.
  • No private rates appear in page source or JavaScript.
  • The estimate is clearly labelled as an estimate, not a binding quote.

Limits and recovery

Creating files does not activate or validate the plugin. Meikero has no activation tool: you activate it under Plugins on staging, test it, then deploy with your normal process. A syntax check cannot catch wrong maths or runtime errors. Save a checkpoint of the plugin folder before changes; it covers that folder’s text files, not the database or the rest of the site.

FAQ

Why a plugin instead of the theme?

Functionality like a calculator should keep working if you change themes, so a small plugin is the cleaner home.

Can Claude add the calculator to a page too?

Yes, once the plugin is active and tested, adding the shortcode to a page is a normal content edit — ask for it separately.

Is the estimate legally binding?

That is your business decision. Most service businesses label calculator output as an estimate and confirm the final price separately.


Related workflows

Make your own tools.

Small, well-tested plugins for the jobs your site does every day.