88% cf7-cost-calculator-price-calculation

Code Review | Contact Form 7 Cost Calculator - Price Calculation Free

WordPress plugin Contact Form 7 Cost Calculator - Price Calculation Free scored 88% from 54 tests.

About plugin

  • Plugin page: cf7-cost-calculat...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5+
  • WordPress version: 5.8.1
  • First release: Jun 15, 2017
  • Latest release: Sep 11, 2017
  • Number of updates: 8
  • Update frequency: every 11.9 days
  • Top authors: rednumber (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

4,000+ active / 17,873 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼140.64ms] Passed 4 tests

This is a short check of server-side resources used by Contact Form 7 Cost Calculator - Price Calculation Free
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1243.58 ▲18.35
Dashboard /wp-admin3.06 ▲0.0160.38 ▲2.04
Posts /wp-admin/edit.php3.12 ▲0.0156.01 ▲5.73
Add New Post /wp-admin/post-new.php5.42 ▼0.01103.57 ▼573.59
Media Library /wp-admin/upload.php3.01 ▲0.0039.38 ▲3.27

Server storage [IO: ▲0.07MB] [DB: ▲0.00MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 11 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Contact Form 7 Cost Calculator - Price Calculation Free
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,717 ▲12115.72 ▲0.099.23 ▼0.8554.96 ▲5.19
Dashboard /wp-admin2,971 ▲405.89 ▼0.08166.22 ▼12.16132.20 ▲14.91
Posts /wp-admin/edit.php2,743 ▲72.72 ▲0.0169.85 ▲5.7097.83 ▲0.30
Add New Post /wp-admin/post-new.php1,686 ▲10518.82 ▼1.51434.79 ▼12.27120.33 ▼12.12
Media Library /wp-admin/upload.php1,811 ▲75.02 ▼0.02167.98 ▼45.10118.25 ▼10.25

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/cf7-cost-calculator-price-calculation/index.php
  • 14× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cf7-cost-calculator-price-calculation/backend/index.php:7
    • > PHP Warning
      include(): Failed opening 'CT_7_COST_PLUGIN_PATHbackend/checkbox.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/cf7-cost-calculator-price-calculation/backend/index.php on line 3
    • > PHP Warning
      Use of undefined constant CT_7_COST_PLUGIN_PATH - assumed 'CT_7_COST_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/cf7-cost-calculator-price-calculation/backend/index.php on line 3
    • > PHP Warning
      include(): Failed opening 'CT_7_COST_PLUGIN_PATHbackend/settings.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/cf7-cost-calculator-price-calculation/backend/index.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cf7-cost-calculator-price-calculation/frontend/index.php:5
    • > PHP Warning
      include(CT_7_COST_PLUGIN_PATHbackend/select.php): failed to open stream: No such file or directory in wp-content/plugins/cf7-cost-calculator-price-calculation/backend/index.php on line 4
    • > PHP Warning
      Use of undefined constant CT_7_COST_PLUGIN_PATH - assumed 'CT_7_COST_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/cf7-cost-calculator-price-calculation/backend/index.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cf7-cost-calculator-price-calculation/backend/checkbox.php:7
    • > PHP Warning
      include(): Failed opening 'CT_7_COST_PLUGIN_PATHbackend/select.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/cf7-cost-calculator-price-calculation/backend/index.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/cf7-cost-calculator-price-calculation/backend/settings.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed: You can take inspiration from this readme.txt

cf7-cost-calculator-price-calculation/index.php 92% from 13 tests

The main PHP script in "Contact Form 7 Cost Calculator - Price Calculation Free" version 1.2 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cf7-cost-calculator-price-calculation.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin950 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP618838804
JavaScript2152146

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity8.25
▷ Minimum class complexity2.00
▷ Maximum class complexity18.00
Average method complexity2.71
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods17
▷ Static methods15.88%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin