62% cost-calculator-builder

Code Review | Cost Calculator Builder

WordPress plugin Cost Calculator Builder scored62%from 54 tests.

About plugin

  • Plugin page: cost-calculator-b...
  • Plugin version: 3.1.65
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Aug 20, 2019
  • Latest release: Dec 2, 2023
  • Number of updates: 236
  • Update frequency: every 6.7 days
  • Top authors: stylemix (100%)

Code review

54 tests

User reviews

217 reviews

Install metrics

30,000+ active /1,083,811 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲2.86MB] [CPU: ▲8.32ms] Passed 4 tests

An overview of server-side resources used by Cost Calculator Builder
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /6.19 ▲2.7354.50 ▲13.77
Dashboard /wp-admin6.26 ▲2.9258.36 ▼3.98
Posts /wp-admin/edit.php6.32 ▲2.9663.21 ▲14.93
Add New Post /wp-admin/post-new.php8.80 ▲2.92105.67 ▲8.55
Media Library /wp-admin/upload.php6.13 ▲2.8954.69 ▲22.20
Orders /wp-admin/admin.php?page=cost_calculator_orders6.2247.44
Upgrade /wp-admin/admin.php?page=cost_calculator_gopro6.22220.07
Templates /wp-admin/admin.php?page=cost_calculator_templates6.1558.36
Settings /wp-admin/admin.php?page=cost_calculator_builder&tab=settings6.2948.87
Calculators /wp-admin/admin.php?page=cost_calculator_builder6.6980.17

Server storage [IO: ▲17.34MB] [DB: ▲1.88MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 363 new files
Database: 2 new tables, 120 new options
New tables
wp_cc_orders
wp_cc_payments
New WordPress options
calc_render_templates
stm_ccb_form_settings_18
stm_ccb_form_settings_88
stm_ccb_form_settings_136
stm_ccb_form_settings_92
stm_ccb_form_settings_64
stm_ccb_form_settings_184
stm_ccb_form_settings_170
stm_ccb_form_settings_206
calc_sample_calculator
...

Browser metrics Passed 4 tests

Checking browser requirements for Cost Calculator Builder
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,039 ▲25213.91 ▼0.304.79 ▲2.7735.42 ▼9.39
Dashboard /wp-admin2,318 ▲1416.10 ▲0.58110.55 ▲10.2385.75 ▲43.91
Posts /wp-admin/edit.php2,241 ▲1412.56 ▲0.5338.70 ▲1.9235.16 ▲0.09
Add New Post /wp-admin/post-new.php1,642 ▲11620.81 ▼2.41737.74 ▲117.0440.04 ▼11.73
Media Library /wp-admin/upload.php1,529 ▲1294.75 ▲0.58105.16 ▲8.5481.51 ▲40.13
Orders /wp-admin/admin.php?page=cost_calculator_orders1,4195.0389.07111.40
Upgrade /wp-admin/admin.php?page=cost_calculator_gopro1,7089.27282.2789.83
Templates /wp-admin/admin.php?page=cost_calculator_templates7,1015.3963.21113.18
Settings /wp-admin/admin.php?page=cost_calculator_builder&tab=settings1,5588.57224.2352.09
Calculators /wp-admin/admin.php?page=cost_calculator_builder1,3249.66455.9599.94

Uninstaller [IO: ▲0.00MB] [DB: ▲1.88MB] 50% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_cc_payments
    • wp_cc_orders
  • Zombie WordPress options detected upon uninstall: 120 options
    • stm_ccb_form_settings_12
    • stm_ccb_form_settings_206
    • stm_ccb_form_settings_50
    • stm_ccb_form_settings_58
    • widget_theysaidso_widget
    • stm_ccb_form_settings_166
    • stm_ccb_form_settings_46
    • stm_ccb_form_settings_118
    • stm_ccb_form_settings_22
    • stm_ccb_form_settings_20
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 6× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/cost-calculator-builder/templates/frontend/fields/cost-html.php
    • > /wp-content/plugins/cost-calculator-builder/templates/frontend/fields/cost-line.php
    • > /wp-content/plugins/cost-calculator-builder/templates/frontend/fields/cost-radio.php
    • > /wp-content/plugins/cost-calculator-builder/templates/frontend/fields/cost-toggle.php
    • > /wp-content/plugins/cost-calculator-builder/templates/admin/single-calc/modals/calc-settings.php
    • > /wp-content/plugins/cost-calculator-builder/templates/frontend/fields/cost-checkbox.php
  • 122× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/cost-calculator-builder/includes/mixpanel/mixpanel_init.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/cost-calculator-builder/templates/admin/components/preview/index.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/cost-calculator-builder/templates/admin/settings/webhooks.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/cost-calculator-builder/templates/admin/single-calc/fields/range-button-field.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/cost-calculator-builder/templates/admin/general-settings/email-template.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'cBuilder\\Classes\\CCBSettingsData' not found in wp-content/plugins/cost-calculator-builder/templates/admin/pages/settings.php:2
    • > PHP Warning
      Use of undefined constant CALC_PATH - assumed 'CALC_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/cost-calculator-builder/templates/admin/single-calc/calculators.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/cost-calculator-builder/templates/admin/general-settings/captcha.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/cost-calculator-builder/templates/admin/single-calc/fields/quantity-field.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cost-calculator-builder/includes/functions.php:417

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=cost_calculator_gopro
    • > Other (warning) in unknown
    /wp-admin/admin.php?page=cost_calculator_gopro 386 Unrecognized feature: 'web-share'.

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention: You can take inspiration from this readme.txt

cost-calculator-builder/cost-calculator-builder.php Passed 13 tests

The main PHP file in "Cost Calculator Builder" ver. 3.1.65 adds more information about the plugin and also serves as the entry point for this plugin
134 characters long description:
WP Cost Calculator helps you to build any type of estimation forms on a few easy steps. The plugin offers its own calculation builder.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin25,171 lines of code in 242 files:
LanguageFilesBlank linesComment linesLines of code
PHP1511,94883016,428
JavaScript271,1716036,301
SVG47011,285
CSS121071,024
Markdown217077
XML10042
JSON20014

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity17.02
▷ Minimum class complexity1.00
▷ Maximum class complexity176.00
Average method complexity3.02
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces14
Interfaces0
Traits0
Classes56
▷ Abstract classes11.79%
▷ Concrete classes5598.21%
▷ Final classes00.00%
Methods415
▷ Static methods30974.46%
▷ Public methods37690.60%
▷ Protected methods92.17%
▷ Private methods307.23%
Functions77
▷ Named functions4963.64%
▷ Anonymous functions2836.36%
Constants29
▷ Global constants2275.86%
▷ Class constants724.14%
▷ Public constants7100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
72 PNG files occupy 1.18MB with 0.53MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
frontend/dist/img/styles/toggle/horizontal_toggle.png3.22KB1.76KB▼ 45.43%
images/pdf.png14.32KB5.14KB▼ 64.15%
frontend/dist/img/styles/radio/style_3_horizontal.png7.13KB3.41KB▼ 52.11%
frontend/dist/img/welcome/appearance_bg.png11.12KB4.05KB▼ 63.60%
frontend/dist/img/welcome/appearanceee2.png43.58KB46.09KB0.00%