83% cf7-cost-calculator

Code Review | Contact Form 7 Cost Calculator (Add-on for CF7)

WordPress plugin Contact Form 7 Cost Calculator (Add-on for CF7) scored83%from 54 tests.

About plugin

  • Plugin page: cf7-cost-calculator
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.1.1
  • WordPress version: 6.3.1
  • First release: Apr 24, 2018
  • Latest release: Mar 24, 2019
  • Number of updates: 8
  • Update frequency: every 41.8 days
  • Top authors: azmarket (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /3,224 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

Analyzing server-side resources used by Contact Form 7 Cost Calculator (Add-on for CF7)
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0132.54 ▼6.04
Dashboard /wp-admin3.31 ▼0.0343.67 ▼15.75
Posts /wp-admin/edit.php3.36 ▲0.0148.24 ▲3.45
Add New Post /wp-admin/post-new.php5.89 ▲0.0183.52 ▼1.63
Media Library /wp-admin/upload.php3.24 ▲0.0134.97 ▲0.06

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Contact Form 7 Cost Calculator (Add-on for CF7)
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲5214.76 ▲0.471.75 ▼0.5740.60 ▼7.00
Dashboard /wp-admin2,215 ▲244.84 ▼0.03107.82 ▼17.3041.08 ▼3.16
Posts /wp-admin/edit.php2,098 ▲92.01 ▲0.0041.09 ▲4.9138.04 ▲5.12
Add New Post /wp-admin/post-new.php1,523 ▲917.80 ▲0.26689.31 ▼5.5958.99 ▲4.37
Media Library /wp-admin/upload.php1,394 ▲34.21 ▼0.0297.37 ▼8.2042.92 ▼2.53

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cf7-cost-calculator/inc/frontend.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/cf7-cost-calculator/inc/tpl/admin-form.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/cf7-cost-calculator/inc/tpl/admin-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cf7-cost-calculator/inc/tpl/admin-form-tags.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cf7-cost-calculator/inc/tpl/admin-popup.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention: The official readme.txt might help

cf7-cost-calculator/cost-calculator.php 85% from 13 tests

The principal PHP file in "Contact Form 7 Cost Calculator (Add-on for CF7)" v. 1.0.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 182 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("cf7-cost-calculator.php" instead of "cost-calculator.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin2,225 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP716424821
JavaScript6418164712
CSS47542680
SVG10012

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity13.00
▷ Minimum class complexity4.00
▷ Maximum class complexity31.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods16
▷ Static methods212.50%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/admin/contact-form-7-multi-step-pro.png17.37KB5.84KB▼ 66.35%