74% attribute-stock-for-woocommerce

Code Review | WooCommerce Attribute Stock - Shared Stock & Quantity Multipliers (Lite Version)

WordPress plugin WooCommerce Attribute Stock - Shared Stock & Quantity Multipliers (Lite Version) scored74%from 54 tests.

About plugin

  • Plugin page: attribute-stock-f...
  • Plugin version: 1.10.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3
  • WordPress version: 6.3.1
  • First release: Jan 7, 2020
  • Latest release: Oct 24, 2023
  • Number of updates: 193
  • Update frequency: every 7.2 days
  • Top authors: mewz (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

1,000+ active /28,471 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼7.45ms] Passed 4 tests

Server-side resources used by WooCommerce Attribute Stock - Shared Stock & Quantity Multipliers (Lite Version)
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0335.32 ▲0.29
Dashboard /wp-admin3.34 ▲0.0444.23 ▼7.83
Posts /wp-admin/edit.php3.46 ▲0.1046.38 ▼0.68
Add New Post /wp-admin/post-new.php5.92 ▲0.0482.88 ▼21.58
Media Library /wp-admin/upload.php3.27 ▲0.0433.24 ▲0.83

Server storage [IO: ▲1.09MB] [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: 143 new files
Database: 2 new tables, 7 new options
New tables
wp_wcas_match_rows
wp_wcas_match_sets
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments
mewz_wcas_version
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

WooCommerce Attribute Stock - Shared Stock & Quantity Multipliers (Lite Version): an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▼0.211.87 ▲0.3039.51 ▼0.99
Dashboard /wp-admin2,192 ▲115.56 ▼0.1785.03 ▼14.5541.27 ▼4.95
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0839.18 ▼0.9436.95 ▲0.85
Add New Post /wp-admin/post-new.php1,534 ▲318.19 ▼5.06615.58 ▼56.1861.36 ▲6.55
Media Library /wp-admin/upload.php1,403 ▲64.13 ▼0.0797.41 ▼4.8844.39 ▼1.26

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie tables detected upon uninstall: 2 tables
    • wp_wcas_match_rows
    • wp_wcas_match_sets
  • Zombie WordPress options detected upon uninstall: 7 options
    • mewz_wcas_version
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 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
Please fix the following items
  • 60× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Mewz\\Framework\\Base\\Action' not found in wp-content/plugins/attribute-stock-for-woocommerce/src/Actions/Admin/Stock/StockSave.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Mewz\\Framework\\Base\\Action' not found in wp-content/plugins/attribute-stock-for-woocommerce/src/Actions/Admin/Products/ProductOptions.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Mewz\\Framework\\Base\\Action' not found in wp-content/plugins/attribute-stock-for-woocommerce/src/Actions/Admin/Attributes/AttributeList.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Mewz\\Framework\\Base\\Action' not found in wp-content/plugins/attribute-stock-for-woocommerce/src/Actions/Admin/Settings/InventorySettings.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Mewz\\Framework\\Base\\Action' not found in wp-content/plugins/attribute-stock-for-woocommerce/src/Actions/Admin/Stock/StockList.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Mewz\\Framework\\Base\\Action' not found in wp-content/plugins/attribute-stock-for-woocommerce/src/Actions/Admin/Stock/StockActions.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Mewz\\Framework\\Base\\Action' not found in wp-content/plugins/attribute-stock-for-woocommerce/src/Compatibility/Actions/OpenPOS.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Mewz\\Framework\\Base\\Action' not found in wp-content/plugins/attribute-stock-for-woocommerce/src/Actions/Admin/Plugin/PluginHelp.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Mewz\\Framework\\Base\\Action' not found in wp-content/plugins/attribute-stock-for-woocommerce/src/Compatibility/Actions/AdvancedOrderExport.php:7
    • > PHP Warning
      require_once(WC_ABSPATHincludes/admin/reports/class-wc-report-stock.php): failed to open stream: No such file or directory in wp-content/plugins/attribute-stock-for-woocommerce/src/Components/AttributeStockReport.php on line 7

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

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: woocommerce stock, shared stock, attribute stock, woocommerce, variable stock

attribute-stock-for-woocommerce/attribute-stock-for-woocommerce.php 92% from 13 tests

Analyzing the main PHP file in "WooCommerce Attribute Stock - Shared Stock & Quantity Multipliers (Lite Version)" version 1.10.0
Please take the time to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
There were no executable files found in this plugin22,509 lines of code in 135 files:
LanguageFilesBlank linesComment linesLines of code
PHP1132,9722,46011,028
JavaScript85482,3579,524
CSS8421,344
PO File2195255532
JSON30076
XML1005

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity22.44
▷ Minimum class complexity1.00
▷ Maximum class complexity203.00
Average method complexity3.36
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces25
Interfaces1
Traits0
Classes86
▷ Abstract classes44.65%
▷ Concrete classes8295.35%
▷ Final classes00.00%
Methods788
▷ Static methods18323.22%
▷ Public methods71991.24%
▷ Protected methods668.38%
▷ Private methods30.38%
Functions19
▷ Named functions1473.68%
▷ Anonymous functions526.32%
Constants30
▷ Global constants13.33%
▷ Class constants2996.67%
▷ Public constants29100.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