84% edd-custom-checkout-fields

Code Review | EDD custom checkout fields

WordPress plugin EDD custom checkout fields scored84%from 54 tests.

About plugin

  • Plugin page: edd-custom-checko...
  • Plugin version: 1.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.0.1
  • WordPress version: 6.3.1
  • First release: Mar 23, 2017
  • Latest release: Jul 31, 2022
  • Number of updates: 8
  • Update frequency: every 244.1 days
  • Top authors: Goback2 (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

200+ active /4,690 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

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

An overview of server-side resources used by EDD custom checkout fields
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0042.18 ▲0.67
Dashboard /wp-admin3.31 ▲0.0049.25 ▼3.17
Posts /wp-admin/edit.php3.36 ▲0.0048.85 ▼0.14
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.08 ▼5.01
Media Library /wp-admin/upload.php3.23 ▲0.0038.30 ▲2.13

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

EDD custom checkout fields: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲313.92 ▼0.671.79 ▼0.2946.84 ▲3.71
Dashboard /wp-admin2,198 ▲215.66 ▲0.0794.22 ▲4.0144.17 ▲2.39
Posts /wp-admin/edit.php2,100 ▼02.05 ▲0.0634.24 ▼3.0636.64 ▼1.79
Add New Post /wp-admin/post-new.php1,526 ▼1917.58 ▼5.77679.88 ▼5.5870.48 ▲10.23
Media Library /wp-admin/upload.php1,403 ▲34.20 ▲0.01103.21 ▼1.8644.24 ▼2.56

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

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
Everything seems fine, however 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
Please take a closer look at the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/edd-custom-checkout-fields/index.php
    • > /wp-content/plugins/edd-custom-checkout-fields/class-fields-generator.php

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 Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: checkout, edd, easy digital downloads, edd custom field, custom checkout

edd-custom-checkout-fields/index.php 85% from 13 tests

The entry point to "EDD custom checkout fields" version 1.4.1 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("edd-custom-checkout-fields.php" instead of "index.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin895 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP216270807
PO File1363888

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity55.00
▷ Minimum class complexity39.00
▷ Maximum class complexity71.00
Average method complexity6.53
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods20
▷ Static methods210.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 compressed PNG files occupy 0.01MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/click-here-rtl.png3.13KB2.70KB▼ 13.87%
assets/click-here.png3.11KB2.70KB▼ 13.01%