78% simple-woocommerce-admin-stock-management

Code Review | Simple Woocommerce Admin Stock Management

WordPress plugin Simple Woocommerce Admin Stock Management scored78%from 54 tests.

About plugin

  • Plugin page: simple-woocommerc...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Dec 1, 2017
  • Latest release: Dec 1, 2017
  • Number of updates: 3
  • Update frequency: every 2.3 days
  • Top authors: jonboss (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /631 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.07MB] [CPU: ▼16.14ms] Passed 4 tests

A check of server-side resources used by Simple Woocommerce Admin Stock Management
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.0144.72 ▼1.55
Dashboard /wp-admin3.39 ▼0.2431.85 ▼33.68
Posts /wp-admin/edit.php3.69 ▲0.0154.75 ▲1.83
Add New Post /wp-admin/post-new.php6.16 ▲0.0189.30 ▼20.87
Media Library /wp-admin/upload.php3.42 ▼0.0730.24 ▼8.46

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Simple Woocommerce Admin Stock Management
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.47 ▲0.171.77 ▲0.0644.97 ▲0.20
Dashboard /wp-admin2,195 ▲215.51 ▼0.1082.45 ▼9.9639.85 ▼4.57
Posts /wp-admin/edit.php2,100 ▼02.15 ▲0.1341.03 ▼0.2136.67 ▲1.95
Add New Post /wp-admin/post-new.php1,545 ▲523.29 ▲0.07658.71 ▼50.4760.11 ▲9.39
Media Library /wp-admin/upload.php1,391 ▼94.19 ▼0.0199.34 ▼8.8242.48 ▼7.66

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/simple-woocommerce-admin-stock-management/views/restock_modal.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-woocommerce-admin-stock-management/includes/ajax.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/simple-woocommerce-admin-stock-management/simple-woocommerce-admin-stock-management.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Requires at least: Version format is invalid
The official readme.txt is a good inspiration

simple-woocommerce-admin-stock-management/simple-woocommerce-admin-stock-management.php Passed 13 tests

Analyzing the main PHP file in "Simple Woocommerce Admin Stock Management" version 1.0
113 characters long description:
A simple woocommerce extension will automatically manage stock levels when orders are edited by the administrator

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected138 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP321972
CSS11135
JavaScript16531

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.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
No PNG images were found in this plugin