72% cost-calculator-contact-form-7

Code Review | Calculate Contact Form 7

WordPress plugin Calculate Contact Form 7 scored 72% from 54 tests.

About plugin

  • Plugin page: cost-calculator-c...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 5.9.2
  • First release: Nov 25, 2019
  • Latest release: Feb 26, 2022
  • Number of updates: 24
  • Update frequency: every 34.4 days
  • Top authors: avdevelopers426 (100%)

Code review

54 tests

User reviews

34 reviews

Install metrics

2,000+ active / 11,367 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼0.02MB] [CPU: ▼311.04ms] Passed 4 tests

This is a short check of server-side resources used by Calculate Contact Form 7
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0158.76 ▲4.56
Dashboard /wp-admin3.41 ▲0.0033.59 ▼3.82
Posts /wp-admin/edit.php3.64 ▲0.0042.00 ▲2.98
Add New Post /wp-admin/post-new.php6.88 ▼0.0997.54 ▼1,241.72
Media Library /wp-admin/upload.php3.29 ▲0.0025.86 ▼1.58
Paypal Entries /wp-admin/admin.php?page=cf7costcaloc_paypal_entries3.1018.73

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: 1 new table, no new options
New tables
wp_cf7costcaloc_forms

Browser metrics Passed 4 tests

An overview of browser requirements for Calculate Contact Form 7
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,803 ▲4915.78 ▼0.266.22 ▼0.133.00 ▲0.20
Dashboard /wp-admin2,879 ▲215.97 ▼0.20154.41 ▲14.77158.75 ▼5.94
Posts /wp-admin/edit.php2,685 ▼33.24 ▼0.0074.41 ▲10.81168.15 ▲22.03
Add New Post /wp-admin/post-new.php1,711 ▲5020.79 ▲4.62430.17 ▼1.53162.12 ▼13.99
Media Library /wp-admin/upload.php1,695 ▼05.48 ▲0.06185.12 ▲40.05191.52 ▼8.40
Paypal Entries /wp-admin/admin.php?page=cf7costcaloc_paypal_entries280.940.0317.03

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_cf7costcaloc_forms

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/cost-calculator-contact-form-7/cost-calculator-contactform7.php
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cost-calculator-contact-form-7/admin/cf7costcaloc-export-csv.php:127
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cost-calculator-contact-form-7/admin/rangeslider.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cost-calculator-contact-form-7/admin/calculator.php:9

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=cf7costcaloc_paypal_entries
    • > Network (severe)
    wp-admin/admin.php?page=cf7costcaloc_paypal_entries - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Screenshots: These screenshots lack descriptions #1, #10, #11, #12, #2, #3, #4, #5, #6, #7, #8, #9 in cost-calculator-contact-form-7/assets to your readme.txt
  • Contributors: Plugin contributors field is missing
The official readme.txt might help

cost-calculator-contact-form-7/cost-calculator-contactform7.php 85% from 13 tests

This is the main PHP file of "Calculate Contact Form 7" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")
  • Main file name: Name the main plugin file the same as the plugin slug ("cost-calculator-contact-form-7.php" instead of "cost-calculator-contactform7.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin2,998 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP6434371,506
CSS334491,190
JavaScript2487302

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity18.88
▷ Minimum class complexity1.00
▷ Maximum class complexity51.00
Average method complexity3.92
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods49
▷ Static methods36.12%
▷ Public methods4591.84%
▷ Protected methods12.04%
▷ Private methods36.12%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
includes/images/star.png39.75KB10.35KB▼ 73.95%