A modern, SaaS-style profit calculator WordPress plugin โ with live projections, animated counters, and a beautiful Chart.js dashboard. Drop it anywhere with a single shortcode.
| Feature | Details |
|---|---|
| ๐ Live Chart | Interactive Chart.js line chart โ Total Sales vs Gross Profit |
| ๐ข Animated Counters | Smooth ease-out cubic animation on every value update |
| ๐ฑ Multi-Currency | 9 currencies: USD, EUR, GBP, INR, JPY, AUD, CAD, AED, SAR |
| ๐ Duration Selector | Switch between 6, 12, or 24-month projections instantly |
| ๐ Compound Growth | Monthly growth rate applied with exponential compounding |
| ๐ Input Validation | Real-time error highlighting with boundary checks |
| ๐ฑ Fully Responsive | Mobile-first, adapts gracefully from 400px to 4K |
| ๐งฉ Shortcode-Ready | Single line [profit_calculator] drops it anywhere |
| โก Zero jQuery | Pure vanilla JS โ no bloat, no dependencies beyond Chart.js |
Option A โ Upload via WordPress Admin
- Go to Plugins โ Add New โ Upload Plugin
- Choose
profit-calculator-pro.zip - Click Install Now, then Activate
Option B โ Manual Upload via FTP
wp-content/
โโโ plugins/
โโโ profit-calculator-pro/
โโโ profit-calculator-pro.php
โโโ assets/
โโโ css/
โ โโโ profit-calculator.css
โโโ js/
โโโ profit-calculator.js
Paste this shortcode into any page, post, or widget:
[profit_calculator]
With a custom currency:
[profit_calculator currency="โฌ"]
That's it โ the calculator renders automatically. ๐
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ฅ Calculator Inputs โ Profit Projections 24 Monthsโพโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Avg. Order Value โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโ โ
โ $ [ 120.00 ] โ โ $216.00K โ โ $54.00K โ โ$18.00K โ โ
โ โ โTOTAL โ โGROSS โ โDELIVERYโ โ
โ Commission per Order (%) โ โSALES โ โPROFIT โ โFEE โ โ
โ [ 25 ] % โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโ โ
โ โ โ
โ Avg. Daily Orders โ โฒ $25K โญโโโโโโโโโโโโโโโโโโโโโโโโโโฎ โ
โ [ 50 ] /day โ โญโฏ Total Sales โ โ
โ โ โฒ $10Kโ โญโโโโโโโโโโโโโโโโโโโโฏ โ
โ Delivery Fee per Order โ โญโฏ Gross Profit โ
โ $ [ 5.00 ] โ โฒ $0 โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ M1 M4 M8 M12 M16 M20 M24 โ
โ Monthly Growth Rate (%) โ โ
โ [ 5 ] % โ โ
โ โ โ
โ Currency [ $ USD ] โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
| Input | Default | Description |
|---|---|---|
| Avg. Order Value | $120.00 |
Average revenue generated per single order |
| Commission per Order | 25% |
Your margin or commission rate on each order (max 100%) |
| Avg. Daily Orders | 50 |
Number of orders received per day on average |
| Delivery / Service Fee | $5.00 |
Fee charged per order for delivery or service |
| Monthly Growth Rate | 5% |
Compound monthly growth applied to order volume |
| Currency | $ USD |
Symbol displayed throughout the calculator |
| Duration | 24 Months |
Projection window: 6, 12, or 24 months |
The calculator uses compound growth applied monthly to your daily order volume:
Monthly Orders = Daily Orders ร 30 ร (1 + growthRate)^(month - 1)
Monthly Sales = Monthly Orders ร Avg. Order Value
Monthly Profit = Monthly Sales ร (Commission% / 100)
Monthly Delivery= Monthly Orders ร Delivery Fee
Total Sales = ฮฃ Monthly Sales (over N months)
Gross Profit = ฮฃ Monthly Profit (over N months)
Total Delivery = ฮฃ Monthly Delivery (over N months)
All values update instantly as you type โ no submit button needed.
| Symbol | Currency |
|---|---|
$ |
USD โ US Dollar |
โฌ |
EUR โ Euro |
ยฃ |
GBP โ British Pound |
โน |
INR โ Indian Rupee |
ยฅ |
JPY โ Japanese Yen |
A$ |
AUD โ Australian Dollar |
C$ |
CAD โ Canadian Dollar |
AED |
UAE Dirham |
SAR |
Saudi Riyal |
profit-calculator-pro/
โโโ profit-calculator-pro.php โ Plugin bootstrap, shortcode, asset loader
โโโ assets/
โโโ css/
โ โโโ profit-calculator.css โ All styles (scoped to .pcp-wrap)
โโโ js/
โโโ profit-calculator.js โ Calculator logic + Chart.js integration
PCP_VERSION // Cache-busting version (uses time() in dev)
PCP_PLUGIN_DIR // Absolute server path to plugin folder
PCP_PLUGIN_URL // Public URL to plugin folder[profit_calculator currency="โฌ"]| Attribute | Default | Type | Description |
|---|---|---|---|
currency |
$ |
string |
Currency symbol shown in inputs and stat cards |
You can override the currency symbol programmatically via the pcp_currency_symbol filter:
add_filter( 'pcp_currency_symbol', function( $symbol ) {
return 'โฌ';
} );CSS and JS are only enqueued when the shortcode is present on the page โ your site's performance is not affected on pages without the calculator.
// Triggered inside pcp_render_shortcode(), not globally
pcp_enqueue_assets();The JS is a self-contained IIFE module โ no global pollution, no jQuery required.
ProfitCalculator
โโโ init(root) โ bootstraps DOM refs, chart, events
โโโ bindEvents() โ attaches input/change listeners
โโโ onInputChange(e) โ debounced handler (80ms)
โโโ validateField(el) โ inline validation with error state
โโโ getInputs() โ reads + sanitises all values
โโโ calculate(inputs) โ core math, returns arrays for chart
โโโ update() โ orchestrates counters + chart refresh
โโโ animateCounter() โ requestAnimationFrame ease-out animation
โโโ formatCurrency() โ smart B/M/K formatting with symbol
โโโ formatAxisValue() โ Y-axis tick label formatter
โโโ initChart() โ Chart.js initialisation
โโโ chartOptions() โ full Chart.js options object
โโโ updateChart() โ pushes new data, triggers re-render
All styles are scoped under .pcp-wrap to prevent conflicts with your theme:
.pcp-wrap { /* CSS custom properties declared here */ }
.pcp-wrap * { box-sizing: border-box; }| Breakpoint | Behaviour |
|---|---|
> 1100px |
Two-column layout: 360px inputs + fluid results |
900โ1100px |
Narrower inputs column: 300px |
< 900px |
Single-column stacked layout, inputs panel un-sticks |
< 640px |
Cards stack vertically, duration select goes full-width |
< 400px |
Stat card values shrink to 17px for compact display |
| Field | Rule |
|---|---|
| All numeric fields | Must be โฅ 0 and a valid number |
| Commission (%) | Must be โค 100 |
| Invalid state | Red border + box-shadow highlight applied via .pcp-input--error |
| Library | Version | How It's Loaded |
|---|---|---|
| Chart.js | 4.4.0 |
CDN via wp_enqueue_script |
| DM Sans | โ | Google Fonts @import in CSS |
| DM Mono | โ | Google Fonts @import in CSS |
No jQuery. No other dependencies.
| Requirement | Minimum |
|---|---|
| WordPress | 5.5+ |
| PHP | 7.4+ |
| Browser | Any modern browser (Chrome, Firefox, Safari, Edge) |
- All shortcode attributes are passed through
shortcode_atts()with defined defaults - Output is escaped with
esc_attr()andesc_html()before rendering - Plugin aborts immediately if accessed outside WordPress (
ABSPATHcheck)
if ( ! defined( 'ABSPATH' ) ) {
exit; // No direct access
}Q: Can I use the shortcode more than once on the same page?
A: The calculator targets a single #pcp-root element. For multiple instances, reach out for a custom build.
Q: Will this slow down my site?
A: No. Assets are only enqueued on pages that contain the shortcode, and Chart.js is loaded from a fast CDN.
Q: Can I change the default values?
A: Default values (120 order value, 25% commission, 50 daily orders, etc.) are set in the HTML rendered by the shortcode. You can modify profit-calculator-pro.php to change them.
Q: Does it work with page builders?
A: Yes โ paste [profit_calculator] into any shortcode block in Elementor, Divi, Beaver Builder, or the default Gutenberg editor.
Q: Can I change the chart colors?
A: Yes. In profit-calculator.js, find the datasets array inside initChart() and update the borderColor and backgroundColor values.
Licensed under the GPL-2.0+ license.
You are free to use, modify, and distribute this plugin in accordance with the terms of the GPL.
Muhammad Hussain Mehrani
๐ ninjascode.com
Powered by Enatega โ Open-source food delivery solution.
- SaaS-style two-panel layout (inputs + results)
- Live Chart.js line chart with animated transitions
- Animated stat card counters (ease-out cubic)
- 9 currency options with dynamic symbol updates
- 6 / 12 / 24-month duration selector
- Compound monthly growth rate calculation
- Real-time input validation
- Fully responsive design (mobile โ 4K)
- Zero jQuery dependency
- Assets conditionally loaded via shortcode detection
Built with โค๏ธ by NinjasCode ยท Powered by Enatega