99% manually-reduce-stock-for-woocommerce

Code Review | Manually Reduce Stock for WooCommerce

WordPress plugin Manually Reduce Stock for WooCommerce scored 99% from 54 tests.

About plugin

  • Plugin page: manually-reduce-s...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-5.5.1
  • WordPress version: 5.8.1
  • First release: Sep 22, 2020
  • Latest release: Sep 22, 2020
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: tamarazuk (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 275 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

This is a short check of server-side resources used by Manually Reduce Stock for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.0237.27 ▲2.08
Dashboard /wp-admin3.08 ▲0.0345.61 ▼0.82
Posts /wp-admin/edit.php3.13 ▲0.0346.33 ▲0.26
Add New Post /wp-admin/post-new.php5.44 ▲0.0188.92 ▼560.85
Media Library /wp-admin/upload.php3.02 ▲0.0233.75 ▲0.33

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Manually Reduce Stock for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,720 ▲12415.94 ▲0.4112.61 ▲2.7645.29 ▼1.27
Dashboard /wp-admin2,984 ▲535.85 ▼0.26143.61 ▼9.30107.31 ▼1.38
Posts /wp-admin/edit.php2,756 ▲172.72 ▲0.0062.33 ▼3.3586.08 ▼1.50
Add New Post /wp-admin/post-new.php1,515 ▼6618.59 ▲1.09400.46 ▼16.83101.31 ▼9.27
Media Library /wp-admin/upload.php1,824 ▲145.03 ▼0.01150.96 ▲6.90121.39 ▲11.46

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

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
Even though no errors were found, this is by no means an exhaustive test

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

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
2 plugin tags: reduce stock, woocommerce

manually-reduce-stock-for-woocommerce/manually-reduce-stock-for-woocommerce.php 85% from 13 tests

The primary PHP file in "Manually Reduce Stock for WooCommerce" version 1.0.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.4" instead of "4.0.0")
  • Description: Please don't use more than 140 characters for the plugin description (currently 160 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected147 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP182122110
JavaScript26437

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods538.46%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.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
There are no PNG files in this plugin