84% cf7-required-custom-field

Code Review | CF7 Required custom field

WordPress plugin CF7 Required custom field scored84%from 54 tests.

About plugin

  • Plugin page: cf7-required-cust...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.4-4.9
  • WordPress version: 6.3.1
  • First release: Jun 5, 2018
  • Latest release: Jun 7, 2018
  • Number of updates: 16
  • Update frequency: every 0.2 days
  • Top authors: alexdoc1985 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /1,366 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼4.94ms] Passed 4 tests

This is a short check of server-side resources used by CF7 Required custom field
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.24 ▲0.61
Dashboard /wp-admin3.31 ▼0.0445.23 ▼19.76
Posts /wp-admin/edit.php3.36 ▲0.0044.90 ▲1.15
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.96 ▲4.91
Media Library /wp-admin/upload.php3.23 ▲0.0032.45 ▼1.76

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

CF7 Required custom field: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.79 ▲0.151.71 ▼0.2142.24 ▼3.88
Dashboard /wp-admin2,209 ▲184.85 ▼0.0798.46 ▼8.9437.98 ▼5.10
Posts /wp-admin/edit.php2,089 ▼02.01 ▲0.0239.98 ▲6.1436.21 ▼1.37
Add New Post /wp-admin/post-new.php1,542 ▲918.28 ▼4.85587.29 ▼84.0555.34 ▼3.56
Media Library /wp-admin/upload.php1,385 ▼04.18 ▼0.0296.13 ▼2.5341.78 ▼3.34

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% 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 50% 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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/cf7-required-custom-field/index.php:28

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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:
  • Tags: There are too many tags (27 tag instead of maximum 10)
Please take inspiration from this readme.txt

cf7-required-custom-field/index.php 92% from 13 tests

The main file in "CF7 Required custom field" v. 1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cf7-required-custom-field.php" instead of "index.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
Success! There were no dangerous files found in this plugin243 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP4126111215
PO File16628

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity27.00
▷ Minimum class complexity10.00
▷ Maximum class complexity44.00
Average method complexity3.89
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods18
▷ Static methods316.67%
▷ Public methods1794.44%
▷ Protected methods15.56%
▷ Private methods00.00%
Functions1
▷ Named functions1100.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
PNG images were not found in this plugin