73% coinbase-commerce-for-contact-form-7

Code Review | Coinbase Commerce for Contact Form 7

WordPress plugin Coinbase Commerce for Contact Form 7 scored73%from 54 tests.

About plugin

  • Plugin page: coinbase-commerce...
  • Plugin version: 1.1.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2.2
  • WordPress version: 6.3.1
  • First release: Mar 24, 2022
  • Latest release: Jul 20, 2023
  • Number of updates: 16
  • Update frequency: every 30.2 days
  • Top authors: smusman98 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /2,714 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲5.34MB] [CPU: ▲25.20ms] 50% from 4 tests

This is a short check of server-side resources used by Coinbase Commerce for Contact Form 7
Please fix the following
  • CPU: Total CPU usage should be kept under 500.00ms (currently 1,940.49ms on /wp-admin/admin.php?page=coinbase-commerce-for-contact-form-7)
  • Extra RAM: Extra memory usage should kept under 5MB (currently 5.34MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.21 ▲5.7571.42 ▲17.64
Dashboard /wp-admin9.23 ▲5.9281.20 ▲30.11
Posts /wp-admin/edit.php9.23 ▲5.8777.09 ▲23.69
Add New Post /wp-admin/post-new.php9.71 ▲3.82124.01 ▲29.36
Media Library /wp-admin/upload.php9.23 ▲6.0068.08 ▲31.91
Coinbase Commerce for Contact Form 7 /wp-admin/admin.php?page=coinbase-commerce-for-contact-form-79.231,940.49
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.2357.95

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 188 new files
Database: no new tables, 9 new options
New WordPress options
db_upgraded
fs_active_plugins
widget_recent-posts
fs_debug_mode
widget_recent-comments
widget_theysaidso_widget
fs_accounts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Coinbase Commerce for Contact Form 7
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲8613.66 ▼0.925.11 ▲3.0131.14 ▼12.96
Dashboard /wp-admin2,238 ▲505.83 ▼0.04102.88 ▼15.4345.78 ▲3.68
Posts /wp-admin/edit.php2,121 ▲322.03 ▲0.0241.26 ▲3.1736.49 ▲2.68
Add New Post /wp-admin/post-new.php1,539 ▲618.20 ▼5.02616.79 ▼97.0162.52 ▲10.64
Media Library /wp-admin/upload.php1,420 ▲354.24 ▼0.0397.04 ▼15.5048.07 ▲1.87
Coinbase Commerce for Contact Form 7 /wp-admin/admin.php?page=coinbase-commerce-for-contact-form-79701.7126.7558.83
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0652.0824.5830.02

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/coinbase-commerce-for-contact-form-7/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 9 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • fs_debug_mode
    • fs_accounts
    • fs_active_plugins
    • db_upgraded
    • widget_theysaidso_widget

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 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/coinbase-commerce-for-contact-form-7/includes/class-webhook.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/coinbase-commerce-for-contact-form-7/includes/class-user.php:49
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/coinbase-commerce-for-contact-form-7/includes/class-admin-settings.php:49

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed: Please take inspiration from this readme.txt

coinbase-commerce-for-contact-form-7/coinbase-commerce-contact-form-7.php 92% from 13 tests

The main PHP file in "Coinbase Commerce for Contact Form 7" ver. 1.1.2 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("coinbase-commerce-for-contact-form-7.php" instead of "coinbase-commerce-contact-form-7.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected34,409 lines of code in 145 files:
LanguageFilesBlank linesComment linesLines of code
PHP1258,14917,49833,910
Markdown2800243
JavaScript43959216
JSON10027
CSS130013

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity86.52
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.54
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes52
▷ Abstract classes23.85%
▷ Concrete classes5096.15%
▷ Final classes00.00%
Methods1,286
▷ Static methods20115.63%
▷ Public methods89769.75%
▷ Protected methods171.32%
▷ Private methods37228.93%
Functions105
▷ Named functions10499.05%
▷ Anonymous functions10.95%
Constants148
▷ Global constants10168.24%
▷ Class constants4731.76%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/coinbase-commerce-for-contact-form-7.png11.26KB3.85KB▼ 65.82%