89% woocommerce-custom-widget-product

Code Review | Woocommerce Custom Widget Product

WordPress plugin Woocommerce Custom Widget Product scored89%from 54 tests.

About plugin

  • Plugin page: woocommerce-custo...
  • Plugin version: 1.01
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 6.3.1
  • First release: Jul 11, 2014
  • Latest release: Sep 5, 2014
  • Number of updates: 5
  • Update frequency: every 11.2 days
  • Top authors: yaibait (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /2,332 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
The plugin installed gracefully, with no errors

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

Server-side resources used by Woocommerce Custom Widget Product
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0234.34 ▼7.87
Dashboard /wp-admin3.33 ▼0.0244.17 ▼18.54
Posts /wp-admin/edit.php3.38 ▲0.0245.27 ▼2.91
Add New Post /wp-admin/post-new.php5.91 ▲0.0281.28 ▼14.12
Media Library /wp-admin/upload.php3.25 ▲0.0234.39 ▼3.87

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Woocommerce Custom Widget Product
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.78 ▲0.031.60 ▼0.2941.71 ▼1.85
Dashboard /wp-admin2,203 ▲125.79 ▲0.88100.33 ▼1.7038.89 ▼1.25
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0436.92 ▲0.1133.91 ▲1.30
Add New Post /wp-admin/post-new.php1,534 ▲123.54 ▲2.31666.55 ▼39.2258.09 ▼1.27
Media Library /wp-admin/upload.php1,385 ▼64.23 ▲0.02107.28 ▲2.0544.93 ▼0.44

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_woocommerce_ndbproducts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests Passed 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)
Even though no errors were found, this is by no means 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 just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Contributors: Plugin contributors not specified
  • Plugin Name: You should set the name of your plugin on the first line ( === woocommerce-custom-widget-product === )
  • Contributors: No tags were detected
The official readme.txt might help

woocommerce-custom-widget-product/ndb-widget.php 92% from 13 tests

"Woocommerce Custom Widget Product" version 1.01's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("woocommerce-custom-widget-product.php" instead of "ndb-widget.php")

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
No dangerous file extensions were detected74 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP123874

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin