100% compare-products-for-woocommerce

Code Review | Compare Products for WooCommerce

WordPress plugin Compare Products for WooCommerce scored 100% from 54 tests.

About plugin

  • Plugin page: compare-products-...
  • Plugin version: 2.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.8
  • WordPress version: 5.8.1
  • First release: Feb 11, 2017
  • Latest release: Jul 29, 2021
  • Number of updates: 25
  • Update frequency: every 65.1 days
  • Top authors: algoritmika (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,325 total downloads

Benchmarks

Plugin footprint Passed 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 successfully, without throwing any errors or notices

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

An overview of server-side resources used by Compare Products for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1334.44 ▲13.60
Dashboard /wp-admin3.07 ▲0.0242.98 ▼11.34
Posts /wp-admin/edit.php3.13 ▲0.0240.79 ▼3.59
Add New Post /wp-admin/post-new.php5.44 ▲0.0191.34 ▼616.80
Media Library /wp-admin/upload.php3.02 ▲0.0131.16 ▼4.58

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 35 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Compare Products for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8315.92 ▲0.399.44 ▼2.1046.35 ▲0.61
Dashboard /wp-admin2,967 ▲345.98 ▼0.15136.98 ▼16.91106.70 ▼10.72
Posts /wp-admin/edit.php2,739 ▼02.72 ▼0.0067.40 ▲5.7098.99 ▲9.68
Add New Post /wp-admin/post-new.php1,615 ▼5721.91 ▲3.06261.11 ▼106.65101.85 ▼10.12
Media Library /wp-admin/upload.php1,807 ▼05.03 ▼0.01149.48 ▲7.74123.81 ▼5.84

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstall script ran successfully

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)
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The SRP test was a success

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: compare, woocommerce, compare products, woo commerce

compare-products-for-woocommerce/compare-products-for-woocommerce.php Passed 13 tests

The primary PHP file in "Compare Products for WooCommerce" version 2.1.0 is used by WordPress to initiate all plugin functionality
76 characters long description:
Let your users know which products interest them the most by comparing them.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin6,202 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript318423,899
PHP162166721,547
CSS42233412
PO File189123197
Sass4220147

PHP code Passed 2 tests

This is a very shot 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.39
Average class complexity8.18
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity2.27
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes19.09%
Methods62
▷ Static methods1625.81%
▷ Public methods6096.77%
▷ Protected methods00.00%
▷ Private methods23.23%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin