90% wpc-custom-related-products

Code Review | WPC Custom Related Products for WooCommerce

WordPress plugin WPC Custom Related Products for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: wpc-custom-relate...
  • Plugin version: 3.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: May 11, 2019
  • Latest release: Oct 23, 2023
  • Number of updates: 43
  • Update frequency: every 37.8 days
  • Top authors: wpclever (100%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active /8,777 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.25MB] [CPU: ▼2.43ms] Passed 4 tests

A check of server-side resources used by WPC Custom Related Products for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2442.77 ▲7.61
Dashboard /wp-admin3.55 ▲0.2448.69 ▲1.04
Posts /wp-admin/edit.php3.66 ▲0.3046.87 ▼3.45
Add New Post /wp-admin/post-new.php6.15 ▲0.2685.53 ▼6.84
Media Library /wp-admin/upload.php3.47 ▲0.2434.22 ▼0.48
Essential Kit /wp-admin/admin.php?page=wpclever-kit3.4431.84
About /wp-admin/admin.php?page=wpclever3.4431.86

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

WPC Custom Related Products for WooCommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,866 ▲10514.29 ▼0.361.75 ▲0.1144.07 ▲5.96
Dashboard /wp-admin2,275 ▲955.54 ▼0.1284.65 ▲0.7561.28 ▲18.60
Posts /wp-admin/edit.php2,184 ▲842.06 ▲0.1134.34 ▼4.6431.51 ▼9.47
Add New Post /wp-admin/post-new.php1,754 ▲22822.17 ▼1.29759.39 ▲128.3670.20 ▲10.58
Media Library /wp-admin/upload.php1,477 ▲774.24 ▲0.0795.51 ▼4.1873.93 ▲27.43
Essential Kit /wp-admin/admin.php?page=wpclever-kit5,7412.1536.8463.62
About /wp-admin/admin.php?page=wpclever1,3962.1432.0434.14

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests Passed 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 Passed 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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention: You can take inspiration from this readme.txt

wpc-custom-related-products/wpc-custom-related-products.php Passed 13 tests

The principal PHP file in "WPC Custom Related Products for WooCommerce" v. 3.0.7 is loaded by WordPress automatically on each request
90 characters long description:
WPC Custom Related Products allows you to choose custom related products for each product.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin3,118 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
CSS42981471,448
PHP5168291,280
JavaScript36311361
SVG10029

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity49.50
▷ Minimum class complexity1.00
▷ Maximum class complexity150.00
Average method complexity5.31
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods45
▷ Static methods511.11%
▷ Public methods45100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants10
▷ Global constants10100.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
No PNG images were found in this plugin