89% woocommerce-live-stock-quantity

Code Review | WooCommerce Live Stock Quantity

WordPress plugin WooCommerce Live Stock Quantity scored89%from 54 tests.

About plugin

  • Plugin page: woocommerce-live-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0+
  • WordPress version: 6.3.1
  • First release: Oct 12, 2013
  • Latest release: Oct 12, 2013
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: corsonr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /3,258 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

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

Analyzing server-side resources used by WooCommerce Live Stock Quantity
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.45 ▼0.87
Dashboard /wp-admin3.31 ▼0.0446.72 ▼15.22
Posts /wp-admin/edit.php3.36 ▲0.0043.29 ▲1.75
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.33 ▼15.93
Media Library /wp-admin/upload.php3.23 ▲0.0031.54 ▼4.68

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for WooCommerce Live Stock Quantity
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.69 ▼0.891.96 ▲0.1146.11 ▲3.71
Dashboard /wp-admin2,206 ▲155.86 ▲0.95111.25 ▼6.6944.07 ▼1.43
Posts /wp-admin/edit.php2,089 ▼32.00 ▼0.0635.42 ▼4.1833.79 ▼2.52
Add New Post /wp-admin/post-new.php1,534 ▲123.22 ▲0.11595.48 ▼55.4948.48 ▲1.20
Media Library /wp-admin/upload.php1,385 ▼64.22 ▼0.0298.62 ▼4.5840.45 ▼7.86

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

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

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 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
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Live stock settings), #2 (Product front page)
  • Tags: You are using too many tags: 16 tag instead of maximum 10
Please take inspiration from this readme.txt

woocommerce-live-stock-quantity/woo-live-stock-quantity.php 77% from 13 tests

The entry point to "WooCommerce Live Stock Quantity" version 1.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Domain Path: The domain path folder does not exist ("/languages/")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("woocommerce-live-stock-quantity.php" instead of "woo-live-stock-quantity.php")

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 plugin109 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP154105109

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity3.14
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.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

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.10MB with 0.06MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png13.44KB6.00KB▼ 55.35%
screenshot-2.png89.56KB37.79KB▼ 57.80%