83% woocommerce-custom-product-data-fields

Code Review | WooCommerce Custom Product Data Fields

WordPress plugin WooCommerce Custom Product Data Fields scored83%from 54 tests.

About plugin

  • Plugin page: woocommerce-custo...
  • Plugin version: 1.2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.6.1
  • WordPress version: 6.3.1
  • First release: Jul 26, 2014
  • Latest release: Oct 4, 2016
  • Number of updates: 31
  • Update frequency: every 25.9 days
  • Top authors: kharisblank (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

900+ active /27,907 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

Analyzing server-side resources used by WooCommerce Custom Product Data Fields
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0038.57 ▼1.83
Dashboard /wp-admin3.31 ▲0.0144.22 ▼5.55
Posts /wp-admin/edit.php3.36 ▲0.0048.97 ▲3.45
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.57 ▲2.78
Media Library /wp-admin/upload.php3.24 ▲0.0033.45 ▲2.23

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

WooCommerce Custom Product Data Fields: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.61 ▼0.791.65 ▼0.3242.32 ▼2.55
Dashboard /wp-admin2,206 ▲155.91 ▲0.01105.68 ▲5.4041.77 ▲4.38
Posts /wp-admin/edit.php2,086 ▼02.01 ▲0.0239.41 ▲5.4734.42 ▼0.68
Add New Post /wp-admin/post-new.php1,517 ▼1617.86 ▼5.49593.27 ▼143.2856.70 ▼3.16
Media Library /wp-admin/upload.php1,388 ▼04.20 ▼0.0095.28 ▼19.1143.78 ▼4.95

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Please fix the following
  • 1× 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/woocommerce-custom-product-data-fields/fields-init.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% 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: custom fields, product data, product meta, framework, meta

woocommerce-custom-product-data-fields/wc-custom-product-data-fields.php 77% from 13 tests

"WooCommerce Custom Product Data Fields" version 1.2.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("woocommerce-custom-product-data-fields.php" instead of "wc-custom-product-data-fields.php")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Description: Please keep the plugin description shorter than 140 characters (currently 159 characters long)

Code Analysis 97% from 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 plugin755 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP3273100543
JavaScript26212111
CSS2180101

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
These items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 125)
Cyclomatic complexity
Average complexity per logical line of code0.69
Average class complexity140.00
▷ Minimum class complexity140.00
▷ Maximum class complexity140.00
Average method complexity16.44
▷ Minimum method complexity1.00
▷ Maximum method complexity125.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.16MB with 0.11MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png167.25KB58.64KB▼ 64.94%