89% woocommerce-colors

Code Review | WooCommerce Colors

WordPress plugin WooCommerce Colors scored89%from 54 tests.

About plugin

  • Plugin page: woocommerce-colors
  • Plugin version: 1.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.5
  • WordPress version: 6.3.1
  • First release: Jan 13, 2015
  • Latest release: Aug 27, 2020
  • Number of updates: 16
  • Update frequency: every 129.8 days
  • Top authors: claudiosanches (93.75%)wpmuguru (12.5%)

Code review

54 tests

User reviews

31 reviews

Install metrics

20,000+ active /253,211 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
Install script ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼7.39ms] Passed 4 tests

This is a short check of server-side resources used by WooCommerce Colors
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.81 ▼1.11
Dashboard /wp-admin3.31 ▼0.0344.96 ▼14.14
Posts /wp-admin/edit.php3.36 ▲0.0144.74 ▲0.27
Add New Post /wp-admin/post-new.php5.89 ▲0.0188.15 ▼8.19
Media Library /wp-admin/upload.php3.24 ▲0.0130.24 ▼6.11

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Colors
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲4914.14 ▼0.151.67 ▲0.1037.75 ▼1.76
Dashboard /wp-admin2,204 ▲275.65 ▲0.0293.54 ▲2.6739.14 ▼1.32
Posts /wp-admin/edit.php2,106 ▲62.11 ▲0.0940.13 ▲5.7338.56 ▼0.70
Add New Post /wp-admin/post-new.php1,543 ▲818.22 ▲0.12633.20 ▼3.2175.42 ▲10.16
Media Library /wp-admin/upload.php1,400 ▼04.18 ▲0.0094.83 ▼3.9441.79 ▼0.85

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
Congratulations! This plugin passed the SRP test

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

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
2 plugin tags: shortcodes, woocommerce

woocommerce-colors/woocommerce-colors.php 77% from 13 tests

The main PHP script in "WooCommerce Colors" version 1.0.7 is automatically included on every request by WordPress
You should first fix the following items:
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages/")
  • Domain Path: Prefix the domain path with a forward slash character ("/languages/")
  • Requires at least: The required version number must match the one declared in readme.txt ("4.0" instead of "3.0")

Code Analysis 97% from 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
There were no executable files found in this plugin5,019 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP48586374,002
JavaScript4174171964
PO File1182053

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 105)
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity101.22
▷ Minimum class complexity4.00
▷ Maximum class complexity474.00
Average method complexity4.73
▷ Minimum method complexity1.00
▷ Maximum method complexity105.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods242
▷ Static methods72.89%
▷ Public methods5020.66%
▷ Protected methods19078.51%
▷ Private methods20.83%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin