10% products-table-compare

Code Review | Products Table Compare

WordPress plugin Products Table Compare scored10%from 54 tests.

About plugin

  • Plugin page: products-table-co...
  • Plugin version: 0.5
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.6
  • WordPress version: 6.3.1
  • First release: Mar 9, 2021
  • Latest release: Mar 9, 2021
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: hippocampustech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /363 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/products-table-compare/ProductsTableCompare_Plugin.php+30
    count(): Parameter must be an array or an object that implements Countable

Server metrics [RAM: ▲0.11MB] [CPU: ▼1.66ms] Passed 4 tests

A check of server-side resources used by Products Table Compare
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1241.45 ▼0.15
Dashboard /wp-admin3.41 ▲0.1143.96 ▼4.94
Posts /wp-admin/edit.php3.52 ▲0.1747.03 ▼0.49
Add New Post /wp-admin/post-new.php5.99 ▲0.11100.49 ▲13.42
Media Library /wp-admin/upload.php3.33 ▲0.1133.54 ▼1.04

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 14 new files
Database: no new tables, 11 new options
New WordPress options
ProductsTableCompare_Plugin_CanDoSomething
can_compress_scripts
ProductsTableCompare_Plugin_AmAwesome
widget_recent-posts
ProductsTableCompare_Plugin_ATextInput
ProductsTableCompare_Plugin__installed
ProductsTableCompare_Plugin__version
widget_recent-comments
widget_theysaidso_widget
db_upgraded
...

Browser metrics Passed 4 tests

A check of browser resources used by Products Table Compare
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.22 ▼1.151.63 ▼0.1640.94 ▼6.47
Dashboard /wp-admin2,206 ▲185.90 ▲0.88105.37 ▼13.2841.26 ▼3.66
Posts /wp-admin/edit.php2,092 ▼02.01 ▲0.0440.02 ▲3.5536.06 ▲2.20
Add New Post /wp-admin/post-new.php1,542 ▲1418.38 ▲0.24613.08 ▼28.4976.07 ▲30.74
Media Library /wp-admin/upload.php1,388 ▼04.19 ▼0.0595.64 ▲0.7241.71 ▼0.02

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 11 options in the database
    • db_upgraded
    • ProductsTableCompare_Plugin__version
    • ProductsTableCompare_Plugin_CanDoSomething
    • widget_recent-comments
    • ProductsTableCompare_Plugin_AmAwesome
    • can_compress_scripts
    • widget_theysaidso_widget
    • ProductsTableCompare_Plugin_ATextInput
    • theysaidso_admin_options
    • ProductsTableCompare_Plugin__installed
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/products-table-compare/products-table-compare.php:56

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: filter, compare, products, table, product-info...

products-table-compare/products-table-compare.php Passed 13 tests

Analyzing the main PHP file in "Products Table Compare" version 0.5
27 characters long description:
compare products with table

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin831 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP9168266623
JavaScript1390176
CSS15032

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.34
Average class complexity11.00
▷ Minimum class complexity1.00
▷ Maximum class complexity42.00
Average method complexity1.99
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes228.57%
▷ Concrete classes571.43%
▷ Final classes00.00%
Methods73
▷ Static methods00.00%
▷ Public methods4561.64%
▷ Protected methods2838.36%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin