74% attribute-stock-for-woocommerce

Code Review | WooCommerce Attribute Stock - Share Stock Between Products (Lite Version)

WordPress plugin WooCommerce Attribute Stock - Share Stock Between Products (Lite Version) scored 74% from 53 tests.

About plugin

  • Plugin page: attribute-stock-f...
  • Plugin version: 1.6.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.8
  • WordPress version: 5.8.1
  • First release: Jan 7, 2020
  • Latest release: Sep 17, 2021
  • Number of updates: 130
  • Update frequency: every 4.9 days
  • Top authors: mewz (100%)

Code review

53 tests

User reviews

7 reviews

Install metrics

1,000+ active / 10,435 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼261.07ms] Passed 4 tests

Server-side resources used by WooCommerce Attribute Stock - Share Stock Between Products (Lite Version)
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1328.53 ▼3.76
Dashboard /wp-admin3.15 ▲0.1044.13 ▲2.03
Posts /wp-admin/edit.php3.20 ▲0.0943.98 ▼4.02
Add New Post /wp-admin/post-new.php5.45 ▲0.0285.51 ▼1,032.21
Media Library /wp-admin/upload.php3.03 ▲0.0230.78 ▼4.28

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 126 new files
Database: 2 new tables, 1 new option
New tables
wp_wcas_match_sets
wp_wcas_match_rows
New WordPress options
mewz_wcas_version

Browser metrics Passed 4 tests

WooCommerce Attribute Stock - Share Stock Between Products (Lite Version): an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,678 ▲9615.87 ▲0.417.93 ▲0.4644.78 ▼1.70
Dashboard /wp-admin2,956 ▲1005.94 ▼0.05139.49 ▼9.2596.40 ▼13.72
Posts /wp-admin/edit.php2,706 ▲32.69 ▼0.0067.84 ▲0.8792.09 ▲0.57
Add New Post /wp-admin/post-new.php1,653 ▼018.70 ▼0.16359.59 ▼16.13106.63 ▲3.18
Media Library /wp-admin/upload.php1,775 ▼05.03 ▼0.01149.48 ▼14.59109.10 ▼3.71

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 were found after uninstall: 2 tables
    • wp_wcas_match_rows
    • wp_wcas_match_sets
  • This plugin does not fully uninstall, leaving 1 option in the database
    • mewz_wcas_version

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 50× PHP files trigger errors when accessed directly with GET requests (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/Attributes/AttributeList.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Mewz\\Framework\\Base\\Action' not found in wp-content/plugins/attribute-stock-for-woocommerce/src/Actions/Admin/Stock/StockBulkActions.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Mewz\\Framework\\Plugin\\Installer' not found in wp-content/plugins/attribute-stock-for-woocommerce/src/Plugin/Installer.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Mewz\\Framework\\Base\\Action' not found in wp-content/plugins/attribute-stock-for-woocommerce/src/Actions/Admin/Stock/StockListQuery.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Mewz\\WCAS\\Util\\Matches' not found in wp-content/plugins/attribute-stock-for-woocommerce/src/Util/MatchSets.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Mewz\\Framework\\Base\\Action' not found in wp-content/plugins/attribute-stock-for-woocommerce/src/Actions/Compatibility/WPLister.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Mewz\\Framework\\Base\\Action' not found in wp-content/plugins/attribute-stock-for-woocommerce/src/Compatibility/Actions/WPLister.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Mewz\\Framework\\Plugin' not found in wp-content/plugins/attribute-stock-for-woocommerce/src/Plugin.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WC_CSR_Sessions' not found in wp-content/plugins/attribute-stock-for-woocommerce/src/Compatibility/Components/WCCartStockReducerSessions.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Mewz\\Framework\\Base\\Action' not found in wp-content/plugins/attribute-stock-for-woocommerce/src/Actions/Common/StockChange.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 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
5 plugin tags: woocommerce stock, variable stock, shared stock, woocommerce, attribute stock

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

The primary PHP file in "WooCommerce Attribute Stock - Share Stock Between Products (Lite Version)" version 1.6.8 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • 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 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin19,235 lines of code in 118 files:
LanguageFilesBlank linesComment linesLines of code
PHP962,4762,1279,015
JavaScript81,4572,2968,364
CSS8401,287
PO File2177219488
JSON30076
XML1005

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity21.70
▷ Minimum class complexity1.00
▷ Maximum class complexity165.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces23
Interfaces1
Traits0
Classes73
▷ Abstract classes45.48%
▷ Concrete classes6994.52%
▷ Final classes00.00%
Methods677
▷ Static methods14922.01%
▷ Public methods61290.40%
▷ Protected methods639.31%
▷ Private methods20.30%
Functions17
▷ Named functions1376.47%
▷ Anonymous functions423.53%
Constants29
▷ Global constants00.00%
▷ Class constants29100.00%
▷ Public constants29100.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin