100% woocommerce-availability-chart

Code Review | WooCommerce Availability Chart

WordPress plugin WooCommerce Availability Chart scored 100% from 54 tests.

About plugin

  • Plugin page: woocommerce-avail...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.8.2
  • WordPress version: 5.8.1
  • First release: Feb 26, 2015
  • Latest release: Oct 6, 2017
  • Number of updates: 10
  • Update frequency: every 115.1 days
  • Top authors: growdev (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active / 3,749 total downloads


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
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼135.19ms] Passed 4 tests

An overview of server-side resources used by WooCommerce Availability Chart
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1337.74 ▲15.12
Dashboard /wp-admin3.08 ▲0.0248.69 ▲6.18
Posts /wp-admin/edit.php3.13 ▲0.0249.95 ▲0.25
Add New Post /wp-admin/post-new.php5.43 ▲0.0095.25 ▼560.00
Media Library /wp-admin/upload.php3.02 ▲0.0249.24 ▲12.82

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 13 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Availability Chart
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10716.22 ▲0.629.31 ▼0.7650.66 ▼2.50
Dashboard /wp-admin2,967 ▲365.88 ▼0.07145.80 ▼16.01121.29 ▼2.88
Posts /wp-admin/edit.php2,739 ▼02.69 ▲0.0273.63 ▼3.1192.68 ▲2.33
Add New Post /wp-admin/post-new.php1,683 ▲9216.31 ▼2.50412.53 ▲24.14116.99 ▲7.74
Media Library /wp-admin/upload.php1,807 ▼65.01 ▲0.02173.75 ▲16.00135.29 ▲3.88

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller ran successfully

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
No output text or server-side errors detected on direct access of PHP files

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)
There were no browser issues found


Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
7 plugin tags: woocommerce availability chart, woocommerce stock, woocommerce, woocommerce chart, stock...

woocommerce-availability-chart/woocommerce-availability-chart.php Passed 13 tests

The principal PHP file in "WooCommerce Availability Chart" v. 1.0.2 is loaded by WordPress automatically on each request
121 characters long description:
WooCommerce Availability Chart displays a nice looking chart on variation product pages with the availability of products

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 detected243 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity8.00
▷ Minimum class complexity3.00
▷ Maximum class complexity18.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
▷ Static methods16.25%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions1100.00%
▷ Anonymous functions00.00%
▷ 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
4 PNG files occupy 0.18MB with 0.13MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png74.50KB23.55KB▼ 68.39%
screenshot-1.png14.10KB2.83KB▼ 79.90%
screenshot-2.png29.47KB8.09KB▼ 72.56%
screenshot-3.png69.26KB19.53KB▼ 71.80%