Industrial Cost Calculator
A professional WordPress plugin for industrial B2B cost estimation with advanced material, welding, consumable, execution, overhead, and dual-range profit calculations.
by Your Company · github.com/hamzaraees42-dev/industrial-cost-calculator-wp · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/hamzaraees42-dev/industrial-cost-calculator-wp/archive/refs/heads/main.zipIndustrial Cost Calculator - WordPress Plugin
A comprehensive B2B cost calculator plugin for WordPress, specifically designed for industrial projects including tables, staircases, piping, and electrical calculations.
Features
- Multiple Calculator Types: Table calculator (with support for additional calculators)
- Complex Cost Calculations: Automatically calculates materials, consumables, execution costs, overhead, and profit margins
- Dual Range Pricing: Provides both lower and higher cost estimates
- Material Database: Comprehensive database of materials with prices
- Drag-and-Drop Form Builder: (Future feature) Create custom calculators easily
- PDF Export: Generate professional PDF quotes
- Email Notifications: Automatic emails to customers and admins
- User Access Control: Only logged-in users can access calculators
- Calculation History: Track all calculations
- Shortcode Support: Embed calculators anywhere on your site
Installation
Method 1: Manual Installation
- Download the plugin folder
industrial-calculator-plugin - Upload to
/wp-content/plugins/directory - Activate the plugin through the 'Plugins' menu in WordPress
- The plugin will automatically create necessary database tables
Method 2: ZIP Installation
- Compress the
industrial-calculator-pluginfolder into a ZIP file - In WordPress admin, go to Plugins > Add New > Upload Plugin
- Choose the ZIP file and click Install Now
- Activate the plugin
Initial Setup
1. Populate Materials Database
After activation, you need to add material pricing. Go to Cost Calculator > Materials in the WordPress admin.
You can also run this SQL directly in your database (adjust table prefix if different from wp_):
-- Square Tube Grade 316 Prices
INSERT INTO wp_icc_materials (calculator_id, material_type, grade, size, finish, price) VALUES
(1, 'Square Tube', 'Grade 316', '15x15x1', NULL, 100),
(1, 'Square Tube', 'Grade 316', '15x15x1.5', NULL, 100),
(1, 'Square Tube', 'Grade 316', '15x15x2', NULL, 100),
(1, 'Square Tube', 'Grade 316', '20x20x1.5', NULL, 100),
(1, 'Square Tube', 'Grade 316', '20x20x2', NULL, 150),
(1, 'Square Tube', 'Grade 316', '20x20x2.5', NULL, 100),
(1, 'Square Tube', 'Grade 316', '25x25x2', NULL, 170),
(1, 'Square Tube', 'Grade 316', '25x25x2.5', NULL, 100),
(1, 'Square Tube', 'Grade 316', '25x25x3', NULL, 100),
(1, 'Square Tube', 'Grade 316', '30x30x2', NULL, 245),
(1, 'Square Tube', 'Grade 316', '30x30x2.5', NULL, 100),
(1, 'Square Tube', 'Grade 316', '30x30x3', NULL, 100),
(1, 'Square Tube', 'Grade 316', '40x40x2', NULL, 320),
(1, 'Square Tube', 'Grade 316', '40x40x2.5', NULL, 100),
(1, 'Square Tube', 'Grade 316', '40x40x3', NULL, 435),
(1, 'Square Tube', 'Grade 316', '40x40x4', NULL, 100),
(1, 'Square Tube', 'Grade 316', '40x40x5', NULL, 100),
(1, 'Square Tube', 'Grade 316', '50x50x2', NULL, 100);
-- Plain Sheet Grade 316 Prices
INSERT INTO wp_icc_materials (calculator_id, material_type, grade, size, finish, price) VALUES
(1, 'Plain Sheet', 'Grade 316', '1220x2400x0.5', 'Mirror', 250),
(1, 'Plain Sheet', 'Grade 316', '1220x2400x0.5', 'Brush', 270),
(1, 'Plain Sheet', 'Grade 316', '1220x2400x1', 'Mirror', 250),
(1, 'Plain Sheet', 'Grade 316', '1220x2400x1', 'Brush', 550),
(1, 'Plain Sheet', 'Grade 316', '1220x2400x1.2', 'Mirror', 250),
(1, 'Plain Sheet', 'Grade 316', '1220x2400x1.2', 'Brush', 675),
(1, 'Plain Sheet', 'Grade 316', '1220x2400x1.5', 'Mirror', 250),
(1, 'Plain Sheet', 'Grade 316', '1220x2400x1.5', 'Brush', 775),
(1, 'Plain Sheet', 'Grade 316', '1220x2400x2', 'Mirror', 250),
(1, 'Plain Sheet', 'Grade 316', '1220x2400x2', 'Brush', 830),
(1, 'Plain Sheet', 'Grade 316', '1220x2400x2.5', 'Mirror', 250),
(1, 'Plain Sheet', 'Grade 316', '1220x2400x2.5', 'Brush', 250);
-- Add Grade 304 and MS materials with same sizes
-- (You can copy the above and change 'Grade 316' to 'Grade 304' and 'MS')
2. Configure Labour Settings
Go to Cost Calculator > Labour to adjust:
- Team size
- Cost per day (lower and higher ranges)
- Welding inches per day (lower and higher ranges)
3. Configure Consumables
Go to Cost Calculator > Consumables to adjust prices for:
- Argon Gas
- Grinding Disc
- Cutting Disc
- Buffing Disc
- Wire Brush
Usage
Embedding the Calculator
Use the shortcode in any page or post:
[icc_table_calculator]
Or specify a calculator by ID:
[icc_table_calculator id="1"]
Form Fields
The table calculator includes these fields:
- Frame Style: Square Tube, Rectangular Tube, C-Channel, L-Angle, Round Pipe
- Grade: Grade 316, Grade 304, MS
- Size: Various dimensions (e.g., 15x15x1, 20x20x2)
- Material Finish: Brush, Mirror, Painted, Galvanized
- Footing Type: Base plate, Wheels, Rubber Caps, Height adjustable rubber base
- Marine Ply: With/Without
- Load (KG): Expected weight capacity
- Load Description: Details about the load
- Installation Required: Yes/No
- Dimensions: Length, Width, Height (in meters)
- Quantity: Number of tables needed
Calculation Output
Users receive:
- Materials Summary: List of materials needed (without prices)
- Consumables Summary: Quantities of consumables used (without prices)
- Execution Details: Days required and team size
- Magic Numbers: Two cost estimates
- Lower Range: Conservative pricing with 6% overhead
- Higher Range: Premium pricing with 9% overhead
PDF Export
After calculation, users can download a comprehensive PDF report with all details.
Email Notifications
- Customer Email: Contains cost estimates and specifications
- Admin Email: Contains all form data and calculation results
Admin Features
Manage Calculators
- View All: See all created calculators
- Add New: Create new calculator configurations
- Edit: Modify existing calculators
- Duplicate: Copy calculators for variations
- Delete: Remove unused calculators
Materials Management
- Add/edit/delete materials
- Set prices for different grades and sizes
- Organize by calculator type
Consumables Management
- Adjust consumable prices
- Modify usage rates
- Add new consumables
Labour Settings
- Configure team size
- Set daily costs
- Adjust welding rates
Calculation History
View all calculations made by users including:
- User details
- Date/time
- Form data submitted
- Calculated results
- PDF links
Calculation Logic
Material Calculation
Square Tube Requirements:
Total Meters = (Length × 2) + (Width × 2) + (Height × 4) + ((Length × 2 - 1) × Width)
Tubes Needed = Total Meters ÷ 6 (standard tube length)
Top Sheet Requirements:
Thickness = Load (KG) ÷ 200 (rounded to nearest 0.5mm)
Sheets Needed = ceil(Length ÷ 1.22) × ceil(Width ÷ 2.4)
Welding Calculation
Seven welding steps calculated based on table dimensions and tube size:
- Top Frame Corner
- Top Frame Middle Bar
- Table Legs
- Bottom Frame
- Sheet Corner
- Sheet Outer & Inner
- Sheet to Middle Bar
Total inches with 10% wastage for higher range.
Consumables Calculation
- Argon Gas: 10 inches per kg
- Discs: 41 inches per disc (<4mm), 20.5 inches (≥4mm)
- Wire Brush: 1 per 200 inches
- Misc: 15% of total consumables
Execution Calculation
Days Required:
Days = Total Welding Inches ÷ Welding Inches Per Day
Days Rounding:
- ≤ 1.2 days → 1 day
- 1.2 to 1.7 days → 1.5 days
-
1.7 days → Rounded up
Final Cost Calculation
Lower Range:
Subtotal = Materials + Consumables + Execution
Overhead = Subtotal × 6%
Total Before Profit = Subtotal + Overhead
Profit = Total Before Profit × Profit %
Final = Total Before Profit + Profit
Higher Range:
Same as above but with 9% overhead and higher profit percentages
Profit Percentages: | Total Cost Range | Lower Profit | Higher Profit | |-----------------|--------------|---------------| | 1,000 - 35,000 | 25% | 40% | | 35,001 - 500,000 | 20% | 35% | | 500,001+ | 15% | 30% |
Customization
Adding New Calculator Types
- Create new calculator class in
/includes/calculators/ - Extend base calculator functionality
- Add calculator type to admin interface
- Create corresponding frontend form
Modifying Formulas
All calculation formulas are in the calculator class files. Modify the methods:
calculate_materials()calculate_welding_inches()calculate_consumables()calculate_execution()calculate_final_costs()
Styling
- Admin CSS:
/admin/css/admin-style.css - Frontend CSS:
/frontend/css/frontend-style.css
Email Templates
Modify email templates in:
/includes/class-icc-email.php
PDF Templates
Modify PDF layout in:
/includes/class-icc-pdf.php
Requirements
- WordPress 5.0 or higher
- PHP 7.4 or higher
- MySQL 5.6 or higher
- TCPDF library (for PDF generation)
Installing TCPDF
Via Composer:
cd /path/to/plugin
composer require tecnickcom/tcpdf
Manual:
- Download TCPDF from https://tcpdf.org/
- Extract to
/includes/tcpdf/ - Include in main plugin file
Security
- User authentication required
- AJAX nonce verification
- Data sanitization and validation
- Capability checks for admin functions
- SQL injection prevention via prepared statements
Future Enhancements
- [ ] Drag-and-drop form builder
- [ ] Staircase calculator
- [ ] Piping calculator
- [ ] Electrical calculator
- [ ] Multi-currency support
- [ ] Quote versioning
- [ ] Customer portal
- [ ] Advanced reporting
- [ ] Integration with accounting software
Support
For support, please contact: support@yourcompany.com
License
This plugin is proprietary software. All rights reserved.
Changelog
Version 1.0.0
- Initial release
- Table calculator functionality
- Material database
- PDF generation
- Email notifications
- Admin interface
- Calculation history
Credits
Developed by: M Hamza Raees