90% woocommerce-auto-restore-stock

Code Review | WooCommerce Auto Restore Stock

WordPress plugin WooCommerce Auto Restore Stock scored90%from 54 tests.

About plugin

  • Plugin page: woocommerce-auto-...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-3.7.1
  • WordPress version: 6.3.1
  • First release: Nov 26, 2013
  • Latest release: Nov 29, 2013
  • Number of updates: 5
  • Update frequency: every 0.8 days
  • Top authors: Kloon (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

1,000+ active /14,786 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
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼9.94ms] Passed 4 tests

A check of server-side resources used by WooCommerce Auto Restore Stock
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0341.20 ▲0.99
Dashboard /wp-admin3.33 ▼0.0243.95 ▼19.45
Posts /wp-admin/edit.php3.38 ▲0.0245.70 ▼0.02
Add New Post /wp-admin/post-new.php5.91 ▲0.0279.53 ▼21.29
Media Library /wp-admin/upload.php3.25 ▲0.0234.56 ▲2.88

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

WooCommerce Auto Restore Stock: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.44 ▼0.201.82 ▼0.1444.31 ▼3.53
Dashboard /wp-admin2,206 ▲155.79 ▲0.70102.61 ▼13.9038.71 ▼7.75
Posts /wp-admin/edit.php2,086 ▼02.02 ▼0.0339.46 ▲1.6134.96 ▲0.28
Add New Post /wp-admin/post-new.php1,519 ▼1523.24 ▲0.10655.19 ▼31.4655.55 ▼1.39
Media Library /wp-admin/upload.php1,388 ▲64.23 ▲0.0094.01 ▼7.0242.35 ▲0.35

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests Passed 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 Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
6 plugin tags: cancelled, inventory, refunded, woocommerce, stock...

woocommerce-auto-restore-stock/woocommerce-auto-stock-restore.php 92% from 13 tests

The main PHP script in "WooCommerce Auto Restore Stock" version 1.0.1 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woocommerce-auto-restore-stock.php" instead of "woocommerce-auto-stock-restore.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected34 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1192134

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity4.50
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin