84% woo-products-tree

Code Review | Woo Products Tree

WordPress plugin Woo Products Tree scored84%from 54 tests.

About plugin

  • Plugin page: woo-products-tree
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7
  • WordPress version: 6.3.1
  • First release: Dec 20, 2016
  • Latest release: Dec 20, 2016
  • Number of updates: 33
  • Update frequency: every 4.6 days
  • Top authors: denispishniak (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /2,050 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼4.82ms] Passed 4 tests

Analyzing server-side resources used by Woo Products Tree
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0639.78 ▲0.63
Dashboard /wp-admin3.36 ▲0.0648.67 ▼2.52
Posts /wp-admin/edit.php3.41 ▲0.0651.79 ▼3.03
Add New Post /wp-admin/post-new.php5.94 ▲0.0685.69 ▼14.37
Media Library /wp-admin/upload.php3.29 ▲0.0638.50 ▲0.99

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_text_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Woo Products Tree
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,844 ▲8313.20 ▼1.192.28 ▲0.3944.98 ▲0.51
Dashboard /wp-admin2,221 ▲155.85 ▲0.97112.98 ▲8.2041.40 ▲0.13
Posts /wp-admin/edit.php2,103 ▼02.00 ▲0.0139.12 ▼1.8235.42 ▲1.48
Add New Post /wp-admin/post-new.php1,526 ▼1917.57 ▼5.62633.84 ▼32.1156.85 ▼11.07
Media Library /wp-admin/upload.php1,400 ▼04.22 ▲0.0199.49 ▼6.0644.59 ▼0.97

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_text_widget
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-products-tree/mi_woo_products_tree_init.php:30

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 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: woocommerce, navigation, widget, tree, ecommerce...

woo-products-tree/mi_woo_products_tree_init.php 85% from 13 tests

The primary PHP file in "Woo Products Tree" version 1.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woo-products-tree.php" instead of "mi_woo_products_tree_init.php")
  • Description: The description should be shorter than 140 characters (currently 183 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected321 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP15331213
CSS11177
JavaScript14031

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.20
Average class complexity26.00
▷ Minimum class complexity26.00
▷ Maximum class complexity26.00
Average method complexity6.00
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/showupdown7.png3.38KB0.46KB▼ 86.40%